[mythtv-users] Audio buffer underruns, unstable time dependent performance issues on tuner switch

Jim Cuzella TrinitronX at gmail.com
Wed Jan 21 06:15:21 UTC 2009


I seem to be experiencing a similar problem to a thread I found back in
2006, however I think mine is probably tied to audio. XvMC is working
fine for me, but I've been having audio related issues for some time
now. (See end for link to that).
I am getting audio buffer underruns from mythfrontend, and read errors
from mythbackend.

Here is a link to my logs:
http://pastebin.com/m6569eab9

Interesting things I've noticed:
Overall, HD performance is better on this card, only after a certain
period of time some flickering can be seen (usually  starts during
commercials, but can continue into shows).  The real problems start when
I switch the tuner to the SD capture input.  For SD, audio started &
stopped abruptly at one point sounding very distorted and
clipped/overamplified; then dropped out completely.  I can watch HD ATSC
fine up to a certain point, where it starts having some slowdowns and
begins flickering.  After switching to SD, *very* slow framerate and no
audio are encountered.  If switched back to HD tuner, the slow framerate
continues... but this time on the HD tuner!  Pressing the left key a
couple times (so not watching live TV) allows for good quality viewing &
sound after this point, but live TV still tends to have bad performance.

I've tried doing a test a couple times using mythfrontend on desktop #1
freshly booted, and a maximized terminal window running htop on desktop #2.
Htop shows very low CPU usage initially (if no mythcommflag jobs
started), ~637/2007MB RAM used (system contains 1 DIMM of 2GB RAM, PC2
6400).  Within htop, it shows colors for the actual memory in use:
green=used by processes, blue=kernel buffers, brown/orange=kernel cache.
 I start the machine, watch an ATSC HD station (process RAM use only
grows to ~887MB).  After running for a while, the brown/orange looking
bar (kernel cache) grows to fill all available memory, eventually it
gets to using swap space.  I switch to SD and playback is very slow and
has poor playback performance.  Kernel cache ceases to grow at this
point.  At the very end of this specific test, mythbackend crashed
completely, that's why mythfrontend shows the connection errors. 
Switching back and forth afterwards causes bad performance all around.
I have done this test both with the default Mythbuntu 8.10 packaged alsa
drivers, and with my own backported packages from Jaunty with same results.

Although unrelated, required free space on drive reported is
inconsistent. First it shows:
2009-01-20 04:02:29.415 AutoExpire: CalcParams(): Max required Free
Space: 3.0 GB w/freq: 15 min

However, later after switching to analog video input (from Composite
input of pcHDTV 5500), it shows 2.0GB:
2009-01-20 04:04:17.686 NVR(/dev/video0): Unknown video codec.  Please
go into the TV Settings, Recording Profiles and setup the four 'Software
Encoders' profiles.  Assuming RTjpeg for now.
2009-01-20 04:04:17.691 NVR(/dev/video0) Error: Unknown audio codec
2009-01-20 04:04:17.703 AutoExpire: CalcParams(): Max required Free
Space: 2.0 GB w/freq: 15 min

Once I switch to the v4l Composite video capture, many read errors from
/dev/video0 (this should be through v4l drivers on the 5500 card). 
Initial burst of distorted sound is explained by first 2 lines, then
audio fails completely (should be from /dev/dsp, /dev/dsp1 does the same):
2009-01-20 04:04:46.070 NVR(/dev/video0) Error: Only read 2324 bytes of
4096 bytes from '/dev/dsp
read audio: Success
2009-01-20 04:04:56.078 NVR(/dev/video0) Error: Only read -1 bytes of
4096 bytes from '/dev/dsp
read audio: Input/output error

Later after this, I switch to using the HD ATSC tuner on the same card,
however, an error message from the v4l driver sneaks in slightly after
this (This could be explained if it's still in process of being
switched, and that "HW Tuner" message is output before actually doing it):
2009-01-20 04:06:25.958 TVRec(1): Changing from None to WatchingLiveTV
2009-01-20 04:06:25.966 TVRec(1): HW Tuner: 1->1
2009-01-20 04:06:26.094 NVR(/dev/video0) Error: Only read -1 bytes of
4096 bytes from '/dev/dsp
read audio: Input/output error
2009-01-20 04:06:26.305 Finished recording Family Guy "To Love and Die
in Dixie": channel 1297
2009-01-20 04:06:26.336 MythSocket(7f632800bf90:-1): writeStringList:
Error, socket went unconnected.

Here's that old thread I found... it seems this one is related to
XvMC... but I'm not sure that it relates too well to my problem.  (I'm
leaning towards the snd-intel-hda driver being the root of all my problems).
http://www.gossamer-threads.com/lists/mythtv/users/224463

Help troubleshooting this problem would be appreciated.
Thanks,
- Jim C.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20090120/3a80e80b/attachment.pgp>


More information about the mythtv-users mailing list