Turn off audio keep-alive signal while streaming video

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
sala_mander Offline
Junior Member
Posts: 2
Joined: Apr 2016
Reputation: 0
Post: #1
I'm experimenting with using only Alsa with Alsaequal and Preamp on an Ubuntu 16.04 HTPC installation, the idea being to strip out as much 'unnecessary' stuff (ie pulseaudio), but retaining as much audio fidelity and control as possible.

I've discovered that setting 'keep audio device alive' to anything other than 'Never' causes a blast of hiss/static to be output to speakers during times when the audio device is not being used. This seems to be an issue with my alsa setup and the audio signal output by Kodi in order to keep the audio device alive.

Setting 'keep audio device alive' to Never solves the issue for the most part - audio is clear and crisp, and balanced the way I want it, and the audio device responds readily. However, I find that the issue happens with streaming video whenever the video has to buffer or frames are lost - loud blast of static to the speakers. This is regardless of using any of the streaming plugins or just a strm file pointing to a network streaming source.

It seems that audio keep-alive signal is sent by the Kodi player whenever the network stream needs to buffer, or otherwise halts temporarily.

Here's my question: Is there a way to disable this behaviour? Can Kodi be configured not to send this audio signal under any circumstances?

(Of course I realize my Alsa config might be to blame, but it works with everything else I've tried so I'm starting with Kodi.)

find quote
fritsch Offline
Team-Kodi Developer
Posts: 15,490
Joined: Aug 2011
Reputation: 457
Location: Stuttgart*
Post: #2
The noise is sent by design to keep HDMI output devices awake. They are too smart for "plain zeros" and go offline immediately. We send a bunch of noise (random noise) when starting playback or to care for underruns if there is no additional audio data while playback.

That noise values are so damn low that I can only "feel" it's not really hearing anything when I ramp up my hifi system to the maximum level.

You can patch the code to remove it: https://github.com/xbmc/xbmc/blob/master....cpp#L1082 <- see the factor: 0.00001f you can change it to 0.000000001 or something and see when you stop hearing it. Make sure your AVR still does not fall a sleep :-)

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
sala_mander Offline
Junior Member
Posts: 2
Joined: Apr 2016
Reputation: 0
Post: #3
Thanks for the information fritsch.

I'll give it a go.
find quote