Linux Occasional audio drop-out with DTS-HD
#1
I build locally, and am currently running a build from about a week ago, so it's pre-13. However this is an issue I've observed a few times over the past few months with various builds. While watching a move with DTS-HD Master audio, and I'm bitstreaming to my receiver, I occasionally have a drop in audio, lasting maybe one second. If I go back and watch that scene again, the audio dropout does not repeat at the same point, so there doesn't appear to be a problem with the file itself.

Here's a log file with information from the last boot and while viewing the movie. Movie starts at 21:31:05 in the log.

Here's some particulars about my machine:
AMD Phenom II quad-core
nVidia GT430 currently with version 304.48 drivers
Linux 3.2.0-37-generic #58-Ubuntu SMP Thu Jan 24 15:28:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

HDMI output to Denon 4810, bitstreaming all types since the receiver can handle it. TV is 1920x1080p60, I have XBMC set to convert video to that.

Here's a couple log messages that seem to indicate the error:
22:43:00 T:139818617018112 ERROR: CAESinkALSA::HandleError(snd_pcm_wait) - underrun
22:43:03 T:139817123821312 DEBUG: CDVDPlayerAudio:: Discontinuity2 - was:4244321919.216628, should be:4244227652.236931, error:-94266.979697

The Discontinuity2 error appears more frequently, and far more than the underrun, and I don't recall the dropout occurring that often. The underrun occurs 6 times, although I thought it only happened 3 or 4 times but I might be wrong.

I've only seen this happen with DTS-HD. I've watched a number a number of other videos, most with DD or some two channel audio, and never had a problem. I also have no issues playing FLAC or mp3.

So is this the state of AudioEngine at the moment, or is there perhaps some setting I can change? I removed pulse when I made the move to a Frodo beta with AudioEngine. That certainly made life easier as far as setup goes.
Reply
#2
The answer is: yes.

There are some parts within AudioEngine that are not optimal yet. For example the "delay" calculation is done without any locks. So while "syncing" audio and video, the queues are constantly filled and emptied and everything is pretty wrong down there.

I see from your logfile, that the gr4ken is hungry really often :-) I fixed this with some later patches after this first push.
Quote:22:36:42 T:139818617018112 DEBUG: CAESinkALSA - the grAEken is hunger, feed it (I am the downmost fallback - fix your code)

Pulseaudio is at the moment not "fully" implemented, basically there is default sink support. My last tests with PA were not that nice - as i heard crackle all the time. I think this is because of multiple resampling, but ALSA currently is enough work. For now the pulse audio engine is very clean and easy to analyze, so if you find time and want to implement a proper PulseAE Sink, we would be happy if you did so :-)

For the DTS-HD dropouts, you can try to set the Sync Method to "Audio Clock" or Disable "Sync Playback" to Display completely. Another chance is, that you try again with the latest version as there some delay calculations have been fixed. Perhaps it works better for you now.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#3
Thanks for the feedback fritsch. That's an interesting error message, I missed it while I was going through it.

My experience with Pulseaudio was painful at best, and my overall experience with Linux audio has not been good over the past decade or so. It's getting better, but I tend to worry about making changes because in the past I've gotten things so screwed up the only way I could fix them was to reinstall Linux. Pulseaudio kept getting in my way with XBMC, so I took the risk some time ago and removed it, and after that life has been so much easier. So I'm afraid I'm going to have to pass on your invitation to work on that. Smile I'm just glad XBMC is making such an effort to make Linux audio a bit more bearable.

I'm pulling the latest code and will give it a try. If I encounter it again I'll be sure and give those settings a try.
Reply
#4
I'm still having this problem, and now I'm running 12.2. Here's a log. Every now and then when watching a movie with DTS-HD MA there's a dropout for a few seconds. Here's a snippet when this occurred:
Code:
22:44:14 T:140216167606016   ERROR: CAESinkALSA::HandleError(snd_pcm_wait) - underrun
22:58:46 T:140216167606016   ERROR: Previous line repeats 1 times.
22:58:46 T:140216167606016   ERROR: CAESinkALSA::HandleError(snd_pcm_avail) - underrun

I tried changing sync playback to Audio Clock, it was disabled to begin with I think. I tried a few of the options, and it kept occurring.

I found some posts on an OpenElec forum that seemed to indicate this was a problem in AudioEngine. I'm wondering if I should try switching to the nightlies.

