DOC,ENH: How to connect container pipewire, alsa, jack to host pipewire
Version, Distribution, Desktop Environment:
- FC34 latest; podman
Description of Problem:
- How can I play audio through pipewire from within a container on Fedora (with container-selinux, if that's at all relevant)?
- https://stackoverflow.com/questions/68973199/pipewire-audio-in-fedora-container
How Reproducible, Steps to Reproduce, Actual Results:
## Host: Check local ALSA and Pipewire config
aplay /usr/share/sounds/alsa/Front_Center.wav
pw-cat -p /usr/share/sounds/alsa/Front_Center.wav
## Host: Start a container
podman run -it --device /dev/snd --systemd=always fedora:34
## Container: Install utils and test sound from within
### Test with `aplay`
dnf install -y alsa-utils # a few MB and a few WAVs
aplay /usr/share/sounds/alsa/Front_Center.wav
# aplay: main:831: audio open error: Host is down
### Test with `pipewire-utils`
dnf install -y pipewire-utils # it says 207MB w/o
pw-cat -p /usr/share/sounds/alsa/Front_Center.wav
pw-play /usr/share/sounds/alsa/Front_Center.wav
# error: pw_context_connect() failed: Host is down
- No audio plays on the host workstation (where local
pw-cat
andaplay
are known to work)
Expected Results:
- Audio plays on the host workstation
Additional Info Eg. pw-dump -N > file
(As Attachment Please):
- It should not be necessary to run with
--privileged
; that's a no go. - Is there a simpler one podman/docker command to test that {PipeWire, ALSA, JACK} does not error when run within a container with or without systemd?