PDA

View Full Version : Music playback skipping (buffer "underun")


hkn_
2009-06-15, 15:44
Hello everyone. :)

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
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 :) and forgot the soundcard.

topfs2
2009-06-15, 19:10
Welcome to the forums.

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

Cheers,
Tobias

hkn_
2009-06-15, 19:31
Welcome to the forums.

never truncate log, always submit a full debuglog, 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

topfs2
2009-06-16, 22:24
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.

Qroach
2009-06-17, 00:41
I have the same problem. Topfs2, how do you make the buffer larger?

hkn_
2009-06-17, 16:58
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 ;)

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. :D
This could help you too, Qroach. :)
<advancedsettings>
<audio>
<defaultplayer>dvdplayer</defaultplayer>
</audio>
</advancedsettings>

Qroach
2009-06-17, 18:14
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.

Qroach
2009-06-17, 18:37
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!