[gst-devel] Re: [gst-cvs] thomasvs gstreamer: gstreamer/gst/ gstreamer/gst/registries/

Thomas Vander Stichele thomas at urgent.rug.ac.be
Mon Aug 12 03:09:02 CEST 2002

> Would you mind, the next time you go into this code, documenting your
> changes a little more fully? I'm just wondering because I mucked about
> in here a lot a while back, and thought I had got out all the bugs. A
> report of the problem would be nice.

Yeah, I was going to bring this up but I got tired yesterday because what 
I thought were simple fixes took too long to get right ;) it's still 
tricky stuff.

What I'm trying to do lately is to check the experience of installing 
gstreamer from scratch.  None of us ever do that ;) I've had user reports 
I couldn't figure out, and now that I'm doing completely fresh installs 
(without registry), I have them too.  You should try it sometime, it's 
very instructive.

The nastiest one, imo, which turned up a lot for people who try to install 
rhythmbox and thus don't care the least bit about gstreamer, is the one 
where you don't have a registry, and either none gets created (because the 
"hey I don't have a registry, let's re-register code" doesn''t work) or 
the system registry isn't writable and the user registry ends up empty.

The result of that in both cases is an empty registry, and every program 
using gstreamer then crashes with an assert error because it couldn't find 
the scheduler.

Now, I put in a few fixes over the last day to do that :
a) if it can't find the default scheduler name when it wants it, that's 
probably a big problem.  So I put an assert in the logical place instead 
of where it did error out.  It could be better, but it's better than 

b) if it cannot find either one of the registries when loading up an app, 
that's a problem if you asked to work with a registry.  In that case, the 
app will just stop running and tell you to run gst-register.  A lot saner 
IMO until we come up with a good way of handling this stuff.

c) I added an extra flag to see if a registry exists, and it tries to 
rebuild the registry if it doesn't

d) one of the main causes of irritation was when you install gstreamer so 
that the system reg is not writable by the user you run apps as.
So :
- no system reg
- system reg location not writable
- no user reg
The problem here was that it didn't find the system reg, tried to rebuild 
it, then gave an assert failure because the system reg wasn't writable.
Then it tries to write the user reg, but the paths added to that are empty 
(they were added to the system reg).  SO the user reg doesn't find any 
plug-ins and turns up empty.

What I did there was to "spill over" the paths from any registry that 
fails to load correctly, so that the next priority registry can try to 
register them.

It works 100% perfectly - I tried it, couldn't write the system reg, did 
write a full user reg, and I was able to run apps, yay !
Then to make sure everything's sane, I ran gst-register as root, ended up 
with two regs that were the same (global and user), and I was still able 
to run apps.

So that's the overview of my changes ;)

Now, if you've read this far :

My personal opinion is that we should FULLY SPEC OUT the behaviour we want 
from registries.  The code is still a mess.  I had to add the hack because 
I couldn't figure out  how we're supposed to do this.  And the number one 
reason we all can't figure out the right thing to do and we still end up 
with strange bugs (especially for first-time users, which is BAD !),
is that NONE of us have a clear idea about how we want the registry to 
behave.  So someone should write up a doc of best practices for the 
Points to be addressed :

- warn the user when no registry is usable
- should the registry automatically try to rebuild itself ?
- how does the user specify an alternate registry to read from or write to?
- what happens when the registry isn't writable ? path spillage ?
- how do we resolve conflicting registries (my point of view: let the user
  one take precedence)

and so on ...

You get the idea.

Thoughts ?



The Dave/Dina Project : future TV today ! - http://davedina.apestaart.org/
<-*-                      -*->
I'd like to tell you how I feel
I'll probably keep it till a Saturday
<-*- thomas at apestaart.org -*->
URGent, the best radio on the Internet - 24/7 ! - http://urgent.rug.ac.be/

More information about the gstreamer-devel mailing list