Sound driver instability

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Sound driver instability

Post by Brunni »

Hello,

I've got problems with sound, sometimes my PSP will randomly crash.
In fact that's emulated sound, which is ran in parallel of a menu. There's two threads:
* main thread (draws & execute menu), normal priority
* sound thread (generates and output the sound, can take a lot of time**), high priority
** depends on the currently used channels, instruments used, additional selected effects, etc. - varies a lot during a second
Sound will take over the main thread and menu framerate will simply drop when there's not enough power. With some songs requiring a lot of power, the sound will slow down (and thus produce a few "clicks") because it can keep up the correct speed (that's normal), but the problem is, then the PSP will randomly crash (can be after 2 seconds to a few minutes). Before crashing it usually outputs a "sshh" noise and continues for a 1/2 second before locking up (screen is frozen as is, music stopped, no key - neither home - will respond).

However, if I set CPU to a very low frequency and play songs that require a lot of power, it's outputing a lot of clicks (because too slow) but not crashing. It seems only to happen when a music only *occasionnaly* (but not always) uses too much power. I don't care about clicks, it's normal, but I would like to eliminate those crashes which are quite annoying :-(

Note: It seems generating sound from the main thread (and just use the sound thread to copy/output the buffer) works perfectly, even when lagging, but the problem is that the menu will sometimes do very heavy tasks like listing a directory and this will stop sound :-( so it really has to be run in parallel...

Has anyone had such a problem or has any hint to give to me?
Thanks in advance ^^
Sorry for my bad english
Image Oldschool library for PSP - PC version released
Post Reply