On Sun, Nov 22, 2020 at 07:48:14PM +0100, Jan Stary wrote:
> This is current/amd64 (dmesg below),
> running /usr/bin/sndiod -f rsnd/0 -F rsnd/1
> 
> While the -F feature works with most USB audio devices I have tried,
> it does not make the switch to use the -F device
> with this USB camera with a builtin microphone.
> It's an Audom AF640 and it attaches as follows:
> 
> uvideo0 at uhub0 port 1 configuration 1 interface 0 "Sunplus IT Co Full HD 
> webcam" rev 2.00/0.05 addr 2
> video0 at uvideo0
> uaudio0 at uhub0 port 1 configuration 1 interface 3 "Sunplus IT Co Full HD 
> webcam" rev 2.00/0.05 addr 2
> uaudio0: class v1, high-speed, sync, channels: 0 play, 1 rec, 2 ctls
> audio1 at uaudio0
> 
> I can confirm that both the camera and the mike themselves work.
> After plugging it in, sndioctl says
> 
> input.level=0.000
> input.mute=1
> output.level=0.980
> output.mute=0
> server.device=0
> app/rec0.level=1.000
> 
> Notice the server.device=0, meaning it is still using snd/0.
> Notice the zero input level and the muted input.
> Is this intended?
> 
> If I plug a Sennheiser haedset instead, sndioctl says
> 
> input.level=0.800
> input.mute=0
> output.level=0.800
> output.mute=0
> server.device=1
> app/rec0.level=1.000
> 
> switching to the USB device plugged in.
> 
> Is it because the camera's mike has no output channels?
> "channels: 0 play, 1 rec, 2 ctls" - indeed, it only
> records mono and has no playback capabilities.
> 
> According to the manpage
> 
> -F device
>         Specify an alternate device to use.  If it doesn't work,
>         the one given with the last -f or -F options will be used.
>         For instance, specifying a USB device following a PCI device
>         allows sndiod to use the USB one preferably when it's
>         connected and to fall back to the PCI one when it's
>         disconnected. Alternate devices may be switched with the
>         server.device control of the sndioctl(1) utility.
> 
> Is the -F device required to have at least one playback
> and pne record channel to "work"?
> 
> Switching with a manual "sndioctl server.device=1"
> doesn't work either: sndioctl still shows server.device=0
> 
> Is this intended?
> How can I further debug this?
> 

Hi,

The -F option works only if two devices have the same capabilities,
this allows to pull the USB cable and continue using the internal
device.

In your case the webcam can't play but sndiod is configured to use
full-duplex mode. From this stand-point, the webcam is not usable and
sndiod tries the next device.

sndiod could/should be changed to simply discard samples to play and
always present the webcam as a full-duplex device (similarly, produce
silence for play-only devices). The code to do so is not there yet,
unfortunately.

Reply via email to