Train shedding |
2010-10-04
|
Had a good time at the OpenVideo Conference in New York City, as well as today at (cut short for me) FOMS.
I took the Amtrak train from NYC to Boston and was looking forward to doing four hours of hacking, knocking up a quick prototype of doing chunked streaming of Ogg and WebM.
I didn't actually get to that point however because my test stream triggered the streamer going lost, meaning that its main loop is stuck. So attaching gdb I was reminded how the 'pystack' macro in gdb (which was incredibly useful - it prints a python stack) hasn't worked for me for the last couple of years.
And this time I set out to properly fix it. If only the docs on gdb were easy to understand. My knowledge of gdb doesn't go much beyond the standard 'thread apply all bt' stuff and doing simple inspection. I ended up understanding why the macro hangs (it compares the value of $pc to known function names, and goes up the stack until it finds PyMain. In most of my cases there is no PyMain however, and when you go 'up-silent' in gdb at the top of the stack, it just silently fails leaving you at the same frame forever).
I don't claim to understand exactly how gdb works; for example, there are cases where $pc stays the same going up a frame, seemingly because a function is wrapped into a macro which seems to get its own frame. So I ended up writing a loop that goes up until the $pc changes, and then go back down, leaving me at the frame that calls a python method with a code object.
So, now I have my pystack working again in the cases I tested, so that's good.
Incidentally, if anyone knows gdb well enough, here are some questions:
- Is there a way I can detect in a script that 'up' didn't actually go up ?
- Is there a programmatic way to know how many frames there are, and what frame number you're on ?
After fixing that, I was again bitten by a bug where - not always, but often - a flow with Vorbis and Theora has a timestamp/duraiton discontinuity of 1 nanosecond. I can't reproduce it on the command line with -launch, so I think it's related to a set_base_time call on the pipeline.
So I started writing a unit test, but for some reason make check in gst-plugins-base doesn't work for me because it can't find capsfilter and other core elements. So I get to dive into the test setup code again to figure out why a registry is getting generated that blacklists coreelements...
The train pulled into Boston as I was looking into how the new registry code works and why it blacklists coreelements, so I'll have to save this test for a later day...
Incidentally, I have a day off in Boston this week. I really want to finally go to MIT and follow a class there, in computer science or mathematics. Is that sort of thing open in the US ? Can you just sit in on a class ? Any tips ?