Minimum Size for slPCMOn?

slinga

Member
I'm having some weird results while trying to output audio with jo_audio_play_sound_on_channel() which is basically a wrapper for slPCMOn(). It seems like if my sound buffer is too small I don't hear anything at all. It seems like I need something like ~50,000 bytes or I don't hear anything.

Any advice on how to debug this? If this is a limitation of the slPCMOn(), should I concatenate my audio together? Thanks in advance.
 

Ponut

New Member
I couldn't tell you. As far as I remember, slPCMOn is a streaming audio function which will stream audio from work RAM to sound RAM and played back through a small ring buffer. I forget the size of those buffers, I think 16KB per channel? The point is, it doesn't store the audio in sound RAM permanently, which is bad. I don't remember having a minimum duration problem, you might have an issue somewhere else (input sampling?).

If you care, I have a replacement sound driver that can be used to playback PCM sounds from sound RAM much more easily.
I had so many problems with SGL PCM playback I first stepped forward to slSoundRequest, which sent a command directly to the SEGA sound driver.
Eventually, that was inadequate, because SEGA's sound driver was reserving large and distributed portions of sound RAM. I wanted as much of it as I can get. SEGA's driver is also buggy, and will frequently lose the playback state of sound channels. I'm not alone in observing this; you can hear this in many games (including Shining Force 3), or from other devs (XL2).
 

slinga

Member
Thanks for your library, I will take a look. I also found this old thread: Best way to play an on-the-fly generated PCM stream where the poster is also trying to output dynamically generated PCM audio.

In that old thread @vbt says the buffer length must be at least 0x900. I don't hear anything until I have at least 0x1200 bytes. I'm my stream is JoSoundMono16Bit if it makes a difference.
 

vbt

Staff member
it was written in the docs (surely sbl) and i've texted under 0x900, i didn't play
 
Top