[haiku-development] Re: building mediaplayer

  • From: "Stephan Assmus" <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 23 Jun 2010 23:57:11 +0200


sami vuokila <varjosanomat@xxxxxxxxx> wrote:
> my main interest is to stop mediaplayer crashing media services when you
> lauch heaps of videos. after a few weeks we're demoing haiku at the kansai
> open source conference so i'd like things to be nice.
> Maybe the problem of mediaserver crashing is in the mediaserver and or
> media addon server but for now i'd be happy if i could masquerade the problem
> somehow.
> it looks like when you open a media file there is a peak of processor
> usage. when you are running low on cycles with many videos already playing,
> this peak kills first the sound (it wont come back) and video on other
> instances freezes but comes back alive after random interval.
> so my idea a:
> lower the priority of mediaplayer when the video is being prepared to show
> (the peak) and ramping it up again when we have displayed the first frame.
> idea b: 
> read processor usage from somewhere and bail out if we are likely to get
> in trouble with launching yet another video.
> there seems to be enough cycles to run the 7th or 8th video file if the
> peak would not kill mediaserver.
> thoughts?

My thoughts are that you are trying to tackle the problem from a completely 
unrelated direction with little chance of success. You have such a nice 
deterministic test case which reliably crashes the media server. The stack 
trace tells you were exactly (if I remember the ticket correctly), it's a 
debugger call. So the obvious thing to do is to analyse the problem where it 
happens and try to find the proper fix. To me it sounds like media server is 
running out of a critical resource (probably nothing to do with the CPU usage) 
and then programmer laziness has inserted a debugger() call in place of 
properly handling the situation. First you could try to handle the error 
gracefully without calling the debugger() function, next you could try to 
address the underlying problem of running out of a critical resource, if that's 
what is happening.

Don't hesitate to ask for more help!

Best regards,

Other related posts: