On Wed, Jun 02, 2021 at 09:52:36AM BST, Alexandre Ratchov wrote:
> 
> There's no hotplug support for audio (yet), so if you plug the USB
> device while programs are using the internal device, you need to
> manually tell sndiod to switch to it, ex:

Until then, hotplugd(8) seems to be working just fine for uaudio(4)
devices, here.

The below is a stripped down version of my attach and detach scripts,
- they differ here, BTW - but it should be enough to get it working
on Peter's laptop.

        $ doas rcctl enable hotplugd
        $ cat <<'EOF' | doas tee /etc/hotplug/attach /etc/hotplug/detach
        #!/bin/sh

        DEVCLASS=$1
        DEVNAME=$2

        case $DEVCLASS in
        0)
                case $DEVNAME in
                uaudio*)
                        rcctl reload sndiod
                        ;;
                esac
                ;;
        esac
        EOF
        $ doas rcctl start hotplugd

Regards,

Raf

Reply via email to