-1.2 C
United States of America
Thursday, December 5, 2024

macos – Play audio from Docker container


On my MacBook (Sonoma 14.6.1), I’ve received a Python script that makes use of pyaudio (which makes use of portaudio) to play audio information by way of my speaker. The script works simply superb. Nevertheless, for causes, I would wish to run the script inside a Docker container (Ubuntu 22.04). Once I run my script that method, I get

ALSA lib confmisc.c:855:(parse_card) can't discover card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_card_inum returned error: No such file or listing
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_concat returned error: No such file or listing
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating title
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_refer returned error: No such file or listing
ALSA lib conf.c:5701:(snd_config_expand) Consider error: No such file or listing
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM sysdefault
ALSA lib confmisc.c:855:(parse_card) can't discover card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_card_inum returned error: No such file or listing
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_concat returned error: No such file or listing
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating title
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_refer returned error: No such file or listing
ALSA lib conf.c:5701:(snd_config_expand) Consider error: No such file or listing
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM sysdefault
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.entrance
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.rear
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.center_lfe
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.facet
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.surround21
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.surround21
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.surround40
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.surround41
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.surround50
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.surround51
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.surround71
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.iec958
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.iec958
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.iec958
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.hdmi
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.hdmi
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.modem
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.modem
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.phoneline
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM playing cards.pcm.phoneline
ALSA lib confmisc.c:855:(parse_card) can't discover card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_card_inum returned error: No such file or listing
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_concat returned error: No such file or listing
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating title
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_refer returned error: No such file or listing
ALSA lib conf.c:5701:(snd_config_expand) Consider error: No such file or listing
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:855:(parse_card) can't discover card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_card_inum returned error: No such file or listing
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_concat returned error: No such file or listing
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating title
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_refer returned error: No such file or listing
ALSA lib conf.c:5701:(snd_config_expand) Consider error: No such file or listing
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:855:(parse_card) can't discover card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_card_id returned error: No such file or listing
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_concat returned error: No such file or listing
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating title
ALSA lib conf.c:5178:(_snd_config_evaluate) operate snd_func_refer returned error: No such file or listing
ALSA lib conf.c:5701:(snd_config_expand) Consider error: No such file or listing
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM dmix

I am guessing this has one thing to do with the container being unable to find the audio system. Is there an possibility I can cross to docker run to mount the system?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles