Music playback skipping (buffer "underun")
#1
Question 
Hello everyone. Smile

I am currently running xbmc - 9.04.2+svn20937-jaunty1 on Ubuntu Jaunty x86, using PM3-HD skin. This is the svn-ppa from https://edge.launchpad.net/~team-xbmc-svn/+archive/ppa. This problem occurs about twice time pr. minute. A loud beep noise is produced (about a month ago it was just silence). This only happens when using the music player. I have never heard it during a movie playback. Playback issue seems to be a PAPlayer-issue, since it happens only with music, and with every music container (wmv, mp3, flac, aac, etc.)

HW-specs:
mainboard: ga-73pvm-s2h
RAM : 2GB Kingston DDR2 667
CPU : OC'ed intel E2160
Sound : NVIDIA HDA ALC889A
GPU : Integrated GF7100
Kernel : 2.6.28-11 (dist-upgraded about 1 week ago.)


Problem is present when using digital outputs and analog outputs.

Attached parts of xbmc.log
Code:
hkn@mediacenter:~/.xbmc/temp$ cat xbmc.log |tail
14:28:23 T:3046082448 M:1576411136   DEBUG: SaveFileState - Saving file state for audio file /media/disk1/Musikk/Kaizers Orchestra - Våre demoner/04 Fanden hakk i hel.mp3
14:28:23 T:3046082448 M:1576411136   DEBUG: SaveFileState - Marking audio file /media/disk1/Musikk/Kaizers Orchestra - Våre demoner/04 Fanden hakk i hel.mp3 as listened
14:28:48 T:3046082448 M:1575989248   DEBUG: SECTION:UnloadDelayed(DLL: special://xbmc/system/players/paplayer/MACDll-i486-linux.so)
14:28:48 T:3046082448 M:1575989248   DEBUG: Unloading: MACDll-i486-linux.so
14:28:53 T:3046082448 M:1576054784   DEBUG: SECTION:UnloadDelayed(DLL: special://xbmc/system/libid3tag-i486-linux.so)
14:28:53 T:3046082448 M:1576054784   DEBUG: Unloading: libid3tag-i486-linux.so
14:29:19 T:2881416080 M:1576099840   DEBUG: CALSADirectSound::AddPackets - buffer underun (tried to write 940 frames)
14:29:47 T:2881416080 M:1576079360   DEBUG: CALSADirectSound::AddPackets - buffer underun (tried to write 940 frames)
14:30:50 T:2743155600 M:1576198144    INFO: CFileCache::Process - Hit eof.
14:31:02 T:2881416080 M:1576271872   DEBUG: CALSADirectSound::AddPackets - buffer underun (tried to write 940 frames)

Best regards,
Håkon.

*edit* @mods: Sorry for doubleposting, i didn't realise that the post had to be approved Smile and forgot the soundcard.
Reply
#2
Welcome to the forums.

never truncate log, always submit a full Debug Log, otherwise it's nearly impossible to tell why it's failing.

Cheers,
Tobias
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#3
Topfs2 Wrote:Welcome to the forums.

never truncate log, always submit a full Debug Log, otherwise it's nearly impossible to tell why it's failing.

Cheers,
Tobias
Hi Tobias!

Thank you for replying.
Here's the full log : http://hekta.org/~haakonal/xbmc.old.log

Best regards,
Håkon
Reply
#4
Your AudioHardware has a really small buffer, it's some other people reporting our PAPlayer (since generalised move) which takes to long to skip so the buffer gets dried, anyways it's on my list to check if I can fix it but it's on the backburner until MasterAudio is in (won't help the issue but it's a big refactor so don't want to alter the code to much before it goes in).

Anyways, for a solution try install pulseaudio, which usually have an enourmous extra buffer. Or if you can compile for yourself, completely turn off pulseaudio support with --disable-pulse (will make the skip take a shorter time and making the buffer less likely to get dried.).

EDIT: looked some more in your log, it won't help to do --disable-pulse as you get this underrun even on skips when we keep the audiorenderer, however installing pulse or making the buffer larger would probably work. Ideally it shouldn't be needed though.

Cheers,
Tobias.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#5
I have the same problem. Topfs2, how do you make the buffer larger?
Reply
#6
Topfs2 Wrote:Your AudioHardware has a really small buffer, it's some other people reporting our PAPlayer (since generalised move) which takes to long to skip so the buffer gets dried, anyways it's on my list to check if I can fix it but it's on the backburner until MasterAudio is in (won't help the issue but it's a big refactor so don't want to alter the code to much before it goes in).

Anyways, for a solution try install pulseaudio, which usually have an enourmous extra buffer. Or if you can compile for yourself, completely turn off pulseaudio support with --disable-pulse (will make the skip take a shorter time and making the buffer less likely to get dried.).

EDIT: looked some more in your log, it won't help to do --disable-pulse as you get this underrun even on skips when we keep the audiorenderer, however installing pulse or making the buffer larger would probably work. Ideally it shouldn't be needed though.

Cheers,
Tobias.

Hi again!

Pulse uses 64MiB cache, so thats seems to be ok Wink

I changed the default player to dvdplayer in advancedsettings.xml, hoping this removes my issue. Haven't tested it out 100 % yet, but is seems to be crystal clear audio now. Big Grin
This could help you too, Qroach. Smile
Code:
<advancedsettings>
  <audio>
        <defaultplayer>dvdplayer</defaultplayer>
  </audio>
</advancedsettings>
Reply
#7
Hi HKN thanks!

I just tried it but it's not working for me. Where does advancedsettings.xml need to placed? I put it in the userdata directory but for some reason my build of XBMC doesn't pick it up.
Reply
#8
OK I found the solution to the music stuttering problem on my zotac board. All i needed to do was set the resample rate for audio to 48000. Also I can see xbmc was reading in my Advanced settings file but just didn't understand the commands used. here is how my advanced settings file looks:

<advancedsettings>
<audio>
<resample>48000</resample>
</audio>
</advancedsettings>

This is if you need to play back audio over HDMI. Streaming shoutcast works perfect now!
Reply
#9
Changing the default audio player to dvdplayer fixed the skipping problem in my situation - Thanks for the help!
Reply

Logout Mark Read Team Forum Stats Members Help
Music playback skipping (buffer "underun")0