Use audio card for Shairport on LXC ("/dev/snd": no such file or directory)

francescoq

New Member
Oct 28, 2024
3
0
1
Hi! I'm trying to create a container to use the audio card of my minipc to airplay in the room where it's located
I'm planning to use Shairport with docker
I've my container up and running, with docker installed. I run

docker run -d --name shairport --net host --device /dev/snd --restart always mikebrady/shairport-sync:development

but when it tries to start the container I get

Code:
[+] Running 0/0
 ⠋ Container shairport  Starting                                                                                                                           0.0s
Error response from daemon: error gathering device information while adding custom device "/dev/snd": no such file or directory

I took a look around and saw that since 8.1 there's an easier way to map it ( https://forum.proxmox.com/threads/playing-audio-in-a-lxc-container.138310/ )
but this is where I'm a bit lost, I pass "/dev/snd" to docker so I don't think mapping all the things inside of it could work, is there a way to map the entire /dev/snd part? (maybe a stupid question, but it's the first time I'm trying to do something with mapping of devices and things like that... )

EDIT: as additional info, if it could be useful, the host is a Beelink Mini S12 Pro
 
Last edited:
Ok, sorry, maybe I did something wrong the first time when I tried to map everything and thought it was a different thing...
Now I remapped and it recognize /dev/snb ... I hear absolutely nothing, but this is another problem I suppose... I'll continue investigating, sorry on wasting time :D