Sound modules on UCore

Happy new year everyone! I have started using ucore, and it seems perfect for my Asus NUC-based NAS, except for one small detail: I use the NUC also as media center, running Airsonic-Advanced in a podman container and I use jukebox mode, playing sound directly from the NUC HDMI port.

I noticed however, that the sound devices and not detected. An lsmod command shows me that the sound kernel modules are not loaded! This makes of course perfect sense for a CoreOS-based system, but I was wondering if you knew how to load the appropriate modules (perhaps via an udev rule)?

The NUC runs an AMD gpu and I use the sound from an HDMI port. Should I layer the AMD GPU drivers in your opinion, to get the sound working from HDMI?

Thanks in advance to everyone who can help!

Alright, on second thought, I think the problem might be different. I see that the modules are loaded, but I cannot see any audio devices in the podman containers I run despite mounting /dev/snd into them.

I think it might be a permission issue. I will investigate and report

Thanks for sharing this and I do look forward to your report.

I haven’t tested audio out on a ucore system, but I can share that from what I see, on both a ucore(CoreOS) server and a universal blue(Silverblue) desktop, I see the same basic situation in /dev/snd.
When I do ls -lZ /dev/snd I see files owned by root with group audio and label system_u:object_r:sound_device_t:s0.

I would not be surprised if your container had a permissions issue related to SELinux. The simplest way to test is to disable SELinux for the container by running with --security-opt label:disable

Thanks @bsherman ! The container is running already with --security-opt label:disable. You are right that the kernel modules are OK, so this is not the culprit. However, I noticed that if I create a basic container with distrobox, I can see the audio devices in the container (with aplay -l, while in my container I don’t see the device)

If you see the sound devices on the host with aplay -l but not in the container, then I would assume they are not mounted correctly (maybe need a different/extra path besides /dev/snd) or else there’s a permissions problem.

Can you share the specific podman command used to run this container? Also is this a rootful or rootless container? I do expect you’ll see some issues trying to provide a physical devices to rootless containers.

Hi @bsherman I made some progress yesterday evening, and I think I solved the issue. It was a multi step approach:

  1. First of all, it looks like in normal Fedora access to audio is handled for the logged in used by PolicyKit, so I had to add my user to the audio group, which is originally not in the /etc/group file. I copied the audio line from the /usr/lib/group file to the /etc/group and rebooted:

audio:x:63:my user

  1. I then had to launch the podman container with the following options:

–group-add keep-groups

To keep the audio group in the container (but the software in the container has to run as root, which maps to my user on the host!) and

–device /dev/snd

To let the container access the audio device. I can now play music from inside the container!!!

Thanks for your help and advice!

EDITED: typos

2 Likes

Wonderful! I’m glad you got this working and should share the answer with us!

@bsherman thank you! Yes I wrote the procedure I followed above