<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Sound output using DisplayPort is NOT played during the first 3-5 seconds (on several audio hardware)"
href="https://bugs.freedesktop.org/show_bug.cgi?id=92889#c24">Comment # 24</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Sound output using DisplayPort is NOT played during the first 3-5 seconds (on several audio hardware)"
href="https://bugs.freedesktop.org/show_bug.cgi?id=92889">bug 92889</a>
from <span class="vcard"><a class="email" href="mailto:eurbah@free.fr" title="Etienne URBAH <eurbah@free.fr>"> <span class="fn">Etienne URBAH</span></a>
</span></b>
<pre>Lot of thank to Paul for his last comment :
Supposing that this 'sound not played during the first 3-5 seconds' issue comes
from an initialization delay, I imagined following (heavy) keep-alive system,
which succeeds !
Firstly, simple sound tests can be performed using shell commands with the WAV
files from the '/usr/share/sounds/alsa' folder. For example :
$ aplay /usr/share/sounds/alsa/Noise.wav
$ speaker-test -D front -c 2 -l 1 -t wav -w Noise.wav
Secondly, after having set 'microphone level' = 1%, you can create a file
containing 60 seconds silence using following command :
$ arecord -D default -f S16_LE -r 48000 -d 60
Silence-Mono-S16_LE-48kHz-60s.wav
The file size is 5.5 MB (which is enormous for silence), but it permits
'speaker-test' to play this file (if you want).
As 'root', you can create the '/usr/local/share/sounds' folder and copy the
'Silence-Mono-S16_LE-48kHz-60s.wav' inside.
Then you can start the 'keep-alive-hdmi-or-displayport-audio-output.sh' script
below as a user session daemon.
After that, when playing any sound, the first 3-5 seconds are NOT lost anymore,
but are really played.
I suggest that you test my workaround, then try to devise a much lighter
workaround at a lower level (like Windows does).
#!/bin/sh -e
# keep-alive-hdmi-or-displayport-audio-output.sh
set -e
pactl --version > /dev/null
LANGUAGE=en_US:en
while true
do
if pactl info | grep -q -i "^ *Default *Sink *:.*\.hdmi"; then
aplay -q /usr/local/share/sounds/Silence-Mono-S16_LE-48kHz-60s.wav
else
sleep 10
fi
done</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>