dev_mmap ?

OSS specific Solaris discussion (x86/SPARC)

Moderators: hannu, dev, kodachi, cesium

dev_mmap ?

Postby Guest » Sat Jun 04, 2005 2:23 am

Should I be able to do something like:

mmap(NULL, shm->bufferlength, PROT_WRITE, MAP_SHARED, audio_fd, 0);

On /dev/dsp_mmap on Solaris 10 x86-64 ?
Guest
 

Postby Guest » Sat Jun 04, 2005 2:56 am

I ask because MAP_FILE is not defined on Solaris 10.
Guest
 

Postby Guest » Sat Jun 04, 2005 3:58 am

Okay, I've discovered that I can mmap a /dev/dsp_mmap if I use the 32-bit version of OSS. It does not appear to be possible to do this using the 64-bit OSS driver.

However, the same mmap OSS audio code that I use under Linux that sounds just fine with OSS/Free, is horribly choppy and latent under Solaris 10 x86 using the 32-bit driver.

Additionally, using SDL to do Audio instead of doing the sound using OSS directly myself gives a better result, but it still skips pretty bad.

The only audio option that does seem to work almost perfect (except for some minor latency) is telling SDL to use ESD for it's audio output instead of OSS.
Guest
 

Postby dev » Sat Jun 04, 2005 4:51 am

Anonymous wrote:Okay, I've discovered that I can mmap a /dev/dsp_mmap if I use the 32-bit version of OSS. It does not appear to be possible to do this using the 64-bit OSS driver.

However, the same mmap OSS audio code that I use under Linux that sounds just fine with OSS/Free, is horribly choppy and latent under Solaris 10 x86 using the 32-bit driver.

Additionally, using SDL to do Audio instead of doing the sound using OSS directly myself gives a better result, but it still skips pretty bad.

The only audio option that does seem to work almost perfect (except for some minor latency) is telling SDL to use ESD for it's audio output instead of OSS.


Which SDL version?. If it's from Companion CD, it may have problems. You need to do the following:

1) cp /usr/lib/oss/include/sys/soundcard.h /usr/include/sys/soundcard.h
2) download SDL sources
3) ./configure; make; make install (check that OSS audio gets defined).

If you've done this and still get problems with SDL, set an environment variable: DSP_NOSELECT=1 and then run SDL apps.


As for mmap() - it's not implemented in AMD64 because hat_getkpfnum() function has been removed and we need to support the new API. Secondly we hate MMAP() - It's not
recommended as there are devices that cannot handle mmap()
dev
 
Posts: 576
Joined: Fri Sep 12, 2003 6:08 am
Location: Culver City, CA

Postby Guest » Sat Jun 04, 2005 5:43 am

dev wrote:Which SDL version?. If it's from Companion CD, it may have problems. You need to do the following:

1) cp /usr/lib/oss/include/sys/soundcard.h /usr/include/sys/soundcard.h
2) download SDL sources
3) ./configure; make; make install (check that OSS audio gets defined).


I compiled SDL 1.2.8 from source myself with OSS support and verified that it's compiled in. The configure program even spit out:
checking for OSS audio support... yes

I just recompiled it again just to make sure I had done everything right, and still the same result.

If you've done this and still get problems with SDL, set an environment variable: DSP_NOSELECT=1 and then run SDL apps.


That was already done by OSS when I ran the installer, and it is set when running the game.

As for mmap() - it's not implemented in AMD64 because hat_getkpfnum() function has been removed and we need to support the new API. Secondly we hate MMAP() - It's not
recommended as there are devices that cannot handle mmap()


That may be, but almost every Linux game I compile on Solaris that has OSS support requires mmap support :| But, thanks for explaining why.

The OSS code I have works just as poorly as SDL when SDL_AUDIODRIVER=dsp.

I've tried both the 32-bit OSS and 64-bit OSS driver and have the same results.

What else can I check or do?
Guest
 

Postby Guest » Sun Jun 05, 2005 6:18 am

I would suspect the OSS code I'm using or SDL, but both of them work fine under Linux using OSS/Free. So, any hints would be appreciated.

At the very least, if there's something I can do to track down whether it's a problem in the OSS Solaris driver.
Guest
 


Return to Solaris

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests