Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6758

Ubuntu Docker no sound despite mounting [closed]

$
0
0

I am running a Raspberry Pi 4 with Ubuntu 22.04 connected to an Elecrow 7inch LCD Display-H 1024x600 that has an audio jack for headsets and comes with two speakers.I am trying to setup a docker image that connects to the sound devices to record and play audio using a Python script with PyAudio. In my compose file, I am mounting:/dev/snd:/dev/snd and even tried running in privileged mode.

Running aplay -l inside (and outside) the docker container shows following output:

$ aplay -l**** List of PLAYBACK Hardware Devices ****card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]  Subdevices: 7/8  Subdevice #0: subdevice #0  Subdevice #1: subdevice #1  Subdevice #2: subdevice #2  Subdevice #3: subdevice #3  Subdevice #4: subdevice #4  Subdevice #5: subdevice #5  Subdevice #6: subdevice #6  Subdevice #7: subdevice #7card 1: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]  Subdevices: 1/1  Subdevice #0: subdevice #0card 2: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]  Subdevices: 1/1  Subdevice #0: subdevice #0

I assume the issue is that Ubuntu on startup defaults to using the audio jack, despite no headset being connected to it instead of the two speakers. The Ubuntu settings menu shows two options: "Headphones - Built-in Audio" and "Digital Output - S/PDIF - Built-in-Audio.Switching to the latter will use the speakers, however, inside the docker container I still won't get any audio.I believe I need to default to the second option on a system level somehow, but I am not sure how to achieve this with ALSA, only Pulseaudio. Especially, as it is not listed in above's command output.Any suggestions would be appreciated.


Viewing all articles
Browse latest Browse all 6758

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>