Digital Input on USB Interface & Automatic Input Switching

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
chris.pike
Posts: 1
Joined: Mon Feb 21, 2011 11:53 am
Operating System: Please select

Digital Input on USB Interface & Automatic Input Switching

Post by chris.pike » Mon Feb 21, 2011 12:02 pm

I'm doing some programming with Portaudio. I'm using a USB audio interface with an ADC providing 2 analogue input channels and also an S/P DIF input.
When using Audacity there is some automatic input switching going on. I select the USB interface as the chosen capture device. If there is audio present on the digital input then this is recorded, if not then the analogue inputs are used. This switching occurs automatically and even switches during recording.
I initially assumed this switch was in my USB audio interface rather than in software such as audacity but in my own Portaudio application I am only reading the analogue inputs.
The PaDeviceInfo for my audio interface reveals that the maximum number of inputs is 2. I open a stream on this device with the input parameter PaStreamParameters::channelCount set to 2 and it reads from the analogue inputs. I can't see anywhere how to select which input channels you access in the Portaudio API.
If anyone can help me or point me to the part of audacity source code which selects which input channels it reads I would much appreciate it.
Thanks
Chris

Here is the output from the pa_devs app for this device:
--------------------------------------- device #3
Name = USB Audio CODEC : USB Audio (hw:1,0)
Host API = ALSA
Max inputs = 2, Max outputs = 2
Default low input latency = 0.012
Default low output latency = 0.012
Default high input latency = 0.046
Default high output latency = 0.046
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
11025.00, 16000.00, 22050.00, 32000.00,
44100.00, 48000.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
32000.00, 44100.00, 48000.00
Supported standard sample rates
for full-duplex 16 bit 2 channel input, 2 channel output =
32000.00, 44100.00, 48000.00

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Digital Input on USB Interface & Automatic Input Switchi

Post by Gale Andrews » Sat Feb 26, 2011 12:24 pm

What version number of Audacity? What make of USB interface? Is it a mixer device (can you choose between analogue and S/PDIF in Mixer Toolbar)? Can you choose between them in ALSAmixer?

The best place to ask about PortAudio and Audacity is on the audacity-devel subscription mailing list.



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Post Reply