On Fri, Jul 11, 2003 at 03:05:28AM +0300, Kai Vehmanen wrote:
> One thing to try is the alsa-oss package. This is an alternative
> (user-space) implementation of the OSS emulation layer. It relies on the
> LD_PRELOAD mechanism. You can test it with:
> 
> LD_PRELOAD=/path/to/libaoss.so.0.0.0 ./a.out
> 
> ... where "a.out" is your test program. You should be able to run ViaVoice
> also this way. You can get the alsa-oss package from ALSA CVS or from:
> LD_PRELOAD=~/src/alsa-cvs/alsa-oss/.libs/libaoss.so.0.0.0 ./a.out

Thanks, this is very useful.

I downloaded the source of ALSA from CVS.
It turns out that I cannot compile it: I have kernel 2.5.74
and the alsa source (alsa-drivers and alsa-kernel) is full
of 'spin_lock_*' function calls that do not exist in kernel 2.5.

Nevertheless, I could compile the alsa-oss library.

This turns out not to be blocking anymore - but, the result of
a SNDCTL_DSP_GETISPACE is unfortunately nonsense :(

I now get:

~>LD_PRELOAD=/usr/src/alsa/alsa-oss/.libs/libaoss.so.0.0.0 a.out
Fragment size: 1024
Number of fragments: 32767
Number of channels: 1
Sample rate: 22050
Number of full fragments that can be read or written without blocking: 0
Total number of fragments allocated for buffering: 2
Size of a fragment in bytes: 2048
Number of bytes that can be read or written immediately without blocking: 1024
Number of full fragments that can be read or written without blocking: 0
Total number of fragments allocated for buffering: 2
Size of a fragment in bytes: 2048
Number of bytes that can be read or written immediately without blocking: 1024
Number of full fragments that can be read or written without blocking: 0
Total number of fragments allocated for buffering: 2
Size of a fragment in bytes: 2048
Number of bytes that can be read or written immediately without blocking: 1024
Number of full fragments that can be read or written without blocking: 0
Total number of fragments allocated for buffering: 2
Size of a fragment in bytes: 2048
Number of bytes that can be read or written immediately without blocking: 1024
Number of full fragments that can be read or written without blocking: 1
Total number of fragments allocated for buffering: 2
Size of a fragment in bytes: 2048
Number of bytes that can be read or written immediately without blocking: 3072
Read 1024 bytes.
etc

The size of a fragment is NOT 2048... it is 1024.
It also reports 3072 bytes available, which is more than the total size of the buffer!

I am not sure what the application will do with mis-information like this.

-- 
Carlo Wood <[EMAIL PROTECTED]>


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to