Giter Club home page Giter Club logo

docker-pulseaudio-example's Introduction

Docker PulseAudio Example

An example of a PulseAudio app working within a Docker container using the hosts sound system

Docker Hub

Building

./buid.sh

Running

./host_runner.sh

Explanation

Getting a PulseAudio app to work within a Docker container is harder than it looks. This example is designed to produce the smallest working configuration that can be used in your own containers.

To be clear this is designed so the app within the Docker container does not run a PulseAudio server. Instead the app connects as a client directly to the hosts PulseAudio server and uses it's configuration/devices to output the sound. This is achieved by mapping the UNIX socket used by PulseAudio in the host into the container and configuring its use.

Most of the complexity of the Dockerfile is setting up a non root user. This is kept in the example as near all uses of this should not be running the app as root.

Common / Known Issues

SHM

shm_open() failed: No such file or directory Is caused by PulseAudio trying to use Shared Memory (/dev/shm or /run/shm) as a performance enhancement. In this example SHM is disabled to prevent this issue.

TCP / Avahi

This would be another method to configure PulseAudio by enabling the host server to open an TCP server and the container connecting to it. This was avoided as it:

  • Unnecessarily causes the container to be networked to the host.
  • Requires additional PulseAudio modules and changed configuration on the host.
  • Is less performant.

docker-pulseaudio-example's People

Contributors

thebiggerguy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.