[openbeos] Announcing OpenSound System port to BeOS/Haiku

(resent as oss-devel rejected it due to the size of the patch)

Hi there,
I have the pleasure to announce I have ported OSSv4.1test to BeOS.
It's not finished yet, but it runs and plays some sound.

The goal is to use its drivers to get wider audio support for Haiku,
the FreeSoftware rewrite (under BSD/MIT) of BeOS.
BeOS, and Haiku, have a high level C++ API for media, so we won't port
OSS apps (but some have been ported to use our Media Kit), but rather
use OSS from the Media Kit, either by writing an OSSMediaNode plugin to
support the existing ioctls, or port the drivers to implement the so
called "multi audio" ioctls used by the Media Kit to talk to some
existing lower level drivers. (some older drivers use a different ioctl
set already, publishing under /dev/audio/old/).

Current limitations:

- built as a single binary due to limitation in cross-module symbol
referencing (our kernel enforces a clean API to each module by forcing
others to use a defined list of pointers to functions, which is nice to
maintain compatibility but doesn't help there). Next phase should fix
it.

- Locking isn't correct yet, it seems other OSes don't need much
locking, how don't they even crash ? :p It seems devices become busy
after several uses, so ref counting is broken.

- it currently pollutes our clean hierarchical devfs, which we had way
before linux... should later publish stuff under /dev/audio/oss/.

- no usb support (yet), but usb support in BeOS is rough anyway and
Haiku's is underway. all PCI devices should work though. Tested with
both an ATI IXP and Ich Sis.

- it doesn't load under Haiku yet, due to a missing __ucmpdi2 symbol in
the kernel. Seems to be some runtime stuff to be fixed soon.

- mixer control doesn't seem to be working (ossmix vol 2 does set to 2
when read back but doesn't change actual output).

The patch against 20070624 is available here:
http://revolf.free.fr/beos/patches/oss-v4.1test0-070624-beos.diff.txt
It's probably not ready for official inclusion yet.

People wanting to build it should follow the official way after
patching:
mkdir build
cd build
/path/to/configure
make build

This puts binaries in prototype/...

When installing to test, the oss_core binary must be both copied as:
/boot/home/config/add-ons/kernel/drivers/bin/oss_core
and:
/boot/home/config/add-ons/kernel/media/oss
because the driver loads itself as a module.

Attached is the output of some commands to serve as "screenshot" :)


A test binary is available:

wget http://revolf.free.fr/beos/oss-beos-v4.1test-bin.zip
unzip oss-beos-v4.1test-bin.zip -d /boot
rescan oss_core
osstest

Make sure you quit media_server and media_addon_server first, they
might be using the card.

Cheers,
François.

[revol@Zeta /Data/oss/build]# target/bin/osstest
Sound subsystem and version: OSS 4.1test0 (build 070624/200706262 (0x00040002)
Platform: BeOS/BePC 6.2 18100

*** Scanning sound adapter #-1 ***
/dev/oss/ich0/pcm0 (audio engine 0): SiS 7012
- Performing audio playback test...
  <left> OK <right> OK <stereo> OK <measured srate 47961.00 Hz (-0.08%)>
/dev/oss/ich0/pcm1 (audio engine 1): SiS 7012
- Skipping device (card already tested)

*** All tests completed OK ***
[revol@Zeta /Data/oss/build]# target/bin/ossinfo
Version info: OSS 4.1test0 (build 070624/200706262 (0x00040002)
Platform: BeOS/BePC 6.2 18100

Number of audio devices:        2
Number of audio engines:        2
Number of MIDI devices:         0
Number of mixer devices:        1


Device objects
 0: oss0 OSS core services
 1: ich0 SiS 7012

MIDI devices (/dev/midi*)

Mixer devices (/dev/mixer*)
 0: ICH AC97 Mixer (0x434d4983) (Mixer 0 of device object 1)

Audio devices
/dev/oss/ich0/pcm0      SiS 7012  (device index 0)
/dev/oss/ich0/pcm1      SiS 7012  (device index 1)
[revol@Zeta /Data/oss/build]# target/bin/ossmix
Selected mixer 0/
Known controls are:
        vol <both/leftvol>[:<rightvol>] (currently 75:75)
        vol.rec ON|OFF (currently OFF)
        pcm <both/leftvol>[:<rightvol>] (currently 75:75)
        speaker <monovol> (currently 0)
        line <both/leftvol>[:<rightvol>] (currently 32:32)
        line.rec ON|OFF (currently ON)
        mic <monovol> (currently 0)
        mic.rec ON|OFF (currently OFF)
        cd <both/leftvol>[:<rightvol>] (currently 75:75)
        cd.rec ON|OFF (currently OFF)
        igain <both/leftvol>[:<rightvol>] (currently 75:75)
        aux1 <both/leftvol>[:<rightvol>] (currently 32:32)
        aux1.rec ON|OFF (currently OFF)
        phone <both/leftvol>[:<rightvol>] (currently 0:0)
        phone.rec ON|OFF (currently OFF)
        mono <monovol> (currently 75)
        mono.rec ON|OFF (currently OFF)
        video <both/leftvol>[:<rightvol>] (currently 0:0)
        video.rec ON|OFF (currently OFF)
        rear <both/leftvol>[:<rightvol>] (currently 75:75)
        center <both/leftvol>[:<rightvol>] (currently 75:75)
[revol@Zeta /Data/oss/build]# target/bin/ossplay -d/dev/oss/ich0/pcm0 
/etc/sounds/Youvegot.wav
[revol@Zeta /Data/oss/build]#

Other related posts: