Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#222307 - 10/10/2002 06:49 thread scheduling
pauln
enthusiast

Registered: 03/12/2001
Posts: 332
Loc: UK
I'm not sure that this is the correct place to be posting this, but if not, I'm sure someone will gently prod me in the right direction.

Because I'm sad that way, I've been messing around with the idea of writing a "terminal" or "thin" client for the Rio. The idea being that java applications running on a PC would receive input and send screens to the Rio.

I have gotten as far as getting a basic mp3 player working with libmad, but am now pulling my hair out because ...

The scheduling between my User Interface and Audio Decoder threads seems to be at best "luck of the draw". Sometimes the UI thread gets loads of CPU while the audio playback struggles. And the next time I run the audio will be filling it's buffers merrily, but the UI will be sluggish.

I've tried setting the thread scheduling policy to Real Time and setting relative priorities, but it still can't get reliable results.

Does anyone have any experience of these things?

Regards
Paul
_________________________
Paul (the tRio guy)

Top
#222308 - 10/10/2002 14:10 Re: thread scheduling [Re: pauln]
dave
new poster

Registered: 11/05/2000
Posts: 65
Loc: San Diego, CA
The scheduling between my User Interface and Audio Decoder threads seems to be at best "luck of the draw". Sometimes the UI thread gets loads of CPU while the audio playback struggles. And the next time I run the audio will be filling it's buffers merrily, but the UI will be sluggish.

Sounds like your application is just using too much CPU power. I'm not really an expert in these things, but my guess is you'd be better off trying to improve the performance of your code rather than trying to fix it with scheduling.

Another (somewhat messy) option is you can use calls to sched_yield() to try to artifically lower the priority of your display task (I'm assuming you'd rather that be sluggish than to drop audio). Still, I think your best option will be to reduce your CPU loading.

Top