4

I'm running a host of docker containers with ROS, for controlling a robot. One of the container has to play some audio files through the sound_play package. However it returns the error

Cannot connect to server socket err = No such file or directory  
Cannot connect to server request channel  
jack server is not running or cannot be started

I am able to aplay the audio (.wav) files from inside the container, my sound cards are definitely recognized, and I have also tried running the container in privileged mode. I have also tried to install jackd separately in the container and start a jack server, but get the error

Cannot lock down 82274202 byte memory area (Cannot allocate memory).  
Bus error (core dumped)

Is my understanding of the problem even correct? If so, how can I get jack server to start inside the container?

agakshat
  • 176
  • 3
  • 7

1 Answers1

5

I solved it by installing jackd1 instead of jackd2 since apparently, jackd2 needs real time priorities which I was not able to provide to the docker container. jackd1 did the trick though.
My Dockerfile:

FROM ubuntu:14.04
RUN apt-get update && apt-get install -y jackd1

Run command:

docker run -it --rm --privileged=true --device=/dev/snd:/dev/snd myContainerName jackd -R -d alsa -d hw:1

This will start a jack server in your container. The sound_play node worked fine after that.

Partial credits to http://crunchbang.org/forums/viewtopic.php?id=33530

agakshat
  • 176
  • 3
  • 7
  • For what I see this seems related to https://github.com/docker/docker/issues/13983 maybe you could try again with jackd2 once it's fixed – michael_bitard Jun 23 '16 at 07:09
  • Have subscribed to the issue, will try the fix when it's released and update here. Thanks! – agakshat Jun 24 '16 at 18:57