Re: USB sound devices with FreeBSD-CURRENT

From: Samy Mahmoudi <samy.mahmoudi_at_gmail.com>
Date: Sun, 13 Sep 2020 14:56:43 +0200
Hi,

If reducing the audio buffer size in virtual_oss does not solve the issue
and you temporarily resort to use PulseAudio to achieve switching devices
on-the-fly (which does work very well with PulseAudio), you could indeed
'keep the devices connected' and use a variant of the following script:

#!/usr/local/bin/zsh
SINK_INDEX1=1
SINK_INDEX2=4
ACTIVE_SINK=$(pacmd list-sinks | grep '* index:' | /usr/local/bin/grep -o
'[0-9]*')
if [ "$ACTIVE_SINK" = $SINK_INDEX1 ] ; then
    pacmd set-default-sink $SINK_INDEX2
    pacmd list-sink-inputs | awk '/index:/{print $2}' | xargs -r -I{} pacmd
move-sink-input {} $SINK_INDEX2
else
    pacmd set-default-sink $SINK_INDEX1
    pacmd list-sink-inputs | awk '/index:/{print $2}' | xargs -r -I{} pacmd
move-sink-input {} $SINK_INDEX1
fi

In its current form, it allowed me to switch devices on-the-fly with a
keyboard shortcut.

The problem is I had to use a poudriere to build relevant ports with option
PULSEAUDIO (chromium, firefox, mpv, audacious, virtualbox, etc.) and there
may have been (I can not remember precisely) another problem if the USB
headset was either hot-plugged or hot-unplugged. Please let us know if you
manage to sort this out with virtual_oss.
Received on Sun Sep 13 2020 - 10:56:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:25 UTC