[linux-audio-dev] Alsa OSS emulation

Jens M Andreasen jens.andreasen at chello.se
Mon Nov 22 20:15:32 UTC 2004


Hi (Takashi?)!

The OSS emulation in ALSA is slightly wrong regarding number of
requested buffers. To quote from my own "notes to self" from own source:


 /** Setting up the soundcard for CD-HiFidelity Stereo 
   * 
   */
  audio.path      = "/dev/dsp";
  audio.speed     = SAMPLERATE;
  audio.format    = AFMT_S16_LE; 
  audio.is_stereo = TRUE;

  // 3 buffers of 256 bytes == 3 * 64 (16bit) stereo samples
  // 0x0002 buffers == n - 1, although Alsa (mis)interpretes oss buffers
  //   == n!!! Use 0x0003!
  //
  //   0008 bytes   == log2(number of bytes in buffer), 2^8 == 256 == 64
  //   stereo samples;
  

  audio.bufsize = 0x00030008; 
  
  
... so ALSA UNDERSHOOTS the number of buffers BY ONE (which of course
will not work for RT-people on the edge.)


mvh // Jens M andreasen

PS: Thanks to the mdk10.1 beeing distributed on DVD by LinuxFormat this
month, work is ongoing for a clean alsa solution of my handyworks ...

DS





More information about the Linux-audio-dev mailing list