Mailing List Archive

Development thoughts + Mythtv crashing bug - during playback/delete
Issac,

I was digging through the Mythtv code and trying to
familiarize myself with what's going on. I was
thinking about Snapstream and (forgot the co's name)
their DVR2 software. Basically I think that Including
some way to reuse/move around the stored show files
would be very useful. So I'm wondering if there's a
reason that the files are stored in your special
nupplevideo format and not as just .avi's, .mpegs,
.nuv's ect with standard headers and have a entry in
the mysql db that says what they are for play back
purposes? Additionally, I'm thinking that their
should be a path stored for each entry in the mysql db
to tell where a show is actually stored (by default/of
for recording whats setup now works)... but that way
you could archive the shows to CD (have a note in the
DB), or move them to another harddrive (ie my media
server idea that I keep touting). Is this going to
break a lot of things? I know that right now the
nuppelvideo header is going to cause trouble... but
I'm not sure how much of a change this requries.

Okay, on my second rant. I'd love to have commercial
skip in there... Have we thought about a 30 second
skip function for the remote/interface yet?
Additionally, does anyone know what the protocol for
the VCR+ commercial skip is? (I'd just love to not
record any commercials when I'm archiving shows!) If
someone's got some suggestions, I'd be willing to
start some code for this.

Okay, and on to other bug issues. Suddenly mythtv
(release 5) is crashing on me when I try to watch
recordings, or delete them. It just dumps out
unexpectedly. I don't have the screen capture on me,
but nothing looked out of place. However, I think I
know what might have happened. I tried to watch live
tv while the system was recording a show (it was
probably 3/4 of the way through). When I hit the
watch live tv it crashed. Brought it back up again,
and that's when all the trouble started happening.
Now I'm thinking that I must have corrupted something
in the mysql db that If I clean it up it should work
correctly again? Any thoughts?

Also whats the status on mpeg2 format for recording...
I know that you were working on that, so I'm just
wondering where it is or if this is something that I
can fool around with.


Thanks,
Chuck




__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
Re: Development thoughts + Mythtv crashing bug - during playback/delete [ In reply to ]
On Monday 09 September 2002 09:50 am, Charles Choukalos wrote:
> Issac,
>
> I was digging through the Mythtv code and trying to
> familiarize myself with what's going on. I was
> thinking about Snapstream and (forgot the co's name)
> their DVR2 software. Basically I think that Including
> some way to reuse/move around the stored show files
> would be very useful. So I'm wondering if there's a
> reason that the files are stored in your special
> nupplevideo format and not as just .avi's, .mpegs,
> .nuv's ect with standard headers and have a entry in
> the mysql db that says what they are for play back
> purposes?

I don't really want to deal with playing back other formats.

> Additionally, I'm thinking that their
> should be a path stored for each entry in the mysql db
> to tell where a show is actually stored (by default/of
> for recording whats setup now works)... but that way
> you could archive the shows to CD (have a note in the
> DB), or move them to another harddrive (ie my media
> server idea that I keep touting). Is this going to
> break a lot of things? I know that right now the
> nuppelvideo header is going to cause trouble... but
> I'm not sure how much of a change this requries.

Well, you'd also have to have some way to locate files that have gone missing,
I'd think. Main reason I have it the way I do is so I could change the
location of the stored files in the config file without having to update the
database. Instead of storing a static path in the db, what would you think
of searching multiple paths for the files?

> Okay, on my second rant. I'd love to have commercial
> skip in there... Have we thought about a 30 second
> skip function for the remote/interface yet?
> Additionally, does anyone know what the protocol for
> the VCR+ commercial skip is? (I'd just love to not
> record any commercials when I'm archiving shows!) If
> someone's got some suggestions, I'd be willing to
> start some code for this.

The ff/rew amount is configurable in the settings file. Adding a separate key
binding with a larger fast forward amount would be easy, as well, if you
wanted to do that. As for automatic stuff, I'd be leery of including
anything that was too greedy in eating video data.. _probably_ be better to
include the data it needed to eat a commercial in the file, and only remove
things on playback, not recording.

> Okay, and on to other bug issues. Suddenly mythtv
> (release 5) is crashing on me when I try to watch
> recordings, or delete them. It just dumps out
> unexpectedly. I don't have the screen capture on me,
> but nothing looked out of place. However, I think I
> know what might have happened. I tried to watch live
> tv while the system was recording a show (it was
> probably 3/4 of the way through). When I hit the
> watch live tv it crashed. Brought it back up again,
> and that's when all the trouble started happening.
> Now I'm thinking that I must have corrupted something
> in the mysql db that If I clean it up it should work
> correctly again? Any thoughts?

Other than running it in gdb and seeing where it crashes, no =)

> Also whats the status on mpeg2 format for recording...
> I know that you were working on that, so I'm just
> wondering where it is or if this is something that I
> can fool around with.

I've never worked on support for mpeg2, just libavcodec's mpeg4 stuff.
That all works fairly well, just change the Codec setting in the config file
from 'rtjpeg' to 'mpeg4', and it'll encode using that. It does use quite a
bit more CPU, though. I haven't worked much on re-encoding yet. And
actually, most of libavcodecs other video encoders should work as well, but I
haven't really tested them.

Isaac
Re: Development thoughts + Mythtv crashing bug - during playback/delete [ In reply to ]
>>>>> Issac writes:

> I don't really want to deal with playing back other formats.

Yes, please don't bother. Mythtv is about watching TV. Stuff like
DVD can be handled with something trivial like

system("mplayer -dvd -blah-blah");

Which brings up the point - is the frontend stuff at all scriptable?
Currently most everything is a thread, which makes it rather hard to
plug stuff in without writing code that runs in the same context as
precious stuff like the timed recorder.

> what would you think of searching multiple paths for the files?

Yes, this would be the thing to do. It trivially solves the problem
of adding another disk without having to get all fancy with LVM,
RAID0, or whatever. One would just use the biggest disk for mythtv,
and have a cron job do some sort of lru archiving to the other disks.

> The ff/rew amount is configurable in the settings file.

I ended up setting mine for 15s, because I can't get my remote keys to
autorepeat.

What's more of a mystery is that I can't find what to put in my
irxevent rc file for "space". "KP_Space" is the only listed thing in
the xevent docs, but that doesn't work. Nor does "Space". I'm quite
sure my remote button works; irw shows it being pushed.

I looked at the example ir config file, and I can see no way to use
the supported keys to select the "Record this showing" or "Record this
timeslot" or "Record this title" options. Enter always exits the
dialog - only a real space on the real keyboard seems to work, which
is sort of awkward since my keyboard is in the basement!

> eat a commercial in the file, and only remove things on playback,

I've found that a largish fast forward time in some multiple of 30s
makes it really trivial to skip commercials.

> Other than running it in gdb and seeing where it crashes, no =)

Does -g change anything else in the way the code compiles? It might
be a nice if the makefile defaulted to making a -g binary and then
stripped it at install time. This way people can gdb the unstripped
exe and core files with symbols.

Also, is there something useful that can be done to snapshot a hanging
mythtv? A couple times a day the player will hang for about 60-120s
when I'm in the middle of forwarding or reversing. It just stops,
with no sound, with the picture and "Forward" or "Reverse" osd overlay
stuck, but it eventually continues.

It's not crashing or saying anything. I've never noticed any hang or
jumps in whatever was recording under it at the time; seems like a
player-specific issue.

What threads are active and waiting on what during ffwd/rew modes?

This is a little odd, the usual failure modes for threaded software
are "hang forever" and "blow up occasionally". Do you generally use
semaphores with a 60s timeout or something?

> I've never worked on support for mpeg2, just libavcodec's mpeg4
> stuff. That all works fairly well, just change the Codec setting in
> the config file from 'rtjpeg' to 'mpeg4', and it'll encode using
> that. It does use quite a bit more CPU, though. I haven't worked
> much on re-encoding yet. And actually, most of libavcodecs other
> video encoders should work as well, but I haven't really tested
> them.

Hmm. The mpeg4 support does indeed work, and produces substantially
smaller files. There are however visible defects in the coding that
are not present in the rtjpeg codec. Usually, they appear as purple
or green splotches that last for a few seconds at a frequency of
several defects per 10 minute period. The splotches seem to be small
groupings of delta squares; ie they represent a small area of the
motion between a series of similar frames.

Possibly this has gone away with all the avcodec updates that went in
over the past week; I haven't updated yet.

--
Grant Taylor - gtaylor<at>picante.com - http://www.picante.com/~gtaylor/
Linux Printing Website and HOWTO: http://www.linuxprinting.org/
Re: Development thoughts + Mythtv crashing bug - during playback/delete [ In reply to ]
On Monday 09 September 2002 02:29 pm, Grant Taylor wrote:
> Yes, please don't bother. Mythtv is about watching TV. Stuff like
> DVD can be handled with something trivial like
>
> system("mplayer -dvd -blah-blah");

Yeah. On the dvd note, I'll add support for it once playing DVDs in linux
doesn't suck badly.

> Which brings up the point - is the frontend stuff at all scriptable?
> Currently most everything is a thread, which makes it rather hard to
> plug stuff in without writing code that runs in the same context as
> precious stuff like the timed recorder.

What would you want to do with it?

> What's more of a mystery is that I can't find what to put in my
> irxevent rc file for "space". "KP_Space" is the only listed thing in
> the xevent docs, but that doesn't work. Nor does "Space". I'm quite
> sure my remote button works; irw shows it being pushed.
>
> I looked at the example ir config file, and I can see no way to use
> the supported keys to select the "Record this showing" or "Record this
> timeslot" or "Record this title" options. Enter always exits the
> dialog - only a real space on the real keyboard seems to work, which
> is sort of awkward since my keyboard is in the basement!

I'll check that out.. haven't used the remote much lately, mainly been using a
wireless keyboard.

> Does -g change anything else in the way the code compiles? It might
> be a nice if the makefile defaulted to making a -g binary and then
> stripped it at install time. This way people can gdb the unstripped
> exe and core files with symbols.

Turning on debug in settings.pro also turns off the mmx code and some other
optimizations, which can cause problems in gdb. It's a lot easier to debug a
non-optimized binary.

> Also, is there something useful that can be done to snapshot a hanging
> mythtv? A couple times a day the player will hang for about 60-120s
> when I'm in the middle of forwarding or reversing. It just stops,
> with no sound, with the picture and "Forward" or "Reverse" osd overlay
> stuck, but it eventually continues.
>
> It's not crashing or saying anything. I've never noticed any hang or
> jumps in whatever was recording under it at the time; seems like a
> player-specific issue.
>
> What threads are active and waiting on what during ffwd/rew modes?
>
> This is a little odd, the usual failure modes for threaded software
> are "hang forever" and "blow up occasionally". Do you generally use
> semaphores with a 60s timeout or something?

No semaphores, but I bet the A/V sync code's getting thrown off somehow, and
it's waiting for an abnormally long period of time before displaying the next
frame -- happen to know if anything interesting is output to the console?

> Hmm. The mpeg4 support does indeed work, and produces substantially
> smaller files. There are however visible defects in the coding that
> are not present in the rtjpeg codec. Usually, they appear as purple
> or green splotches that last for a few seconds at a frequency of
> several defects per 10 minute period. The splotches seem to be small
> groupings of delta squares; ie they represent a small area of the
> motion between a series of similar frames.
>
> Possibly this has gone away with all the avcodec updates that went in
> over the past week; I haven't updated yet.

I did see those occasionally before I updated libavcodec, and haven't seen
them since. Of course, the problem could still be there and I just haven't
been watching enough TV =)

Isaac
Re: Development thoughts + Mythtv crashing bug - during playback/delete [ In reply to ]
>>>>> mythtv-dev@snowman.net writes:

> Yeah. On the dvd note, I'll add support for it once playing DVDs in
> linux doesn't suck badly.

mplayer appears to work fairly well. I've never really wanted the
menus or super omniphonic stereo sound, which is the usual failing
point with these things.

It would be interesting offering dvd support in mythtv. You're in the
US, no?

>> Which brings up the point - is the frontend stuff at all scriptable?
> What would you want to do with it?

Well, one could trivially launch mozilla/konqueror or mame; add a
button or two for X10 light dimming; or any number of other things.

>> What's more of a mystery is that I can't find what to put in my
>> irxevent rc file for "space". "KP_Space" is the only listed thing in

> I'll check that out.. haven't used the remote much lately, mainly
> been using a wireless keyboard.

Yeah, I'll play around more tonight, too. It's really the darndest
thing.

Qt might be discriminating against synthetic events, although why some
would work and others not I don't get.

> Turning on debug in settings.pro also turns off the mmx code and
> some other optimizations, which can cause problems in gdb. It's a
> lot easier to debug a non-optimized binary.

Silly x86. Grr.

I could offer you code to say "I'm being debugged, behave
differently," but I'd rather not curse you with heisenbugs.

> No semaphores, but I bet the A/V sync code's getting thrown off
> somehow, and it's waiting for an abnormally long period of time
> before displaying the next frame -- happen to know if anything
> interesting is output to the console?

No, I don't think so. I get a number of "strange error flushing
buffers", but this appears to be coming out of the recording side,
which aside from the message is working just fine. AFAICT there are
no other messages at all besides the state changes.

Here's from all of yesterday and probably some of the day before:

Probed: Television
Probed: Composite1
Probed: S-Video
Probed: Composite3
strange error flushing buffer ...
Changing from None to WatchingLiveTV
libavcodec: CPU flags: mmx mmxext 3dnow
using rtjpeg
Using XV port 85
Changing from WatchingLiveTV to WatchingRecording
Changing from WatchingRecording to RecordingOnly
Changing from RecordingOnly to WatchingOtherRecording
Using XV port 85
Changing from WatchingOtherRecording to RecordingOnly
Changing from RecordingOnly to WatchingOtherRecording
Using XV port 85
143144055
strange error flushing buffer ...
strange error flushing buffer ...
result was 2
Changing from WatchingOtherRecording to WatchingPreRecorded
Changing from WatchingPreRecorded to WatchingOtherRecording
using rtjpeg
Changing from WatchingOtherRecording to WatchingPreRecorded
Changing from WatchingPreRecorded to None
Changing from None to WatchingPreRecorded
Using XV port 85
Changing from WatchingPreRecorded to WatchingOtherRecording
using rtjpeg
Changing from WatchingOtherRecording to RecordingOnly
Changing from RecordingOnly to WatchingOtherRecording
Using XV port 85
Changing from WatchingOtherRecording to RecordingOnly
Changing from RecordingOnly to WatchingOtherRecording
Using XV port 85
Changing from WatchingOtherRecording to RecordingOnly
Changing from RecordingOnly to WatchingRecording
Using XV port 85
Changing from WatchingRecording to RecordingOnly
Changing from RecordingOnly to WatchingOtherRecording
Using XV port 85
Changing from WatchingOtherRecording to RecordingOnly
Changing from RecordingOnly to WatchingOtherRecording
Using XV port 85
Changing from WatchingOtherRecording to WatchingPreRecorded
Changing from WatchingPreRecorded to None
12 23 38
strange error flushing buffer ...
strange error flushing buffer ...
strange error flushing buffer ...
strange error flushing buffer ...
strange error flushing buffer ...

--
Grant Taylor - gtaylor<at>picante.com - http://www.picante.com/~gtaylor/
Linux Printing Website and HOWTO: http://www.linuxprinting.org/