This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: sound support more info - kde2 porting status


<snip>
> 
> >6. the sound support of cygwin isn't ready. Especially setting 
> >   of audio buffer size from an application is a problem. 
> >   Look in the thread about the rocksndiamond game started with 
> >   http://sources.redhat.com/ml/cygwin-xfree/2001-q4/msg00171.html. 
> 
> I didn't see anything which actually set the blocksize in the code
> fragment that you sent to cygwin-apps.  I just saw code which read the
> block size and said "this should return 512".  But, cygwin uses a larger
> buffer than that.  I don't actually see an ioctl for setting the block
> size under linux, but maybe I missed something.
> 
It's called the fragment size and uses the SNDCTL_DSP_SETFRAGMENT ioctl call. 
It seems that the lower word contains the log2 of the buffer size and in the 
higher word the number of buffers are set. Currently Cygwin ignores this call. 
 	
	  /* Example for fragment specification:
	     - 2 buffers / 512 bytes (giving 1/16 second resolution for 8 kHz)
	     - (with stereo the effective buffer size will shrink to 256)
	     => fragment_size = 0x00020009 */

	 if (ioctl(audio.device_fd,SNDCTL_DSP_SETFRAGMENT,&fragment_spec) < 0)
	    Error(ERR_EXIT_SOUND_SERVER,
		  "cannot set fragment size of /dev/dsp - no sounds");

Ralf 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]