[mythtv-users] prebuffering pause

Mike Kurtz fnorbenden at yahoo.com
Mon Jan 5 15:11:32 UTC 2009





----- Original Message ----
From: George Mari <george_mythusers at mari1938.org>
To: Discussion about mythtv <mythtv-users at mythtv.org>
Sent: Monday, January 5, 2009 8:29:21 AM
Subject: Re: [mythtv-users] prebuffering pause

Mike Kurtz wrote:
> 
> 
[deleted]
>
> I set audio latency to 128. It helped a little. Setting the video latency to 128 (nvidia automatically sets it to 256 when X starts) also helped a little, but neither were a huge boon.
> 
> De-interlacing is off. That makes most problems go away, but it an awful solution and really shouldn't be neccessary, so I'm hoping we can find the root problem.
> 
[deleted]
> 
> 00:02.7 Multimedia audio controller: Silicon Integrated Systems [SiS] AC'97 Sound Controller (rev a0)
>     Subsystem: Foxconn International, Inc. Device 0c95
>     Flags: bus master, medium devsel, latency 32, IRQ 18
>     I/O ports at e000 [size=256]
>     I/O ports at e800 [size=128]
>     Capabilities: [48] Power Management version 2
>     Kernel driver in use: Intel ICH
>     Kernel modules: snd-intel8x0
> 
[deleted]
> 00:0a.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 08)
>     Subsystem: Creative Labs SBLive! 5.1 Model SB0100
>     Flags: bus master, medium devsel, latency 176, IRQ 19
>     I/O ports at ee00 [size=32]
>     Capabilities: [dc] Power Management version 2
>     Kernel driver in use: EMU10K1_Audigy
>     Kernel modules: snd-emu10k1
> 
I see 2 sound devices here - your on-board audio, and a Sound Blaster 
card.  So which one is being used?  And which one ALSA / PulseAudio 
using?  Which one did you change the PCI latency for?
> 
> I thought I was using XvMC, but it turns out that I wasn't. I went into settings and turn off opengl vertical sync and changed all the decoders to XvMC. I end up with a blue screen and the OSD frozen on, have to switch to another tty to kill the process, as it's unresponsive. Here is the playback log:
> 
> 2009-01-04 10:41:50.178 AFD: Using xvmc for video decoding
> 2009-01-04 10:41:50.178 AFD: Looking for decoder for MPEG2VIDEO_XVMC
> 2009-01-04 10:41:50.179 AFD: Opened codec 0x4728340, id(MPEG2VIDEO_XVMC) type(Video)
> 2009-01-04 10:41:50.179 AFD: Stream #1, has id 0x84 codec id AC3, type Audio, bitrate 384000 at 0x0x47288c0
> 2009-01-04 10:41:50.179 AFD: codec AC3 has 6 channels
> 2009-01-04 10:41:50.179 AFD: Looking for decoder for AC3
> 2009-01-04 10:41:50.180 AFD: Opened codec 0x47276e0, id(AC3) type(Audio)
> 2009-01-04 10:41:50.297 RingBuf(/home/fnor/DVR/1051_20090104104146.mpg): CalcReadAheadThresh(65384 KB)
>              -> threshhold(64 KB) min read(0 KB) blk size(32 KB)
> 2009-01-04 10:41:50.301 Opening audio device 'hw:0,0'. ch 2(2) sr 48000
> 2009-01-04 10:41:50.302 Opening ALSA audio device 'hw:0,0'.
> 2009-01-04 10:41:50.310 NVP: Prebuffer wait timed out 10 times.
^    ^    ^    ^    ^    ^    ^    ^    ^
Ok - I'm not an expert at ALSA/sound, but these last 3 lines are a red 
flag to me.  Myth is trying to open your audio device, and immediately 
generates a prebuffer wait timeout message.  Something doesn't seem 
right in your ALSA configuration, and I think you need to concentrate here.

