Subject: Re: Propose: improve audio driver
To: None <tech-kern@netbsd.org>
From: Tetsuya Isaki <isaki@par.odn.ne.jp>
List: tech-kern
Date: 03/15/2002 00:20:20
I'd like to commit it on this weekend,
if there is no negative opinion.
---
Tetsuya Isaki <isaki@par.odn.ne.jp / isaki@NetBSD.org>

On Tue, 12 Mar 2002 00:45:47 +0900,
In Re: Propose: improve audio driver,
Tetsuya Isaki <isaki@par.odn.ne.jp> wrote:
> Hi,
> 
> I made a bug fix patch for vs(4) driver again for the audio framework
> that tamura-san (kent@netbsd.org) has commited days ago.
> 
> This patch extends struct audio_params of audio(9).
> Newly I added the member `factor_denom' (was called
> reduce_factor last time) which is a denominator of `factor'.
> It can let sw_code reduce output data size in audio_write().
> 
> vs(4) can play mulaw and ulinear8 correctly with this patch.
> and I've also tested yds and auich on i386.
> ---
> Tetsuya Isaki <isaki@par.odn.ne.jp / isaki@NetBSD.org>
> 
> On Sun, 24 Feb 2002 13:58:35 +0900,
> In Propose: improve audio driver,
> Tetsuya Isaki <isaki@par.odn.ne.jp> wrote:
> > Hi,
> > 
> > I'd like to introduce the mechanism of factor=1/n to
> > struct audio_params for x68k vs(4) driver.
> > 
> > for details:
> > MI audio driver prepares sw_code and factor to be able
> > to play 8bit/sampling format with the hardware which can
> > play only 16bit/sampling, for example.
> > 
> > However, so that factor appoints whether data after
> > sw_code become several times of original one with integer,
> > MI audio driver does not support the case that data after
> > sw_code become smaller than original one.
> > 
> > Because X68k built-in ADPCM is 4bit/samping, originally
> > vs (driver for X68k built-in ADPCM; arch/x68k/dev/vs.c)
> > can play no format of 8bit/samping and 16bit/sampling format
> > with mechanism of existing sw_code and factor.
> > 
> > # However, due to a bug (see dev/ic/msm6258.c of attached patch)
> > # and the easy fix (sample_rate *= 2 in arch/x68k/dev/vs.c of
> > # attached patch), current vs(4) driver can play it fortunately
> > # under some conditions.
> > 
> > Here is my proposal. I've improved MI audio driver to use
> > factor=1/n and I've fixed a bug of vs(4). I attach the
> > patch to this mail. With this patch, vs(4) can play mulaw and
> > ulinear8 correctly.  And I think there is no side effect on
> > any other audio drivers.  I've tested only yds driver on i386.
> > 
> > 
> > Recording is untouched.
> > Please comments.
> > 
> > Thanks.
> > ---
> > Tetsuya Isaki <isaki@par.odn.ne.jp / isaki@NetBSD.org>