[mythtv-users] HDMI keep alive, maybe via sending silent audio?
John Veness
John.Veness.mythtv at pelago.org.uk
Wed May 18 11:03:01 UTC 2016
On 17/05/2016 11:56, John Veness wrote:
> The trick is how to send a similar empty bitstream while in menus.
>
> So far I've been trying the aplay command, with no luck. If I do just
> "aplay /usr/share/sounds/alsa/Noise.wav" the command looks like it
> does something for a few seconds, but I hear no sound output.
>
> If instead I do "aplay -L" to list the devices, then "aplay -D
> dmix:CARD=HDMI,DEV=7 /usr/share/sounds/alsa/Noise.wav", which is the
> same audio device I have selected in mythfrontend, the command exits
> straight away, still no sound, and I get the error "aplay:
> set_params:1239: Channels count not available".
>
> All of this testing is while mythfrontend isn't running.
I've got a bit further with this. The "dmix" device is the one I've got
selected in mythfrontend, because all the others have their left and
right channels swapped for some reason. But I can't seem to get aplay to
work with the dmix device. If I do "aplay -D plughw:CARD=HDMI,DEV=7"
instead, I hear sound - possibly with left and right swapped but who
cares when I'll be outputting silence.
So I've got a loop like:
while [ true ] ; do aplay -q -D plughw:CARD=HDMI,DEV=7 silent.wav; sleep
150; done
This seems to work, in that it doesn't cause the soundbar to go to
sleep. I found that a two second sample of "silence" didn't seem to be
enough to keep the soundbar awake. Eight seconds is enough, but I
haven't tried anything in between. The "sleep 150" sleeps for two and a
half minutes, so it isn't making a silent "sound" all the time.
If Myth happens to be outputting sound at the time the loop comes around
(i.e. every 2.5 minutes), the aplay command just fails as it isn't able
to output any sound, but that's fine and it will try again in another
2.5 minutes.
More problematic is what happens if someone presses play on a recording
in the exact time when aplay happens to be outputting sound. In that
case, Myth will start the video, but the playback will be silent, with
an error message saying it couldn't open the sound device or similar.
With a, say, 5 second sample every 2.5 minutes, there's a roughly 3.33%
chance of this happening, or once in every 30 recordings played back,
which is often enough to be annoying, I think.
I am considering looking into MythTV System Event Handlers, to do
something like "pkill aplay" when playback starts, but haven't tried
that yet.
John
--
John Veness, MythTV user, UK, DVB-T
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20160518/2508ff3d/attachment.html>
More information about the mythtv-users
mailing list