site  contact  subhomenews

Sound fix in containers

June 07, 2020 — BarryK

Running EasyOS 2.3.1, I clicked on "sfsget" and downloaded Firefox, and chose to run it in a container. It works, but when went to YouTube, discovered there is no sound.

Sound has worked previously, so what's up?

The difference is that I am now using HDMI output for sound. Previously, used the internal audio interface and external cable speakers. The latter works fine, but with HDMI, no sound in container.

I found the fix. In /usr/local/easy_containers/ec-chroot, you have to insert two lines, at line 146:

#181006 for sound output (see also $SND below):
cp -a -f /etc/asound.state ${CONTAINER}/etc/
#200607 hdmi sound not working in container, fix...
cp -a -f /etc/asound.conf ${CONTAINER}/etc/
[ -f /root/.asoundrc ] && cp -a -f /root/.asoundrc ${CONTAINER}/root/

It's those last two lines that do the trick. This fix will of course be in the next release, but you can do it now, if you don't have sound in containers. 

Tags: easy