[haiku-3rdparty-dev] Writing audio driver

  • From: Krzysiek Ćwiertnia <krzysiek.bmkx@xxxxxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Tue, 17 Nov 2009 13:01:10 +0100

Hello,

I'm currently writing a driver for ALI 5451, since it happened to be
my laptop's (HP NC4000) audio chip and I wanted to have a sound for an
overall good impression using r1alpha1 :) I found SiS7012/Trident
4dwave/ALI driver by Siarzuk Zharski in svn, but it's for old API. I
don't have much experience in writing drivers (this is 2nd), so I
thought instead of porting it I would be better off with starting from
scratch, using auvia & hda drivers from svn for new multi audio system
reference and earlier mentioned old driver, linux alsa driver and
trident documentation for information about the card.

To the point: some mixer sliders are implemented, playback is working,
but it's currently fixed at 48 kHz (card's higher freq.). I saw in
multi audio add-on implementation that the algorithm behind setting
global format is quite simple: set highest rate that the driver
returns. There are also declarations for per channel set & get formats
functions, but I think it's yet to be supported?
So my question is what is the proper way to implement formats? Should
I just leave it for now as it is (return only max sample rate that the
hardware supports) for now? Or, maybe there is somewhere more
information on the subject?

Thanks and regards,
Krzysiek

Other related posts: