2018-06-19 22:12:16 +00:00
|
|
|
## Pulseaudio in Docker
|
2016-03-23 20:42:58 +00:00
|
|
|
|
2018-06-19 22:18:01 +00:00
|
|
|
Build and run it
|
2016-03-23 20:42:58 +00:00
|
|
|
|
|
|
|
```
|
2018-06-19 22:18:01 +00:00
|
|
|
docker build -t andrey01/pulseaudio .
|
2018-06-19 22:12:16 +00:00
|
|
|
docker run --name pulseaudio --rm -ti --device /dev/snd andrey01/pulseaudio
|
2016-03-23 20:42:58 +00:00
|
|
|
```
|
|
|
|
|
2018-06-19 22:14:28 +00:00
|
|
|
Use it
|
|
|
|
|
|
|
|
```
|
|
|
|
PULSE_SERVER=$(docker inspect pulseaudio -f '{{.NetworkSettings.IPAddress }}'):4713 mpv film.avi
|
|
|
|
```
|
|
|
|
|
2018-06-19 22:18:01 +00:00
|
|
|
## Client setup for zeroconfig auto discovery
|
|
|
|
|
|
|
|
If you want the pulseaudio to automatically discover the published sinks,
|
|
|
|
make sure ``/etc/pulse/default.pa`` has the following line:
|
|
|
|
|
|
|
|
```
|
|
|
|
load-module module-zeroconf-discover
|
|
|
|
```
|
|
|
|
|
|
|
|
Then restart pulseaudio:
|
|
|
|
|
|
|
|
```
|
|
|
|
pulseaudio --kill
|
|
|
|
```
|
|
|
|
|
2018-06-19 22:12:16 +00:00
|
|
|
## Troubleshooting
|
|
|
|
|
|
|
|
Enter the namespace of a running container
|
2016-03-23 20:42:58 +00:00
|
|
|
|
|
|
|
```
|
2018-06-19 22:12:16 +00:00
|
|
|
sudo nsenter -a -t $(docker inspect -f '{{ .State.Pid }}' pulseaudio)
|
2016-03-23 20:42:58 +00:00
|
|
|
```
|