> 2009-01-04 10:41:50.329 Mixer unable to find control PCM
> 2009-01-04 10:41:50.330 Mixer unable to find control PCM
> 2009-01-04 10:41:50.331 NVP: Enabling Audio
> 2009-01-04 10:41:50.331 Dec: Trying to select track (w/lang)
> 2009-01-04 10:41:50.332 Dec: Selecting first track
> 2009-01-04 10:41:50.332 Dec: Selected track #1 in the Unknown language(0)
> 2009-01-04 10:41:50.332 Resyncing position map. posmapStarted = 0 livetv(1) watchingRec(1)
> 2009-01-04 10:41:50.333 Position map filled from DB to: 0
> 2009-01-04 10:41:50.333 SyncPositionMap watchingrecording, from DB: 1 entries
> 2009-01-04 10:41:50.334 Filling position map from 1 to 42
> 2009-01-04 10:41:50.335 Position map filled from Encoder to: 0
> 2009-01-04 10:41:50.335 SyncPositionMap watchingrecording total: 1 entries
> 2009-01-04 10:41:50.335 SyncPositionMap, new totframes: 0, new length: 0, posMap size: 1
> 2009-01-04 10:41:50.335 AFD: Partial position map found
> 2009-01-04 10:41:50.335 AFD: Successfully opened decoder for file: "/home/fnor/DVR/1051_20090104104146.mpg". novideo(0)
> 2009-01-04 10:41:50.338 NVP: DoPlay: rate: 29.97 speed: 1 skip: 1 => new interval 33366
> 2009-01-04 10:41:50.339 Set video sync frame interval to 33366
> 2009-01-04 10:41:50.339 NVP: Stretch Factor 1, allow passthru 
> 2009-01-04 10:41:50.343 VideoOutputXv: UpdatePauseFrame() AAAAAAAA
> 2009-01-04 10:41:50.343 VideoOutputXv: UpdatePauseFrame -- XvMC
> 2009-01-04 10:41:50.343 VideoOutputXv: UpdatePauseFrame -- XvMC: 
>             Did NOT find a pause frame
> 2009-01-04 10:41:50.344 VideoOutputXv: ProcessFrameXvMC: Tried to reuse frame but failed
> 2009-01-04 10:41:50.357 OSDChroma: cstart: 0  cend: 768
> 2009-01-04 10:41:50.357 OSDChroma: ldispy: 0 height: 768
> 2009-01-04 10:41:50.366 VideoOutputXv: ShowXvMC(): No frame to show
> 2009-01-04 10:41:50.379 NVP: Waiting for prebuffer.. 0 AAAAAAAA
> 2009-01-04 10:41:50.427 RingBuf(/home/fnor/DVR/1051_20090104104146.mpg): CalcReadAheadThresh(65384 KB)
>              -> threshhold(64 KB) min read(0 KB) blk size(32 KB)
> 2009-01-04 10:41:50.427 Resyncing position map. posmapStarted = 0 livetv(1) watchingRec(1)
> 2009-01-04 10:41:50.429 Position map filled from DB to: 0
> 2009-01-04 10:41:50.430 SyncPositionMap watchingrecording, from DB: 1 entries
> 2009-01-04 10:41:50.431 Filling position map from 1 to 45
> 2009-01-04 10:41:50.432 Position map filled from Encoder to: 0
> 2009-01-04 10:41:50.432 SyncPositionMap watchingrecording total: 1 entries
> 2009-01-04 10:41:50.434 XvMC: picture structure FRAME
> 2009-01-04 10:41:50.512 NVP: Waiting for prebuffer.. 1 LAAAAAAA
> 2009-01-04 10:41:50.646 NVP: Waiting for prebuffer.. 2 LAAAAAAA
> 2009-01-04 10:41:50.779 NVP: Waiting for prebuffer.. 3 LAAAAAAA
> 2009-01-04 10:41:50.912 NVP: Waiting for prebuffer.. 4 LAAAAAAA
> 2009-01-04 10:41:51.045 NVP: Waiting for prebuffer.. 5 LAAAAAAA
> 2009-01-04 10:41:51.179 NVP: Waiting for prebuffer.. 6 LAAAAAAA
> 2009-01-04 10:41:51.312 NVP: Waiting for prebuffer.. 7 LAAAAAAA
> 2009-01-04 10:41:51.445 NVP: Waiting for prebuffer.. 8 LAAAAAAA
> 2009-01-04 10:41:51.578 NVP: Waiting for prebuffer.. 9 LAAAAAAA
> 2009-01-04 10:41:51.712 NVP: Prebuffer wait timed out 10 times.
> 
> I'm using ALSA:hw:0,0 since ALSA:default on my system is controlled by pulseaudio.  It's worth noting that it's looking for PCM even though I've set mixer 
control to "Master," which looks to me like a bug.

