[mythtv-users] audio buffer underruns [partly solved]

Ross Boylan RossBoylan at stanfordalumni.org
Sat Mar 17 20:39:02 UTC 2012


My actual question is after the final "------"; I provide the other
information as background and as a record for others with the same
problem.  E.g.,
http://www.mythtv.org/pipermail/mythtv-users/2011-September/321093.html
had the same problem and never got an answer, as far as I can tell.  I
solved the problem in that email, but discovered another one behind it.

When I viewed a recording the front-end showed these messages on the
terminal:
----------------------------------------------------------------
2012-03-17 11:33:11.659 AFD: Opened codec 0xa8046af0, id(MPEG2VIDEO) type(Video)
2012-03-17 11:33:11.659 AFD: codec AC3 has 2 channels
2012-03-17 11:33:11.660 AFD: Opened codec 0xa80430a0, id(AC3) type(Audio)
2012-03-17 11:33:11.660 AFD: codec AC3 has 2 channels
2012-03-17 11:33:11.660 AFD: Opened codec 0xa80494c0, id(AC3) type(Audio)
2012-03-17 11:33:11.660 AFD: codec AC3 has 2 channels
2012-03-17 11:33:11.661 AFD: Opened codec 0xa8049a70, id(AC3) type(Audio)
2012-03-17 11:33:11.801 AO: Opening audio device 'default' ch 2(2) sr 48000 sf signed 32 bit reenc 0
2012-03-17 11:33:11.813 ALSA, Error: Setting hardware audio buffer size to 192
2012-03-17 11:33:11.814 ALSA, Error: Error opening /proc/asound/card0/pcm0p/sub0/prealloc: Permission denied.
2012-03-17 11:33:11.814 ALSA, Error: Try to manually increase audio buffer with: echo 192 | sudo tee /proc/asound/card0/pcm0p/sub0/prealloc
2012-03-17 11:33:11.814 ALSA, Error: Unable to sufficiently increase ALSA hardware buffer size - underruns are likely
2012-03-17 11:33:11.838 AudioPlayer: Enabling Audio
2012-03-17 11:33:12.167 VideoOutputXv: XVideo Adaptor Name: 'ATI Radeon AVIVO Video'
------------------------------------------------------------------------

I would then get underruns and, usually fairly quickly, no sound from
the show I was watching at all.  The only solution I found was to exit
from the program and then restart it.

I changed the group and permissions of /proc/asound/card0/pcm0p/sub0/prealloc.
mythtv is not in sudoers.  prealloc was at 64.

Next round:
---------------------------------------------------------------
2012-03-17 12:26:57.905 AO: Opening audio device 'default' ch 2(2) sr 48000 sf signed 32 bit reenc 0
2012-03-17 12:26:57.910 ALSA, Error: Setting hardware audio buffer size to 192
2012-03-17 12:26:57.918 AudioPlayer: Enabling Audio
-----------------------------------------------------------------------------------------

Even running as root I could not reset prealloc.  Further searching led
to the suggestion (by JYA in an IRC chat) to shutdown sound before
resetting.  I closed the mythfrontend and turned off audio in KDE.
---------------------------------------------------------------------------------
2012-03-17 12:40:21.257 AO: Opening audio device 'default' ch 2(2) sr 48000 sf signed 32 bit reenc 0
2012-03-17 12:40:21.321 ALSA, Error: Setting hardware audio buffer size to 320
------------------------------------------------------------------------

I'm pretty sure I used the same recording each time.  So why is it now
trying for 320 when before is was 192?  Does the code try progressively
larger buffer sizes til it gets where it wants to go?  If so, what is
the final size I should use?

Also, not being able to reset the sound without disabling other sound
seems like a problem if different recordings have different
requirements, which I gather they do.

mythtv 0.24-2.
linux kernel 2.6.26-2-686
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High
Definition Audio Controller (rev 01) on motherboard.

Ross Boylan



More information about the mythtv-users mailing list