[mythtv] [PATCH] ALSA threaded/buffered rewrite
Nick Hall
mythtv-dev at nickh.net
Mon Jul 26 18:45:01 EDT 2004
>>> About the time this was committed, I haven't had audio output on
>>> either of my Myth systems. Been busy with work and stuff lately so
>>> I haven't had much time to look at it, but I have been
>>> troubleshooting it the last couple of days.
>>>
>>> Kevin, what kernel version and alsa version do you have this working
>>> on? It may help me track down my problem. I am using kernel.org
>>> 2.6.7 with patches and alsa 1.0.3 that comes with FC2.
>>
>>
>> I'm on 2.4.20-31_38 RH9 and looks like I'm using 1.0.5a. I'm not on
>> the latest CVS but from a little while back around when the last
>> patch for this was comitted. I'm starting to wonder if maybe the new
>> a/v sync code might have affected this so I'll probably upgrade to
>> CVS soon once I finish the status stuff I'm working on.
>
>
> I downloaded 1.0.5a from alsa-project.org and tried it. Everything is
> working correctly now. I was hoping to get it working with the
> default FC2 packages, but this works for me.
This is similar to the configuration I'm running (myth CVS as of last
night + alsa 1.0.5a + kernel 2.6.7 + ivtv-0.1.10-pre2-ck100i on a EPIA
MII 12000/PVR350), and I'm currently having a/v sync related issues -
when I switch to livetv mode, there's a reasonable chance that the sound
and video will be completely out of sync for a few seconds, then I'll
either get just static for sound while the video continues, or sound and
video will stop - at that point, the frontend logs:
[static for sound]
2004-07-26 23:20:09 AddSamples 4608
2004-07-26 23:20:09 Waiting for space on soundcard: space=3936
2004-07-26 23:20:09 Broadcasting free space avail
2004-07-26 23:20:09 audio thread waiting for buffer to fill
fragment_size=4096, audiolen=1535
2004-07-26 23:20:09 audio thread waiting for buffer to fill
fragment_size=4096, audiolen=1535
2004-07-26 23:20:09 audio thread waiting for buffer to fill
fragment_size=4096, audiolen=1535
2004-07-26 23:20:09 audio thread waiting for buffer to fill
fragment_size=4096, audiolen=1535
2004-07-26 23:20:09 audio thread waiting for buffer to fill
fragment_size=4096, audiolen=1535
2004-07-26 23:20:09 audio thread waiting for buffer to fill
fragment_size=4096, audiolen=1535
2004-07-26 23:20:09 audio thread waiting for buffer to fill
fragment_size=4096, audiolen=1535
2004-07-26 23:20:09 AddSamples 4608
2004-07-26 23:20:09 AddSamples 4608
2004-07-26 23:20:09 Waiting for space on soundcard: space=4064
2004-07-26 23:20:09 Broadcasting free space avail
2004-07-26 23:20:09 Waiting for space on soundcard: space=448
2004-07-26 23:20:09 Waiting for space on soundcard: space=768
2004-07-26 23:20:09 Waiting for space on soundcard: space=1152
2004-07-26 23:20:09 Waiting for space on soundcard: space=1536
2004-07-26 23:20:09 Waiting for space on soundcard: space=1920
2004-07-26 23:20:09 Waiting for space on soundcard: space=2304
2004-07-26 23:20:09 Waiting for space on soundcard: space=2688
2004-07-26 23:20:09 Waiting for space on soundcard: space=3072
2004-07-26 23:20:09 Waiting for space on soundcard: space=3456
2004-07-26 23:20:09 Waiting for space on soundcard: space=3808
[video stop]
2004-07-26 23:17:34 waiting for space to write 1024 zeros on soundcard
which has 64 bytes free
2004-07-26 23:17:34 waiting for space to write 1024 zeros on soundcard
which has 448 bytes free
2004-07-26 23:17:34 waiting for space to write 1024 zeros on soundcard
which has 832 bytes free
2004-07-26 23:17:34 waiting for space to write 1024 zeros on soundcard
which has 1216 bytes free
2004-07-26 23:17:34 waiting for space to write 1024 zeros on soundcard
which has 1600 bytes free
2004-07-26 23:17:34 waiting for space to write 1024 zeros on soundcard
which has 1984 bytes free
2004-07-26 23:17:34 waiting for space to write 1024 zeros on soundcard
which has 2336 bytes free
2004-07-26 23:17:34 waiting for space to write 1024 zeros on soundcard
which has 2720 bytes free
2004-07-26 23:17:34 waiting for space to write 1024 zeros on soundcard
which has 3104 bytes free
2004-07-26 23:17:34 waiting for space to write 1024 zeros on soundcard
which has 3488 bytes free
2004-07-26 23:17:34 waiting for space to write 1024 zeros on soundcard
which has 3872 bytes free
In the case where the video stops, I usually have to kill the frontend;
in the static case, ESC will still exit livetv.
At other times, the audio and video get in sync after a few seconds and
everything is fine - but it's pretty unpredictable. If I switch quickly
between livetv and the menu over and over, I can usually get either one
of the two issues to happen. In addition, sometimes it can take quite a
long time for the audio/video to sync up, during which the video output
looks pretty odd...
There's a related thread on the -users list at the moment, which
suggests that this is might have something to do with ACPI and IRQ
issues, but I've tried all the things recommended there (enabled extra
buffering, disabled all unused devices, confirmed ACPI on in
bios/kernel) and it doesn't seem to help. I only began to notice this
when I switched to the latest CVS.
I haven't re-tested OSS to see if it's entirely ALSA related - just
rebuilding myth to test now, will send an update tomorrow, but I thought
I'd send this out now in case anyone has any ideas?
Cheers,
Nick
More information about the mythtv-dev
mailing list