Yeah, mine looks for PCM too.  I never noticed it until I just checked 
now.  It shouldn't cause a problem.

>As for XvMC, I'm not sure what's going on, as I'm pretty unfamiliar with XvMC. Here's the output from xvmcinfo (from the wiki), maybe it makes more sense to you guys:
> 
[xvmcinfo deleted]
> 
> I'm beginning to suspect something is just screwy with XvMC, and if I could get it to work, that would solve my problems, which appear to be CPU starvation-related now that I take another look at it:
> 
> CPU(s): 59.9%us, 7.2%sys, 0.0%ni, 31.9%id, 0.7%wa, 0.0%hi, 0.3%hi, 0.3%si, 0.0%st
> 
> Taken while frontend was running with default decoder and no interlacer. This setup works roughly 95% of the time (some jerkiness). This all is with mythfrontend running as root with priority threads enabled on a be/fe machine with mythbackend also running as root.
> 
> Thanks for all your help.
> 
> edit: that was a bad capture, now that I think about it. usage usually hovers around 70-90%
> ______________________________________________

I disagree that fixing XvMC will solve the problem.  I don't think you 
are CPU-bound.  I'm guessing you have something like a P4 or Socket-754 
or Socket-A Athlon?  I think you have audio issues, or at least audio 
configuration issues.

Since you mentioned Pulseaudio, I'm assuming you distro is Fedora?
If you are using KDE, did you disable the ARTs sound server, as 
recommended in the wiki?

http://www.mythtv.org/wiki/index.php/Installing_MythTV_on_Fedora#Sound_setup

So what is your %idle from top when playing back?  Is the 32% you listed 
  before not accurate?

My strategy to fix problems like this is to temporarily switch to a very 
vanilla, generic configuration.  It makes isolating problems much simpler.

1. Use Xv for output instead of XvMC.  Even if you think you need to 
have XvMC because your system is too slow, just turn it off anyway.
2. Turn off all de-interlacing.
3. Turn off Pulseaudio and any other sound servers like ArtS.
4. Use the recommended ALSA:default for sound output in Myth.

Start mythfrontend from the command line, and playback a recording, 
preferrably SD.  If you're not getting sound with ALSA:default, fix your 
ALSA config.

If things work OK, turn on de-interlacing.  OpenGL Vsync is the 
preferred method of video timing - make sure you see a message in the 
output that this is the video timing method being used.

Now, if after you have your sound and de-interlacing properly setup, you 
  find that you have 0% idle from top during playback, then I would 
start looking into XvMc.
___________________

I'm using SuSE 11 with pulse. I disagree that it is an ALSA problem, because I get the exact same result when I use dsp. There's a couple milliseconds' difference in the log, but it's really the exact same output. I'm using the SB Live!, and that's the one I've changed the latency on.

Turning off deinterlacing does work, again with the same results using ALSA or dsp. It gives me a clear feed without any stuttering, and there's enough CPU to handle any spikes. With deinterlacing on (even the most basic), I get stutters and CPU spikes where the system idle is at 0-5. OGL vsync is being used in both cases.

So, it works, but it only works without any sort of deinterlacing, and I doubt I would be able to handle a live stream and a recording simultaneously, and with all the stuff off it still uses most of the CPU, just don't completely starve it. It still has trouble keeping up when the OSD is being removed, even with OSD fade off.
____________________________
mythtv-users mailing list
mythtv-users at mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users



      


More information about the mythtv-users mailing list