On Tue, Oct 14, 2014 at 09:09:26PM +0200, Alexandre Ratchov wrote:
> Since end 2011 we have complete audio format conversions code
> enabled by default that runs in user-mode (from any to any
> encoding, rate, and channel number combination). So there's no
> reason to keep the incomplete kernel conversions code, which is not
> reachable by default, and not properly used by all drivers.
> 
> Furthermore the kernel code to setup conversions is duplicated in
> every single low-level driver, depite being ugly, this complicates
> evolution of the mi code as it forces to update & retest every
> single driver whenever the mi code changes. Finally there's no
> fundamental reason for doing cpu-intensive conversions in the
> kernel and holding the kernel_lock for longer than necessary.
> 
> What the diff does:
> 
> in all set_params() driver functions:
>   - remove handling of encodings that sets sw_code, in this case
>     either return EINVAL or (better) use another encoding.
>   - rather than tweaking code to set the encoding to
>     AUDIO_ENCODING_[SU]LINEAR, remove it as only
>     AUDIO_ENCODING_[SU]LINEAR_{LE,BE} are used.
>   - play and rec encodings are always the same. So remove code to
>     handle different play and rec encodings rather that tweaking it
>     and introducing errors
> 
> in all query_encoding() driver functions:
>   - remove entries corrsponding to emulated encodings
>   - if necessary, renumber indices to remove "holes"
> 
> in all other driver functions:
>   - replace the "factor" field by "1"
>   - remove unused variables resulting from above steps
> 
> For now the linear<->mulaw conversions is still needed for am7930
> as it supports mu-law only. The diff moves it in audio.c, which
> will be simplified later. Except for am7930, the diff is
> mechanical, still testing never hurts ;)
> 
> Objections? OKs?
> 

Hi,

Tested on azalia amd64 desktop & laptop and snapper on macppc, no
regression.

Diff looks good and I like this cleanning a lot. ok armani@ 

Reply via email to