Subject: Re: Ideas on the audio framework
To: None <>
From: TAMURA Kent <>
List: tech-kern
Date: 01/05/2005 16:57:07
In message "Ideas on the audio framework"
    on 04/12/03, TAMURA Kent <> writes:
> I'm planning to add the following capabilities to the audio
> framework:
>  A. Audio converter pipeline
>  B. In-kernel audio mixing

Well, A is almost done in kent-audio1 branch.  I'm going to
merge it into -current at 10 January or later if we don't have a
big concern.  Then, I'll start kent-audio2 branch for B.

You can review the changes in kent-audio1 branch by:
	cvs rdiff -u -kk -r kent-audio1-base -r kent-audio1 src/sys
It produces 13,000 lines diff :-)

Summary of changes in kent-audio1 branch:

* struct audio_params
  - remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels.  Conversion information
is conveyed by stream_filter_list_t.
  - change the type of sample_rate: u_long -> u_int
  - add `validbits,' which represents the valid data size in
precision bits.  It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
 - add two parameters to set_params()
	stream_filter_list_t *pfil, stream_filter_list *rfil
   A HW driver should set filter recipes for requested formats
 - constify audio_params parameters of trigger_output() and
trigger_input().  They represent audio formats for the hardware.

* sw_code is replaced with stream_filter_t.
  stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
  converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
 - audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
 - audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
 - audio_write(), audio_pint(), and audio_rint() invoke a filter
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes

TAMURA Kent <kent_2005 at> <kent at>