<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi, <br>
</p>
<p>This can be achieved fairly "simply" (as long as you know what to
look for).</p>
<p>You need to pass the pulse socket into the container and tell
pulse clients inside the container its precise path.</p>
<p>So on Docker CLI, for a typical Pulse daemon running in
userspace, it would be something like:</p>
<table width="1666" height="27" cellspacing="2" cellpadding="2"
border="0">
<tbody>
<tr>
<td valign="top" bgcolor="#000000"><b><font size="+1"
color="#ffffff"><code>-v
/run/user/1000/pulse:/run/user/1000/pulse </code></font></b><br>
</td>
</tr>
</tbody>
</table>
<p>Inside the container, once you've installed Pulseaudio, you need
to modify its client configuration:</p>
<p><font color="#0027ff"><u>/etc/pulse/client.conf</u></font></p>
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tbody>
<tr>
<td valign="top" bgcolor="#000000">
<pre><b><font size="+1" color="#ffffff">default-server = /run/user/1000/pulse/native</font></b>
</pre>
</td>
</tr>
</tbody>
</table>
<p>With this your Pulseaudio applications should be able to play
sounds through the host PulseAudio server (of course, you'd need
to adapt the runtime paths to your environment).</p>
<p>Bear in mind, there seems to be some inconsistencies in the way
various Pulse utilities interface with the daemon. In this setup
for example, <font face="Droid Sans">"pacmd</font>" won't work,
whilst <font face="Droid Sans">"pactl</font>" works fine once the
client configuration is fixed. <br>
</p>
<p>You could test this in a manual way first and then automate
things a bit with a Dockerfile and what not.</p>
<p>Best regards.<br>
</p>
<div class="moz-cite-prefix">On 12/12/2020 16:19, Jan Van den
Audenaerde wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAKpxqHdSput68Mt0tiOqm2z3OmVD=N4mJ3JnG=kFdDRu-=S56g@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi,
<div><br>
</div>
<div>I have spend several days without success figuring out how
I can use pulseaudio in a container setup on an embedded
device.</div>
<div><br>
</div>
<div><i>I am running CentOs 8 on a headless device (intel-nuc)
which is also running docker.<br>
I would like to run pulseaudio server on the host (CentOs 8)
and my docker containers should be able to use pulseaudio
client to communicate with the pulseaudio server via
pulseaudio unix socket.<br>
Moreover it should be possible that different docker
containers can access the microphone and speaker at the same
time.</i><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>The main problem I am facing I have reported in following
forum post: </div>
<div><br>
</div>
<div>
<ul>
<li><a
href="https://forums.centos.org/viewtopic.php?f=54&t=76643"
moz-do-not-send="true">https://forums.centos.org/viewtopic.php?f=54&t=76643</a></li>
</ul>
<div><br>
</div>
<div>Any help would be much appreciated.</div>
</div>
<div>I also think that pulseaudio has the good requirements for
use in a container setup if I only can make it work.</div>
<div>Jan.</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
pulseaudio-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:pulseaudio-discuss@lists.freedesktop.org">pulseaudio-discuss@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss">https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss</a>
</pre>
</blockquote>
</body>
</html>