XBMC 12.2 Git:32b1a5e (compiled May 2 2013)
Ubuntu 12.04.2 LTS 3.2.0-43 Generic x86_64
GT 430 - OpenGL version: 4.2.0 NVIDIA 304.48
Quad core AMD Phenom II, 16GB
I'm using HDMI out to a Denon 4810 that can process just about everything. No pulse audio involved, AE sees the Denon receiver just fine. I leave "Adjust display refresh rate to match video" off.

If anyone else wants anymore info just ask away.
Reply
#5
Kepp "Adjust Refreshrate to match video" _on_ if you sync 24p to 60hz, it will drop at some point and that you will hear.

Quote:23:15:45 T:140215096170240 NOTICE: fps: 23.976024, pwidth: 1920, pheight: 800, dwidth: 1917, dheight: 796
23:15:45 T:140215096170240 NOTICE: Display resolution DESKTOP : 1920x1080 @ 60.00 - Full Screen (16)

Please get me the links to Xorg.0.log and also DISPLAY=:0 /usr/lib/xbmc-xrandr | pastebinit
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#6
xrandr output
xorg.0.log

I ran xrandr from an ssh login, not sure if it'll show exactly what you want.

So are you saying that the only way to have seamless audio is to sync the display? That option does work for me, I just don't like all the flickering that goes on when it switches so I don't bother with it.
Reply
#7
Yes. That is what i am saying - If you want both. If you only want seamless audio, choose Sync Playback to Diplsay with Method "Audio Clock" but don't complain about stuttering frames later :-)

With passthrough you don't have a real chance then either drop or dupe audio or drop video frames.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#8
OK, I figured it would work either way since other devices such as blu-ray players can do it. I'll give it a try later on and see how it works for me.
Reply
#9
Your xrandr ouput is wierd becaus no display devices are active...

post your xorg.conf pls!
ASRock Beebox J3160 4GB RAM 120GB SATA SSD - Harmony Elite BT
Intel NUC Kit DN2820FYKH 4GB RAM 120GB SATA SSD - Harmony Smart Control BT
all @ Libreelec Testbuild
HP N54L @ Ubuntu 14.04.4 Minimal Server / MySQL DB
HP N40L @ Ubuntu 14.04.4 Minimal Server
Reply
#10
I have the same issue with all the HD audio streams (DTS-HD, True-HD) on my openelec 3.0.3 box. I have tried a number of different configs to try and get it working but nothing has help/changed the problem.

I attached a few logs to this post on the Openelec forum: http://openelec.tv/forum/68-audio/63878-...rt=6#72925

If there is any other output that is needed please let me know and I will attempt to get them tonight when I get home.
Reply
#11
(2013-05-19, 22:42)john.cord Wrote: Your xrandr ouput is wierd becaus no display devices are active...

post your xorg.conf pls!

Must have been because I didn't have the receiver or TV on I'm guessing. Here's an updated one.
Reply
#12
Quote: <mode id="0x1eb" name="1920x1080" w="1920" h="1080" hz="24.00000" current="false" preferred="false"/>
<mode id="0x1ec" name="1920x1080" w="1920" h="1080" hz="23.97091" current="false" preferred="false"/>

The second one is not really perfect (23.976 we need). If you have some time, follow this tutorial: http://openelec.tv/forum/68-audio/61795-...d-on#69329
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#13
I tried that and it didn't change any of the values that xrandr shows.

I'm not sure why it would though, wasn't the standard way querying my receiver to determine which modes it supported? It could be that there's something about my receiver's video processing that forces it to 23.97091. Granted at that rate I'm only dropping 18 frames per hour. That comes out to being out of sync by 1 second every 78.5 minutes. Is that even worth worrying about?
Reply
#14
Yes. Cause it depends, when the dvdplayer registers "out of sync" and it does not do this after 1 second, but much earlier. I think you will see a slite stutter every 3.xy minutes.

Can you pastebin your xorg.conf after you did the howto and also paste your xbmc-xrandr again? Optimizing is finished, when it is perfect and not before :-)

Additionally your xbmc log should tell something about that when debugging is turned on.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#15
xrandr
xorg.conf

There ya go, thanks for spending so much time on this.
Reply

Logout Mark Read Team Forum Stats Members Help
Occasional audio drop-out with DTS-HD0