Hello everyone, im trying to make my mic visable inside container, im running ubuntu server 20.04 LTS on Rasspbery Pi 4.
You’ll likely need to pass through a bunch of the
/dev/snd/ devices through
unix-char devices (if using LXD). If using LXC, then you’ll need lxc.mount.entry entries for those combined with lxc.cgroup.devices.allow entries.
An alternative if your rpi is running pulseaudio on the host is to instead just pass in the pulseaudio socket, you can look at how this is done in the various Steam in container tutorials and posts.
thank you for answer, but it is a little complicated for me. Do you think, can i just make my microphone visable inside my container via USB? Do you think should it work?
No, it won’t work. Microphones on Linux are handled directly by a kernel driver which creates those /dev/snd/ devices, those are then consumed by something like pulseaudio/pipewire/jack which then lets your normal software interact with them.
Just passing through the USB device (/dev/usb/…) will not help as no software will know how to deal with those devices at the USB level.
thanks a lot for your help, my microphone is working now, I added 4 devices from /dev/snd directory to my lxd container, everything is working fine.
Command that i used looks like this:
lxc config device add <container_name> <name_your_device> unix-char source=<path>/<device>
In my case:
lxc config device add testing devsnd unix-char source=/dev/snd/controlC1
Thanks a lot for help,