OpenSound System v4 port to Haiku
FOSDEM 2010 th Sunday 7 February 2010 François Revol
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
1
OpenSound System v4 ●
First audio driver for Linux
●
Large number of supported cards
●
4Front closed sources (Linux → ALSA)
●
Ports to other Unices
●
Version 4: ●
New functionalities (VMix, ALSA emulation…)
●
Re-opening of sources (june 2007) –
BSD and GPL
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
2
Supported Platforms ●
Linux
●
FreeBSD
●
SCO UnixWare
●
Solaris/OpenSolaris ●
●
Boomer (specifc rewrite)
VxWorks
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
3
Porting Eforts ●
BeOS & Haiku (committed)
●
Minix 3
●
Syllable
●
Your OS Here
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
4
Haiku ●
Operating System
●
Free as in speech (BSD/MIT Licence)
●
Compatible with BeOS
●
Desktop focused
●
High-level audio API (Media Kit)
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
5
Motivations ●
Need for more hardware support
●
Number of OSS-supported cards
●
Being able to watch videos on my laptop ;-)
●
Porting time ≪ N x Time to write a driver
●
OSS on many plateforms → easier port
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
6
Architecture of OSS under Unix Applications XMMS, ...
XMMS, ... ossmixer
XMMS, ...
/dev/oss/atiaudio0/pcm0
Sound server (ESD, aRtsd...)
User mode Kernel mode
/dev/oss/vmix/pcm0
/dev/mixer
cdev osdev
cdev
cdev osdev
cdev osdev
cdev
cdev
osdev osscore
atiaudio
sbpci
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
vmix 2010-02-07
7
Architecture under Haiku media_server
Native applications SoundPlay
media_addon_server buffer
Mixer Node
buffer buffer buffer
OpenSound Node
MediaPlayer, VLC...
OpenSound Node /dev/oss/atiaudio0/pcm0, mix0
User mode
/dev/oss/sbpci/pcm0
oss_loader (driver)
Kernel mode
osscore (module) atiaudio
sbpci
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
vmix
2010-02-07
8
Source tree layout ●
kernel/
●
include/
OS/
●
cmd/
●
os_cmd/
●
●
–
Linux/
–
BeOS/ (glue & drv stubs)
●
drv/
●
framework/ (core)
setup/ ●
BeOS/ (build stuf) © François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
9
Build system ●
Handcrafted confgure
●
srcconf binary generates .c fles
●
Makefles ●
●
Shell scripts
Added complexity to handle Linux' lack of DDI
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
10
Porting Issues ●
Build system (make + script + .c + make...) ●
●
Examples of other plateforms helped
Abstraction Layer ●
●
Mutex, allocation, interruption, timer,... → OK Serialisation of access (preemptive kernel) → benaphore :-)
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
11
Porting Issues (2) ●
Loading of modules ●
●
Publication of items in /dev ●
●
Driver → osscore → modules Added to a list returned to the kernel
« return -EINVAL; » → RETERR(EINVAL); ●
Fixed differently in current tree (OSS_EINVAL)
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
12
opensound.media_addon ●
class OpenSoundAddOn ●
●
class OpenSoundNode (pushes BBufers) ●
●
public BMediaAddOn (instanciates Nodes) public (BBuferConsumer, BBuferProducer, BTimeSource, BMediaEventLooper, BControllable)
class OpenSoundDevice (ioctls /dev/oss/*) ●
class OpenSoundDeviceEngine
●
class OpenSoundDeviceMixer → native GUI © François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
13
Features ●
Native API ●
Applications don't see the diference
●
soundcard.h not made public
●
Playback and recording
●
Multi channels (not much tested)
●
Native mixer
●
Automagic PCI probing (+subsystem ID) ●
No soundon / ossdetect / ... © François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
14
Still missing ●
Missing select() support
●
Missing USB support
●
Separate binaries for kernel modules
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
15
Remaining bugs ●
Incorrect latency handling ●
●
Partly due to scheduler bugs, partialy fxed
No PCI ressource reservation → Conflit with native drivers ●
Fix underway
●
Misterious « mute after 6h20 » (overflow?)
●
Some mixer issues with mute checkboxes
© François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
16
More Infos ●
Haiku ●
●
OpenSound System ●
●
http://developer.opensound.com/
4Front ●
●
http://haiku-os.org
http://4front-tech.com/
François Revol ●
mailto:
[email protected] © François Revol (CC-BY-SA) Alt-OS devroom - FOSDEM 2010
2010-02-07
17