Yair K. kirjoitti:
> Hi,
>
>   The attached patch (oss-freebsd.diff.gz) does the following:
>
>    1) Add support for module parameters under FreeBSD
>    2) soundoff now checks if programs are using /dev/dsp*, etc. under FreeBSD
>    3) clean up BeOS install a bit (OK: François Revol on IRC)
>
>
>   
Ok. In hg now.
>   BTW, I've been trying to add "real" vmix support to FreeBSD (the second 
> diff), but it panics when playing under VirtualBox... Is there something 
> obvious I'm missing? I'm trying to use the new devfs_set_cdevpriv[1] API to 
> store per-file private data.
>   

I think the problem is in oss_open(). Take a look at the Linux version 
(oss_cdev_open in os_linux.c) as an example.

The idea is that the "original" minor number is used as an index to the 
oss_cdevs[] array. Then oss_cdevs[minor]->d->open() is called. The last 
parameter of it is a pointer to an integer where new (redirected) minor 
number can be returned. If this value is !=-1after the call then
oss_open() should set cdev->priv to this "new" minor number. Otherwise 
it needs to be set to the "old" minor. This doesn't seem to get done by 
your diff (or  is it).

Subsequent read/write/ioctl/whatever calls should use this private info 
as an index to oss_cdevs[] instead of the usual minor number.

The big question is does this "cdevpriv" get shared by all applications 
that use given device file (say /dev/dsp0) or will each application 
using the device at the same time have distinct number. The attempt to 
implement open redirection we did earlier failed because all 
applications that had the device open got redirected to the same engine. 
They conflicted with each other and nothing worked.

For example:

1) The first process opens /dev/dsp and gets redirected to engine (say) 9.
2) Second process opens /dev/dsp and gets redirected to engine 10. 
However also process 1 will now be redirected to engine 10 because 
cdevpriv is shared by both processes and it now points to engine 10.
...
...
N) N proceses have /dev/dsp open and they are all redirected to the 
engine allocated for process N.

Best regards,

Hannu
_______________________________________________
oss-devel mailing list
oss-devel@mailman.opensound.com
http://mailman.opensound.com/mailman/listinfo/oss-devel

Reply via email to