[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SBLive sound initializing problem



Hi there.

New on this list - and new to sound programming.

I have added sound to a small game and this works fine on my setup (SB AWE
32). However, when running it on a machine a friend owns, where there is a
SBLive in, (driver version 0.2b) it can not set the buffer size. Here is
the code (relevant parts):

---------------
#define DefSoundSetting 0x00030009 /** 512 bytes, 11025 / 512 ~= 21.5 ms
*/
int SoundSetting = DefSoundSetting;   

...

/** At this point the sound device is open - first thing I do is set the
buffer size */
  /** Setup the buffer we will use */
  if ( ioctl(SoundDevHandle, SNDCTL_DSP_SETFRAGMENT, &SoundSetting) == -1
) {
    perror("ioctl set fragment");
    return errno;
  }              
  if (DefSoundSetting != SoundSetting) {
    printf("DefSoundSetting not set - shutting down sound\n");
    sound_shutdown();
    return -1;
  }
------------
For my system, everything is fine. For his, the soundformat does not get
set correct. (It prints out "DefSoundSetting not set - shutting down
sound\n")
I know I should have a dump of the setting that actually gets printed, but
before fiddling to much with it, I wanted to ask if anyone knows what the
status of SBLive is? (Is there a newer version of the driver - does it
support setting the buffer size, etc.)

I browsed the europeean version of the creative web pages. I could not
find anything, really.

Also, I would like som recommendations for a suggested buffersize. I read
the stuff about sound settings on www.opensound.com, but before saturday I
had never programmed sound before, so this is really a trial and error
state I am in - the 3 * 512 bytes seems to work good with minimal lag, and
since I am sleeping the sound thread for 12.5 ms intervals I do not seem
(hear?) to get any underrun.

Thanks in advance,

Mads

-- 
Mads Bondo Dydensborg.                               madsdyd@challenge.dk
'Open Systems' means no fences. And no fences means no use for Gates.
                                                        - Sun Microsystems