You are not logged in.

#1 2021-03-17 20:22:22

zangarmarsh
Member
Registered: 2021-03-17
Posts: 3

No sound in Systemd-nspawn container using alsa

I am unable to get sound in a systemd-nspawn container. I am only using alsa, not pulseaudio.

When starting the container I bind my sound card:

--bind=/dev/snd/controlC0

I must explicitly bind /dev/snd/controlC0 and not just /dev/snd/ or it doesn't show up but this should not be an issue as that is the only card the container needs to see.

Container aplay -l output is:

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

Container /etc/asound.conf is:

pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}

The closest solution I can find is https://bbs.archlinux.org/viewtopic.php?id=215244 but adding --share-system does not help.

Everything seems to be in order but there is no sound:

speaker-test -c2

speaker-test 1.2.4

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Playback open error: -2,No such file or directory

Alsamixer displays identical information on both the host and the container. The channels are unmuted.

Offline

Board footer

Powered by FluxBB