Kodi Community Forum

Full Version: Stuttering sound from buffer underrun
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am receiving DVB-T using VDR over VNSI, but having the same problem using tvheadend as well. Audio buffer seem to run empty resulting in stuttering audio. This only happens with XBMC, other programs (like vdr-sxfe) are playing a clean sound. Playing recorded TV on XBMC works also well.

This problem exists since quite a while now. When having the info-overlay shown the "aq" buffer fluctuate between 0% and 2% while "vq" fluctuate between 5% and 10%. Each time aq drops to 0% the xbmc log fills with those lines:

Code:
17:11:49 T:2844855184 M:1627033600 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
17:11:50 T:2871417744 M:1626652672 WARNING: Previous line repeats 9 times.
17:11:50 T:2871417744 M:1626652672   DEBUG: CGUIInfoManager::SetCurrentMovie(pvr://channels/tv/all/5.pvr)
17:11:50 T:2844855184 M:1626525696 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
17:11:51 T:2871417744 M:1626525696 WARNING: Previous line repeats 9 times.
17:11:51 T:2871417744 M:1626525696   DEBUG: CGUIInfoManager::SetCurrentMovie(pvr://channels/tv/all/5.pvr)
17:11:51 T:2844855184 M:1626652672 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
17:11:52 T:2871417744 M:1626525696 WARNING: Previous line repeats 9 times.
17:11:52 T:2871417744 M:1626525696   DEBUG: CGUIInfoManager::SetCurrentMovie(pvr://channels/tv/all/5.pvr)
17:11:52 T:2844855184 M:1626525696 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available

When getting glitches in the signal, like its common for DVB-T the buffer eats up rapidly and stuttering gets very bad. Sadly theres no option to configure the buffer settings for Live-TV and I have never seen "aq" beyond 6%.
Yes that's a common problem encountered with vnsi.

It doesn't happens really often localy, but with remote client, it's at each zap.

A tweak you can do to refill the buffer is changing the audio track or audio output and then falling back.
not just an issue with vnsi but with other backends too.

as hotlobster said, known issue.
had the same problem. a small delay (100ms) in DVDPlayerVideo prior to signal the first picture back to DVDPlayer has cured the problem. this way you have at least a couple of packets in the queue when watching live streams.
that's a work around, not a fix
the border between a work around and a fix is very thin, isn't it? how else would you fix this? as soon as video and audio are started, all get synced to the video reference clock (in case it is used). if startup is very fast, there's no chance for the buffers to get filled.
a time based delay is a work around.
@FernetMenta how did you apply this delay? Is there a entry in advancedsettings.xml I dont know, or have you got a patch?
If you compile from source, I can point you the right location to insert some lines of code. Are you using vdpau?
The answer to both questions is - yes. Wink
the work around is as follows:
go to line 651 of DVDPlayerVideo.cpp and add a Sleep

Code:
Sleep(200);
m_messageParent.Put(new CDVDMsgInt(CDVDMsg::PLAYER_STARTED, DVDPLAYER_VIDEO));

this is just a theory you can proof or scrap. if it works i can try to create a real patch.
is there an update on if this is a fix or not?
This is long outdated. pvr now fills a cache prior to starting the player. Do you still see this issue?
Im just using the vanilla version of xbmc although it is a pre-eden version taken from the unstable SVN.

Currently trying to stream from ITV using the ITV catchup plugin.

error Wrote:19:03:28 T:139767765268224 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
19:03:28 T:139767888996096 NOTICE: CDVDPlayer::OnExit()
19:03:28 T:139767888996096 NOTICE: DVDPlayer: eof, waiting for queues to empty
19:03:28 T:139767888996096 NOTICE: DVDPlayer: closing audio stream
19:03:28 T:139767888996096 NOTICE: Closing audio stream
19:03:28 T:139767888996096 NOTICE: CDVDMessageQueue(audio)::WaitUntilEmpty
19:03:28 T:139767888996096 NOTICE: Waiting for audio thread to exit
19:03:28 T:139767765268224 NOTICE: thread end: CDVDPlayerAudio::OnExit()
19:03:28 T:139767888996096 NOTICE: Closing audio device
19:03:28 T:139767851861760 WARNING: CDVDMessageQueue(video)::Get - asked for new data packet, with nothing available
19:03:28 T:139767888996096 NOTICE: Deleting audio codec


This happens randomly but consistantly with the streams and does not give any warning prior to the CDVDMessageQueue(video). The video just drops out back to the menu. I would have thought that the point of a buffer is so that the video is buffered and then once its empty the system pauses the video and fills it back up again.

Again i know its not PVR specific but its really starting to tick me off as i cant see any way to fix it.
Quote:I would have thought that the point of a buffer is so that the video is buffered and then once its empty the system pauses the video and fills it back up again

This is exactly what is being done. PVR's caching mechanism is sightly different to the generic one which makes assumptions about an input stream which are not true for PVR and probably ITV. Maybe PVR's caching can be opened up to other live tv streams.

EDIT:
@dushmaniac
Should we flag a pvr tv stream as e.g. realtime and test for this in dvdplayer? Other streams would be able to use pvr's caching mechanism.
Pages: 1 2