Tuesday, August 09, 2005

media_server crash, and more information on live nodes

It's verified now. Zeta 1.0 media_server does crash when using the DVB media add-on. Exactly the same crash occurs when quitting eXposer. This seems to be a new bug that was introduced with release of Zeta 1.0, as it doesn't happen with the previous release, Zeta neo. It seems as if during final quality testing before Zeta 1.0 release, nobody tested eXposer. Too bad, I hope there will be an update or service pack available shortly.

I also received a reponse from Yellowtab's current media kit guy, Maurice Kalinowski. Unfortunately, it appears that the media kit doesn't make all physical input and output nodes available as live nodes, so the application has to do a little more than I expected. The complete answer is reproduced below, I assume the answers will be helpful for some of you.

Dear Mister Overhagen,
on August, 6th you have contacted me because of some issues regarding the MediaKit, especially for your work on the DVB interface. I hope the following answers will help you on your activities.

1)
Notwithstanding the use of B_FLAVOR_IS_GLOBAL in the flavor_info::flavor_flags field, media kit allows to instantiate more then one node for the flavor, and calls InstantiateNodeFor whenever BMediaRoster::InstantiateDormantNode() is called for the flavor. I also set flavor_info::possible_count to 1, but that doesn't help either, so I had to revert to a very ugly workaround.
Question: What do I have to get it working right, i.e. preventing further calls to InstantiateDormantNode() after the flavor got instantiated the first time?

Currently B_FLAVOR_IS_GLOBAL only checks wether the Node should be loaded into the Media AddOn Space or into your applications one. So it seems like BMediaRoster is instantiating additional nodes although it was not supposed to do this. I will check on this... But I am really interested in your workaround, although being ugly as you said.

2)
The flavors and nodes that are instantiated have the kind B_PHYSICAL_INPUT, I assumed that all physical input flavors would be instatiated automatically at media server startup, so that applications can find them with BMediaRoster::GetLiveNodes(). However, when having two DVB cards in the system, only the first flavor is automatically beeing instantiated, and available as live node. The BeBook says: "An active node is a node that is preloaded by the system and is always available for use, as opposed to a dormant node, which resides in an add-on and is only loaded when instantiated using InstantiateDormantNode(). "
Question: Under what conditions is a node beeing preloaded, and why is only one of my BMediaAddon flavors (nodes) beeing preloaded?

During the start of the media_server it scans the media preferences, which input is set as the default one. Afterwards this input gets instantiated and available as LiveNode. The fact, that this input is supposed to be the 'default' one, only this one got started, although there may exist multiple ones of the same kind.

3)
Question: Are all physical input / output nodes supposed to be active nodes and preloaded?

As explained in 2 only the default one set in the media preferences gets preloaded and active.

4)
If answer to 3 is "no",
Question: how should an application know which dormant nodes are already live, and which need to be instatiated? Why does the application has to care?

Until now, it just seemed reasonable that the user or the application only needs to use one physical input. This is the reason why an application should just request for the default and active inputs for audio and video. Your aspect of using multiple DVB or soundcard above is a good argument for possible changes on this.

5)
BMediaRoster has GetAudioInput() and GetVideoInput(), but these only return the interface selected in Media preferences.
Question: Whats the correct way for an application to handle multiple physical inputs, like 3 soundcards or 2 videocards?

This is the same point as in question 2 and 3. As you said GetAudioInput() and GetVideoInput() only gives you access to one media_node. This is the one selected as the default Input in the Media Preferences. If you want to use multiple inputs, you may hold the media_node_id and then use status_t BMediaRoster::GetNodeFor( media_node_id , media_node )

6)
I tried to use BMediaNode::AutoStart(), but it's never called. I'm returning true from BMediaNode::WantsAutoStart(). You can see a source snippet at addon.txt
Question: whats wrong?

I have tested something similar to your problem here in the company and it worked, so I do not really know, what might go wrong on your side. It would be great, if you may show me more of your code, so I can take a deeper look at this.
By the way you should use B_MEDIA_ADDON_FAILED in your AutoStart() function instead of B_ERROR if you want AutoStart to be called again for the next index. There is a typing error in the BeBook as it says B_ADDON_FAILED, but it is supposed to mean B_MEDIA_ADDON_FAILED.

7)
Question: When should a node use BMediaNode::AutoStart ?

A BMediaNode should only be autostarted if it is supposed to be available during the whole time a system is running. The best example for this is the Mixer as the user wants to listen to sound the whole time...

To come to an end I want to thank you again for telling us about your experiences with the MediaKit as it gives us an impression about what should be improved for developers.

Regards
Maurice Kalinowski

3 Comments:

At 10 August, 2005 09:49, Anonymous Anonymous said...

Dear Mister Overhagen,
as I could read on your blog, there were some problems with the media_server whilst your development on the DVB interface.
I just wanted to inform you, that this is fixed and a new version of the media_server will be available for you as soon as possible.

Furthermore I would like to ask you to send experiences with abnormal behaviour of any part of the system( especially crashes) to our bugtracker, which is always available at
http://bugzilla.yellowtab.com/

The use of this official way allows us to treat these issues more efficiently.

Regards
Maurice Kalinowski

 
At 10 August, 2005 22:35, Anonymous gopher said...

Hey Marcus,

I don't get why you're wasting your time with searching Zeta bugs. You do have your own Media Kit and I guess it's already great. The community won't ever pay you for your work, but yellowTab won't do that either!

 
At 14 August, 2005 21:58, Anonymous Anonymous said...

Hi Marcus, there's a new download section on YT's site. There's already an mediakit update with tata! exposer bugfix.

Nice uh?

But maybe you know already : []

Paul

 

Post a Comment

<< Home