Using audio on a container with Podman, on Mac OS

Viewed 284

I'm trying to use audio on a container launched with Podman on MacOS.

The container is jess/pulseaudio

I am using a big Sur OS with an Apple M1 chip ( also tested on an INTEL chip)

I use podman in version 3.4.4

The commmand podman run hello world works well

After launching podman ( podman machine init and podman machine start), I connect with ssh to the VM and install pulseaudio alsa-utils pulseaudio-utils on the VM. Then I launch pulseaudio on the host Mac OS and on the podman VM with the command

pulseaudio --load=module-native-protocol-tcp --exit-idle-time=-1 --daemon

Then I run the following command to launch the container:

podman run -it -e PULSE_SERVER=docker.for.mac.localhost -v /home/core/.config/pulse:/home/pulseaudio/.config/pulse --entrypoint speaker-test --rm jess/pulseaudio -c 2 -l 1 -t wav

and I get this error on my host terminal (the containers is then not launch):

{"msg": "exec container process "/usr/bin/speaker-test": Exec format error","level":"error","time":"2021-12-13T12:40:09.000532852Z"}

when I run the following command

podman run -it -e PULSE_SERVER=docker.for.mac.localhost -v /home/core/.config/pulse:/home/pulseaudio/.config/pulse --rm jess/pulseaudio

I get this error:

{"msg":"exec container process "/usr/bin/pulseaudio": Exec format error","level":"error","time":"2021-12-13T13:00:04.000533324Z"}

I would like to point out that the following command works for me with Docker, on the same macOS:

docker run -it -e PULSE_SERVER=docker.for.mac.localhost -v ~/.config/pulse:/home/pulseaudio/.config/pulse --entrypoint speaker-test --rm jess/pulseaudio -c 2 -l 1 -t wav.

I know that Podman uses a virtual machine on Mac OS. So I think I should first link the audio of the virtual machine with the audio of the MacOS host like when I mount volumes (first I mount the volume on the VM and then on the container) but I'm not sure. Is there some specific podman configuration or command to use audio, or should I do it manually ?

Do you have an idea?

0 Answers
Related