Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.
Add a 'flags' argument to suspend/resume handlers and
callers such as pmf_system_suspend().
Define a flag, PMF_F_SELF, which indicates to PMF that a
device is suspending/resuming itself. Add helper routines,
pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
that call pmf_device_suspend(dev, PMF_F_SELF) and
pmf_device_resume(dev, PMF_F_SELF), respectively. Use
PMF_F_SELF to suspend/resume self in ath(4), audio(4),
rtw(4), and sip(4).
In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
callbacks, provided by the bus front-end, with
self-suspension/resumption. Also, clean up the bus
front-ends. Make sure that the interrupt handler is
disestablished during suspension. Get rid of driver-private
flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
device_is_active()/device_has_power() calls, instead.
In the network-class suspend handler, call if_stop(, 0)
instead of if_stop(, 1), because the latter is superfluous
(bus- and driver-suspension hooks will 'disable' the NIC),
and it may cause recursion.
In the network-class resume handler, prevent infinite
recursion through if_init() by getting out early if we are
self-suspending (PMF_F_SELF).
rtw(4) improvements:
Destroy rtw(4) callouts when we detach it. Make rtw at
pci detachable. Print some more information with the "rx
frame too long" warning.
Remove activate() methods:
Get rid of rtw_activate() and ath_activate(). The device
activate() methods are not good for much these days.
Make ath at cardbus resume with crypto functions intact:
Introduce a boolean device property, "pmf-powerdown". If
pmf-powerdown is present and false, it indicates that a
bus back-end should not remove power from a device.
Honor this property in cardbus_child_suspend().
Set this property to 'false' in ath_attach(), since removing
power from an ath at cardbus seems to lobotomize the WPA
crypto engine. XXX Should the pmf-powerdown property
propagate toward the root of the device tree?
Miscellaneous ath(4) changes:
Warn if ath(4) tries to write crypto keys to suspended
hardware.
Reduce differences between FreeBSD and NetBSD in ath(4)
multicast filter setup.
Make ath_printrxbuf() print an rx descriptor's status &
key index, to help debug crypto errors.
Shorten a staircase in ath_ioctl(). Don't check for
ieee80211_ioctl() return code ERESTART, it never happens.
2008-03-12 21:02:21 +03:00
|
|
|
/* $NetBSD: audio.c,v 1.237 2008/03/12 18:02:21 dyoung Exp $ */
|
1995-02-21 04:35:58 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 1991-1993 Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the Computer Systems
|
|
|
|
* Engineering Group at Lawrence Berkeley Laboratory.
|
|
|
|
* 4. Neither the name of the University nor of the Laboratory may be used
|
|
|
|
* to endorse or promote products derived from this software without
|
|
|
|
* specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is a (partially) SunOS-compatible /dev/audio driver for NetBSD.
|
2002-03-23 20:17:10 +03:00
|
|
|
*
|
1995-02-21 04:35:58 +03:00
|
|
|
* This code tries to do something half-way sensible with
|
|
|
|
* half-duplex hardware, such as with the SoundBlaster hardware. With
|
|
|
|
* half-duplex hardware allowing O_RDWR access doesn't really make
|
|
|
|
* sense. However, closing and opening the device to "turn around the
|
|
|
|
* line" is relatively expensive and costs a card reset (which can
|
|
|
|
* take some time, at least for the SoundBlaster hardware). Instead
|
|
|
|
* we allow O_RDWR access, and provide an ioctl to set the "mode",
|
|
|
|
* i.e. playing or recording.
|
|
|
|
*
|
|
|
|
* If you write to a half-duplex device in record mode, the data is
|
|
|
|
* tossed. If you read from the device in play mode, you get silence
|
|
|
|
* filled buffers at the rate at which samples are naturally
|
|
|
|
* generated.
|
|
|
|
*
|
|
|
|
* If you try to set both play and record mode on a half-duplex
|
|
|
|
* device, playing takes precedence.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Todo:
|
2002-03-23 20:17:10 +03:00
|
|
|
* - Add softaudio() isr processing for wakeup, poll, signals,
|
1997-08-11 05:38:12 +04:00
|
|
|
* and silence fill.
|
1995-02-21 04:35:58 +03:00
|
|
|
*/
|
|
|
|
|
2001-11-13 08:32:49 +03:00
|
|
|
#include <sys/cdefs.h>
|
Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.
Add a 'flags' argument to suspend/resume handlers and
callers such as pmf_system_suspend().
Define a flag, PMF_F_SELF, which indicates to PMF that a
device is suspending/resuming itself. Add helper routines,
pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
that call pmf_device_suspend(dev, PMF_F_SELF) and
pmf_device_resume(dev, PMF_F_SELF), respectively. Use
PMF_F_SELF to suspend/resume self in ath(4), audio(4),
rtw(4), and sip(4).
In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
callbacks, provided by the bus front-end, with
self-suspension/resumption. Also, clean up the bus
front-ends. Make sure that the interrupt handler is
disestablished during suspension. Get rid of driver-private
flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
device_is_active()/device_has_power() calls, instead.
In the network-class suspend handler, call if_stop(, 0)
instead of if_stop(, 1), because the latter is superfluous
(bus- and driver-suspension hooks will 'disable' the NIC),
and it may cause recursion.
In the network-class resume handler, prevent infinite
recursion through if_init() by getting out early if we are
self-suspending (PMF_F_SELF).
rtw(4) improvements:
Destroy rtw(4) callouts when we detach it. Make rtw at
pci detachable. Print some more information with the "rx
frame too long" warning.
Remove activate() methods:
Get rid of rtw_activate() and ath_activate(). The device
activate() methods are not good for much these days.
Make ath at cardbus resume with crypto functions intact:
Introduce a boolean device property, "pmf-powerdown". If
pmf-powerdown is present and false, it indicates that a
bus back-end should not remove power from a device.
Honor this property in cardbus_child_suspend().
Set this property to 'false' in ath_attach(), since removing
power from an ath at cardbus seems to lobotomize the WPA
crypto engine. XXX Should the pmf-powerdown property
propagate toward the root of the device tree?
Miscellaneous ath(4) changes:
Warn if ath(4) tries to write crypto keys to suspended
hardware.
Reduce differences between FreeBSD and NetBSD in ath(4)
multicast filter setup.
Make ath_printrxbuf() print an rx descriptor's status &
key index, to help debug crypto errors.
Shorten a staircase in ath_ioctl(). Don't check for
ieee80211_ioctl() return code ERESTART, it never happens.
2008-03-12 21:02:21 +03:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.237 2008/03/12 18:02:21 dyoung Exp $");
|
2001-11-13 08:32:49 +03:00
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
#include "audio.h"
|
|
|
|
#if NAUDIO > 0
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/fcntl.h>
|
|
|
|
#include <sys/vnode.h>
|
|
|
|
#include <sys/select.h>
|
1996-09-07 16:40:22 +04:00
|
|
|
#include <sys/poll.h>
|
1995-02-21 04:35:58 +03:00
|
|
|
#include <sys/malloc.h>
|
|
|
|
#include <sys/proc.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/syslog.h>
|
1995-07-07 05:52:30 +04:00
|
|
|
#include <sys/kernel.h>
|
1996-03-14 22:05:07 +03:00
|
|
|
#include <sys/signalvar.h>
|
1996-03-31 01:51:23 +03:00
|
|
|
#include <sys/conf.h>
|
1995-02-21 04:35:58 +03:00
|
|
|
#include <sys/audioio.h>
|
1997-08-01 02:33:08 +04:00
|
|
|
#include <sys/device.h>
|
2007-10-08 20:18:02 +04:00
|
|
|
#include <sys/intr.h>
|
1996-05-13 05:01:55 +04:00
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
#include <dev/audio_if.h>
|
1997-04-30 01:01:33 +04:00
|
|
|
#include <dev/audiovar.h>
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-05-07 22:51:31 +04:00
|
|
|
#include <machine/endian.h>
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
/* #define AUDIO_DEBUG 1 */
|
1995-07-07 05:52:30 +04:00
|
|
|
#ifdef AUDIO_DEBUG
|
1997-07-27 05:16:32 +04:00
|
|
|
#define DPRINTF(x) if (audiodebug) printf x
|
1998-04-28 13:07:12 +04:00
|
|
|
#define DPRINTFN(n,x) if (audiodebug>(n)) printf x
|
2002-03-07 17:37:02 +03:00
|
|
|
int audiodebug = AUDIO_DEBUG;
|
1995-02-21 04:35:58 +03:00
|
|
|
#else
|
|
|
|
#define DPRINTF(x)
|
1998-04-28 13:07:12 +04:00
|
|
|
#define DPRINTFN(n,x)
|
1995-02-21 04:35:58 +03:00
|
|
|
#endif
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
#define ROUNDSIZE(x) x &= -16 /* round to nice boundary */
|
|
|
|
#define SPECIFIED(x) (x != ~0)
|
|
|
|
#define SPECIFIED_CH(x) (x != (u_char)~0)
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2008-02-13 21:31:51 +03:00
|
|
|
/* #define AUDIO_PM_IDLE */
|
|
|
|
#ifdef AUDIO_PM_IDLE
|
2007-12-09 23:27:42 +03:00
|
|
|
int audio_idle_timeout = 30;
|
2008-02-13 21:31:51 +03:00
|
|
|
#endif
|
|
|
|
|
1997-05-28 03:24:56 +04:00
|
|
|
int audio_blk_ms = AUDIO_BLK_MS;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2001-10-03 03:31:54 +04:00
|
|
|
int audiosetinfo(struct audio_softc *, struct audio_info *);
|
2007-06-11 17:05:46 +04:00
|
|
|
int audiogetinfo(struct audio_softc *, struct audio_info *, int);
|
2001-10-03 03:31:54 +04:00
|
|
|
|
2005-12-11 15:16:03 +03:00
|
|
|
int audio_open(dev_t, struct audio_softc *, int, int, struct lwp *);
|
|
|
|
int audio_close(struct audio_softc *, int, int, struct lwp *);
|
2001-10-03 03:31:54 +04:00
|
|
|
int audio_read(struct audio_softc *, struct uio *, int);
|
|
|
|
int audio_write(struct audio_softc *, struct uio *, int);
|
2007-03-04 08:59:00 +03:00
|
|
|
int audio_ioctl(struct audio_softc *, u_long, void *, int, struct lwp *);
|
2005-12-11 15:16:03 +03:00
|
|
|
int audio_poll(struct audio_softc *, int, struct lwp *);
|
2002-10-23 13:10:23 +04:00
|
|
|
int audio_kqfilter(struct audio_softc *, struct knote *);
|
2001-10-03 03:31:54 +04:00
|
|
|
paddr_t audio_mmap(struct audio_softc *, off_t, int);
|
|
|
|
|
2005-12-11 15:16:03 +03:00
|
|
|
int mixer_open(dev_t, struct audio_softc *, int, int, struct lwp *);
|
|
|
|
int mixer_close(struct audio_softc *, int, int, struct lwp *);
|
2007-03-04 08:59:00 +03:00
|
|
|
int mixer_ioctl(struct audio_softc *, u_long, void *, int, struct lwp *);
|
2005-12-11 15:16:03 +03:00
|
|
|
static void mixer_remove(struct audio_softc *, struct lwp *);
|
2001-10-03 03:31:54 +04:00
|
|
|
static void mixer_signal(struct audio_softc *);
|
2002-03-23 20:17:10 +03:00
|
|
|
|
2001-10-03 03:31:54 +04:00
|
|
|
void audio_init_record(struct audio_softc *);
|
|
|
|
void audio_init_play(struct audio_softc *);
|
|
|
|
int audiostartr(struct audio_softc *);
|
|
|
|
int audiostartp(struct audio_softc *);
|
|
|
|
void audio_rint(void *);
|
|
|
|
void audio_pint(void *);
|
|
|
|
int audio_check_params(struct audio_params *);
|
|
|
|
|
|
|
|
void audio_calc_blksize(struct audio_softc *, int);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
void audio_fill_silence(struct audio_params *, uint8_t *, int);
|
2001-10-03 03:31:54 +04:00
|
|
|
int audio_silence_copyout(struct audio_softc *, int, struct uio *);
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
void audio_init_ringbuffer(struct audio_softc *,
|
|
|
|
struct audio_ringbuffer *, int);
|
2001-10-03 03:31:54 +04:00
|
|
|
int audio_initbufs(struct audio_softc *);
|
|
|
|
void audio_calcwater(struct audio_softc *);
|
2005-12-24 23:27:29 +03:00
|
|
|
static inline int audio_sleep_timo(int *, const char *, int);
|
|
|
|
static inline int audio_sleep(int *, const char *);
|
|
|
|
static inline void audio_wakeup(int *);
|
2001-10-03 03:31:54 +04:00
|
|
|
int audio_drain(struct audio_softc *);
|
|
|
|
void audio_clear(struct audio_softc *);
|
2005-12-24 23:27:29 +03:00
|
|
|
static inline void audio_pint_silence
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
(struct audio_softc *, struct audio_ringbuffer *, uint8_t *, int);
|
1997-07-27 05:16:32 +04:00
|
|
|
|
2002-03-23 20:17:10 +03:00
|
|
|
int audio_alloc_ring
|
2001-10-03 03:31:54 +04:00
|
|
|
(struct audio_softc *, struct audio_ringbuffer *, int, size_t);
|
|
|
|
void audio_free_ring(struct audio_softc *, struct audio_ringbuffer *);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
static int audio_setup_pfilters(struct audio_softc *, const audio_params_t *,
|
|
|
|
stream_filter_list_t *);
|
|
|
|
static int audio_setup_rfilters(struct audio_softc *, const audio_params_t *,
|
|
|
|
stream_filter_list_t *);
|
|
|
|
static void audio_destruct_pfilters(struct audio_softc *);
|
|
|
|
static void audio_destruct_rfilters(struct audio_softc *);
|
|
|
|
static void audio_stream_dtor(audio_stream_t *);
|
|
|
|
static int audio_stream_ctor(audio_stream_t *, const audio_params_t *, int);
|
|
|
|
static void stream_filter_list_append
|
2006-04-18 23:15:27 +04:00
|
|
|
(stream_filter_list_t *, stream_filter_factory_t,
|
|
|
|
const audio_params_t *);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
static void stream_filter_list_prepend
|
2006-04-18 23:15:27 +04:00
|
|
|
(stream_filter_list_t *, stream_filter_factory_t,
|
|
|
|
const audio_params_t *);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
static void stream_filter_list_set
|
|
|
|
(stream_filter_list_t *, int, stream_filter_factory_t,
|
|
|
|
const audio_params_t *);
|
2003-10-02 11:15:20 +04:00
|
|
|
int audio_set_defaults(struct audio_softc *, u_int);
|
1996-03-07 18:00:07 +03:00
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
int audioprobe(device_t, cfdata_t, void *);
|
|
|
|
void audioattach(device_t, device_t, void *);
|
|
|
|
int audiodetach(device_t, int);
|
|
|
|
int audioactivate(device_t, enum devact);
|
1997-08-20 03:49:33 +04:00
|
|
|
|
2008-02-13 21:31:51 +03:00
|
|
|
#ifdef AUDIO_PM_IDLE
|
2007-12-09 23:27:42 +03:00
|
|
|
static void audio_idle(void *);
|
|
|
|
static void audio_activity(device_t, devactive_t);
|
2008-02-13 21:31:51 +03:00
|
|
|
#endif
|
2007-12-09 23:27:42 +03:00
|
|
|
|
Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.
Add a 'flags' argument to suspend/resume handlers and
callers such as pmf_system_suspend().
Define a flag, PMF_F_SELF, which indicates to PMF that a
device is suspending/resuming itself. Add helper routines,
pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
that call pmf_device_suspend(dev, PMF_F_SELF) and
pmf_device_resume(dev, PMF_F_SELF), respectively. Use
PMF_F_SELF to suspend/resume self in ath(4), audio(4),
rtw(4), and sip(4).
In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
callbacks, provided by the bus front-end, with
self-suspension/resumption. Also, clean up the bus
front-ends. Make sure that the interrupt handler is
disestablished during suspension. Get rid of driver-private
flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
device_is_active()/device_has_power() calls, instead.
In the network-class suspend handler, call if_stop(, 0)
instead of if_stop(, 1), because the latter is superfluous
(bus- and driver-suspension hooks will 'disable' the NIC),
and it may cause recursion.
In the network-class resume handler, prevent infinite
recursion through if_init() by getting out early if we are
self-suspending (PMF_F_SELF).
rtw(4) improvements:
Destroy rtw(4) callouts when we detach it. Make rtw at
pci detachable. Print some more information with the "rx
frame too long" warning.
Remove activate() methods:
Get rid of rtw_activate() and ath_activate(). The device
activate() methods are not good for much these days.
Make ath at cardbus resume with crypto functions intact:
Introduce a boolean device property, "pmf-powerdown". If
pmf-powerdown is present and false, it indicates that a
bus back-end should not remove power from a device.
Honor this property in cardbus_child_suspend().
Set this property to 'false' in ath_attach(), since removing
power from an ath at cardbus seems to lobotomize the WPA
crypto engine. XXX Should the pmf-powerdown property
propagate toward the root of the device tree?
Miscellaneous ath(4) changes:
Warn if ath(4) tries to write crypto keys to suspended
hardware.
Reduce differences between FreeBSD and NetBSD in ath(4)
multicast filter setup.
Make ath_printrxbuf() print an rx descriptor's status &
key index, to help debug crypto errors.
Shorten a staircase in ath_ioctl(). Don't check for
ieee80211_ioctl() return code ERESTART, it never happens.
2008-03-12 21:02:21 +03:00
|
|
|
static bool audio_suspend(device_t dv PMF_FN_PROTO);
|
|
|
|
static bool audio_resume(device_t dv PMF_FN_PROTO);
|
2007-12-09 23:27:42 +03:00
|
|
|
static void audio_volume_down(device_t);
|
|
|
|
static void audio_volume_up(device_t);
|
|
|
|
static void audio_volume_toggle(device_t);
|
|
|
|
|
|
|
|
static void audio_mixer_capture(struct audio_softc *);
|
|
|
|
static void audio_mixer_restore(struct audio_softc *);
|
2006-06-19 14:19:08 +04:00
|
|
|
|
2007-02-10 00:55:00 +03:00
|
|
|
static void audio_softintr_rd(void *);
|
|
|
|
static void audio_softintr_wr(void *);
|
|
|
|
|
1997-10-19 11:41:33 +04:00
|
|
|
struct portname {
|
2005-01-15 19:23:03 +03:00
|
|
|
const char *name;
|
|
|
|
int mask;
|
1997-10-19 11:41:33 +04:00
|
|
|
};
|
2003-03-31 22:47:58 +04:00
|
|
|
static const struct portname itable[] = {
|
1997-10-19 11:41:33 +04:00
|
|
|
{ AudioNmicrophone, AUDIO_MICROPHONE },
|
|
|
|
{ AudioNline, AUDIO_LINE_IN },
|
|
|
|
{ AudioNcd, AUDIO_CD },
|
2006-08-28 03:54:50 +04:00
|
|
|
{ 0, 0 }
|
1997-10-19 11:41:33 +04:00
|
|
|
};
|
2003-03-31 22:47:58 +04:00
|
|
|
static const struct portname otable[] = {
|
1997-10-19 11:41:33 +04:00
|
|
|
{ AudioNspeaker, AUDIO_SPEAKER },
|
|
|
|
{ AudioNheadphone, AUDIO_HEADPHONE },
|
|
|
|
{ AudioNline, AUDIO_LINE_OUT },
|
2006-08-28 03:54:50 +04:00
|
|
|
{ 0, 0 }
|
1997-10-19 11:41:33 +04:00
|
|
|
};
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
void au_setup_ports(struct audio_softc *, struct au_mixer_ports *,
|
|
|
|
mixer_devinfo_t *, const struct portname *);
|
2002-03-23 20:17:10 +03:00
|
|
|
int au_set_gain(struct audio_softc *, struct au_mixer_ports *,
|
2005-01-15 19:23:03 +03:00
|
|
|
int, int);
|
2001-10-03 03:31:54 +04:00
|
|
|
void au_get_gain(struct audio_softc *, struct au_mixer_ports *,
|
2005-01-15 19:23:03 +03:00
|
|
|
u_int *, u_char *);
|
2001-10-03 03:31:54 +04:00
|
|
|
int au_set_port(struct audio_softc *, struct au_mixer_ports *,
|
2005-01-15 19:23:03 +03:00
|
|
|
u_int);
|
2001-10-03 03:31:54 +04:00
|
|
|
int au_get_port(struct audio_softc *, struct au_mixer_ports *);
|
|
|
|
int au_get_lr_value(struct audio_softc *, mixer_ctrl_t *,
|
2005-01-15 19:23:03 +03:00
|
|
|
int *, int *);
|
2001-10-03 03:31:54 +04:00
|
|
|
int au_set_lr_value(struct audio_softc *, mixer_ctrl_t *,
|
2005-01-15 19:23:03 +03:00
|
|
|
int, int);
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
int au_portof(struct audio_softc *, char *, int);
|
1997-10-19 11:41:33 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
typedef struct uio_fetcher {
|
|
|
|
stream_fetcher_t base;
|
|
|
|
struct uio *uio;
|
|
|
|
int usedhigh;
|
|
|
|
int last_used;
|
|
|
|
} uio_fetcher_t;
|
|
|
|
|
|
|
|
static void uio_fetcher_ctor(uio_fetcher_t *, struct uio *, int);
|
|
|
|
static int uio_fetcher_fetch_to(stream_fetcher_t *,
|
|
|
|
audio_stream_t *, int);
|
|
|
|
static int null_fetcher_fetch_to(stream_fetcher_t *,
|
|
|
|
audio_stream_t *, int);
|
|
|
|
|
2002-09-06 17:18:43 +04:00
|
|
|
dev_type_open(audioopen);
|
|
|
|
dev_type_close(audioclose);
|
|
|
|
dev_type_read(audioread);
|
|
|
|
dev_type_write(audiowrite);
|
|
|
|
dev_type_ioctl(audioioctl);
|
|
|
|
dev_type_poll(audiopoll);
|
|
|
|
dev_type_mmap(audiommap);
|
2002-10-23 13:10:23 +04:00
|
|
|
dev_type_kqfilter(audiokqfilter);
|
2002-09-06 17:18:43 +04:00
|
|
|
|
|
|
|
const struct cdevsw audio_cdevsw = {
|
|
|
|
audioopen, audioclose, audioread, audiowrite, audioioctl,
|
2006-08-28 03:54:50 +04:00
|
|
|
nostop, notty, audiopoll, audiommap, audiokqfilter, D_OTHER
|
2002-09-06 17:18:43 +04:00
|
|
|
};
|
1997-10-19 11:41:33 +04:00
|
|
|
|
2003-04-06 22:20:07 +04:00
|
|
|
/* The default audio mode: 8 kHz mono mu-law */
|
2003-10-02 11:15:20 +04:00
|
|
|
const struct audio_params audio_default = {
|
|
|
|
.sample_rate = 8000,
|
|
|
|
.encoding = AUDIO_ENCODING_ULAW,
|
|
|
|
.precision = 8,
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
.validbits = 8,
|
2003-10-02 11:15:20 +04:00
|
|
|
.channels = 1,
|
|
|
|
};
|
1997-04-30 01:01:33 +04:00
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
CFATTACH_DECL_NEW(audio, sizeof(struct audio_softc),
|
2002-10-02 20:33:28 +04:00
|
|
|
audioprobe, audioattach, audiodetach, audioactivate);
|
1997-07-27 05:16:32 +04:00
|
|
|
|
1998-01-12 11:44:08 +03:00
|
|
|
extern struct cfdriver audio_cd;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
|
|
|
int
|
2008-03-04 21:23:44 +03:00
|
|
|
audioprobe(device_t parent, cfdata_t match, void *aux)
|
1997-07-27 05:16:32 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_attach_args *sa;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
sa = aux;
|
2002-03-23 20:17:10 +03:00
|
|
|
DPRINTF(("audioprobe: type=%d sa=%p hw=%p\n",
|
|
|
|
sa->type, sa, sa->hwif));
|
1997-10-29 05:00:20 +03:00
|
|
|
return (sa->type == AUDIODEV_TYPE_AUDIO) ? 1 : 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1997-08-20 03:49:33 +04:00
|
|
|
void
|
2008-03-04 21:23:44 +03:00
|
|
|
audioattach(device_t parent, device_t self, void *aux)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
|
|
|
struct audio_attach_args *sa;
|
|
|
|
const struct audio_hw_if *hwp;
|
|
|
|
void *hdlp;
|
1997-07-27 05:16:32 +04:00
|
|
|
int error;
|
1997-10-19 11:41:33 +04:00
|
|
|
mixer_devinfo_t mi;
|
2005-02-14 02:53:20 +03:00
|
|
|
int iclass, mclass, oclass, rclass, props;
|
|
|
|
int record_master_found, record_source_found;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
sc = device_private(self);
|
|
|
|
sc->dev = self;
|
2005-01-15 19:23:03 +03:00
|
|
|
sa = aux;
|
|
|
|
hwp = sa->hwif;
|
|
|
|
hdlp = sa->hdl;
|
1997-07-27 05:16:32 +04:00
|
|
|
#ifdef DIAGNOSTIC
|
|
|
|
if (hwp == 0 ||
|
1997-04-30 01:01:33 +04:00
|
|
|
hwp->query_encoding == 0 ||
|
1997-05-10 02:16:27 +04:00
|
|
|
hwp->set_params == 0 ||
|
1998-08-10 00:28:07 +04:00
|
|
|
(hwp->start_output == 0 && hwp->trigger_output == 0) ||
|
|
|
|
(hwp->start_input == 0 && hwp->trigger_input == 0) ||
|
1995-02-21 04:35:58 +03:00
|
|
|
hwp->halt_output == 0 ||
|
|
|
|
hwp->halt_input == 0 ||
|
|
|
|
hwp->getdev == 0 ||
|
|
|
|
hwp->set_port == 0 ||
|
|
|
|
hwp->get_port == 0 ||
|
1997-08-01 02:33:08 +04:00
|
|
|
hwp->query_devinfo == 0 ||
|
|
|
|
hwp->get_props == 0) {
|
1999-09-23 15:53:13 +04:00
|
|
|
printf(": missing method\n");
|
1997-08-20 03:49:33 +04:00
|
|
|
sc->hw_if = 0;
|
|
|
|
return;
|
2002-03-23 20:17:10 +03:00
|
|
|
}
|
1997-07-27 05:16:32 +04:00
|
|
|
#endif
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1999-12-15 15:09:34 +03:00
|
|
|
props = hwp->get_props(hdlp);
|
|
|
|
|
2007-12-01 07:50:50 +03:00
|
|
|
aprint_naive("\n");
|
|
|
|
|
1999-12-15 15:09:34 +03:00
|
|
|
if (props & AUDIO_PROP_FULLDUPLEX)
|
2007-12-01 07:50:50 +03:00
|
|
|
aprint_normal(": full duplex");
|
1999-02-19 20:09:16 +03:00
|
|
|
else
|
2007-12-01 07:50:50 +03:00
|
|
|
aprint_normal(": half duplex");
|
1999-12-15 15:09:34 +03:00
|
|
|
|
|
|
|
if (props & AUDIO_PROP_MMAP)
|
2007-12-01 07:50:50 +03:00
|
|
|
aprint_normal(", mmap");
|
1999-12-15 15:09:34 +03:00
|
|
|
if (props & AUDIO_PROP_INDEPENDENT)
|
2007-12-01 07:50:50 +03:00
|
|
|
aprint_normal(", independent");
|
1999-12-15 15:09:34 +03:00
|
|
|
|
2007-12-01 07:50:50 +03:00
|
|
|
aprint_normal("\n");
|
1999-12-15 15:09:34 +03:00
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
sc->hw_if = hwp;
|
|
|
|
sc->hw_hdl = hdlp;
|
1997-08-20 03:49:33 +04:00
|
|
|
sc->sc_dev = parent;
|
2006-03-07 18:17:47 +03:00
|
|
|
sc->sc_opencnt = 0;
|
2006-04-19 18:10:58 +04:00
|
|
|
sc->sc_writing = sc->sc_waitcomp = 0;
|
2007-12-13 17:02:53 +03:00
|
|
|
sc->sc_lastinfovalid = false;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1999-02-17 05:37:38 +03:00
|
|
|
error = audio_alloc_ring(sc, &sc->sc_pr, AUMODE_PLAY, AU_RING_SIZE);
|
1997-08-20 03:49:33 +04:00
|
|
|
if (error) {
|
2005-01-15 19:23:03 +03:00
|
|
|
sc->hw_if = NULL;
|
2007-12-01 07:50:50 +03:00
|
|
|
aprint_error("audio: could not allocate play buffer\n");
|
1997-08-20 03:49:33 +04:00
|
|
|
return;
|
|
|
|
}
|
1999-02-17 05:37:38 +03:00
|
|
|
error = audio_alloc_ring(sc, &sc->sc_rr, AUMODE_RECORD, AU_RING_SIZE);
|
1997-07-27 05:16:32 +04:00
|
|
|
if (error) {
|
|
|
|
audio_free_ring(sc, &sc->sc_pr);
|
2005-01-15 19:23:03 +03:00
|
|
|
sc->hw_if = NULL;
|
2007-12-01 07:50:50 +03:00
|
|
|
aprint_error("audio: could not allocate record buffer\n");
|
1997-08-20 03:49:33 +04:00
|
|
|
return;
|
1997-07-27 05:16:32 +04:00
|
|
|
}
|
2002-03-07 17:37:02 +03:00
|
|
|
|
2007-12-09 23:27:42 +03:00
|
|
|
sc->sc_lastgain = 128;
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if ((error = audio_set_defaults(sc, 0))) {
|
2007-12-01 07:50:50 +03:00
|
|
|
aprint_error("audioattach: audio_set_defaults() failed\n");
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
sc->hw_if = NULL;
|
|
|
|
return;
|
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
|
2007-10-08 20:18:02 +04:00
|
|
|
sc->sc_sih_rd = softint_establish(SOFTINT_SERIAL,
|
2007-02-10 00:55:00 +03:00
|
|
|
audio_softintr_rd, sc);
|
2007-10-08 20:18:02 +04:00
|
|
|
sc->sc_sih_wr = softint_establish(SOFTINT_SERIAL,
|
2007-02-10 00:55:00 +03:00
|
|
|
audio_softintr_wr, sc);
|
|
|
|
|
2005-02-14 02:53:20 +03:00
|
|
|
iclass = mclass = oclass = rclass = -1;
|
1997-10-19 11:41:33 +04:00
|
|
|
sc->sc_inports.index = -1;
|
2002-06-23 05:36:07 +04:00
|
|
|
sc->sc_inports.master = -1;
|
1997-10-19 11:41:33 +04:00
|
|
|
sc->sc_inports.nports = 0;
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_inports.isenum = false;
|
1997-10-19 11:41:33 +04:00
|
|
|
sc->sc_inports.allports = 0;
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_inports.isdual = false;
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
sc->sc_inports.mixerout = -1;
|
|
|
|
sc->sc_inports.cur_port = -1;
|
1997-10-19 11:41:33 +04:00
|
|
|
sc->sc_outports.index = -1;
|
2002-06-23 05:36:07 +04:00
|
|
|
sc->sc_outports.master = -1;
|
1997-10-19 11:41:33 +04:00
|
|
|
sc->sc_outports.nports = 0;
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_outports.isenum = false;
|
1997-10-19 11:41:33 +04:00
|
|
|
sc->sc_outports.allports = 0;
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_outports.isdual = false;
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
sc->sc_outports.mixerout = -1;
|
|
|
|
sc->sc_outports.cur_port = -1;
|
1997-10-19 11:41:33 +04:00
|
|
|
sc->sc_monitor_port = -1;
|
2005-02-14 02:50:22 +03:00
|
|
|
/*
|
|
|
|
* Read through the underlying driver's list, picking out the class
|
|
|
|
* names from the mixer descriptions. We'll need them to decode the
|
|
|
|
* mixer descriptions on the next pass through the loop.
|
|
|
|
*/
|
1997-10-19 11:41:33 +04:00
|
|
|
for(mi.index = 0; ; mi.index++) {
|
|
|
|
if (hwp->query_devinfo(hdlp, &mi) != 0)
|
|
|
|
break;
|
2005-02-14 02:53:20 +03:00
|
|
|
/*
|
|
|
|
* The type of AUDIO_MIXER_CLASS merely introduces a class.
|
|
|
|
* All the other types describe an actual mixer.
|
|
|
|
*/
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
if (mi.type == AUDIO_MIXER_CLASS) {
|
2005-02-14 02:53:20 +03:00
|
|
|
if (strcmp(mi.label.name, AudioCinputs) == 0)
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
iclass = mi.mixer_class;
|
|
|
|
if (strcmp(mi.label.name, AudioCmonitor) == 0)
|
|
|
|
mclass = mi.mixer_class;
|
|
|
|
if (strcmp(mi.label.name, AudioCoutputs) == 0)
|
|
|
|
oclass = mi.mixer_class;
|
2005-02-14 02:53:20 +03:00
|
|
|
if (strcmp(mi.label.name, AudioCrecord) == 0)
|
|
|
|
rclass = mi.mixer_class;
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
}
|
2005-02-14 02:50:22 +03:00
|
|
|
/*
|
|
|
|
* This is where we assign each control in the "audio" model, to the
|
|
|
|
* underlying "mixer" control. We walk through the whole list once,
|
|
|
|
* assigning likely candidates as we come across them.
|
|
|
|
*/
|
2005-02-14 02:53:20 +03:00
|
|
|
record_master_found = 0;
|
|
|
|
record_source_found = 0;
|
1997-10-19 11:41:33 +04:00
|
|
|
for(mi.index = 0; ; mi.index++) {
|
|
|
|
if (hwp->query_devinfo(hdlp, &mi) != 0)
|
|
|
|
break;
|
1998-11-25 16:44:13 +03:00
|
|
|
if (mi.type == AUDIO_MIXER_CLASS)
|
|
|
|
continue;
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
if (mi.mixer_class == iclass) {
|
2005-02-14 02:53:20 +03:00
|
|
|
/*
|
|
|
|
* AudioCinputs is only a fallback, when we don't
|
|
|
|
* find what we're looking for in AudioCrecord, so
|
|
|
|
* check the flags before accepting one of these.
|
|
|
|
*/
|
|
|
|
if (strcmp(mi.label.name, AudioNmaster) == 0
|
|
|
|
&& record_master_found == 0)
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
sc->sc_inports.master = mi.index;
|
2005-02-14 02:53:20 +03:00
|
|
|
if (strcmp(mi.label.name, AudioNsource) == 0
|
|
|
|
&& record_source_found == 0) {
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
if (mi.type == AUDIO_MIXER_ENUM) {
|
|
|
|
int i;
|
|
|
|
for(i = 0; i < mi.un.e.num_mem; i++)
|
|
|
|
if (strcmp(mi.un.e.member[i].label.name,
|
|
|
|
AudioNmixerout) == 0)
|
|
|
|
sc->sc_inports.mixerout =
|
|
|
|
mi.un.e.member[i].ord;
|
|
|
|
}
|
|
|
|
au_setup_ports(sc, &sc->sc_inports, &mi,
|
|
|
|
itable);
|
|
|
|
}
|
2007-12-09 23:27:42 +03:00
|
|
|
if (strcmp(mi.label.name, AudioNdac) == 0 &&
|
|
|
|
sc->sc_outports.master == -1)
|
|
|
|
sc->sc_outports.master = mi.index;
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
} else if (mi.mixer_class == mclass) {
|
|
|
|
if (strcmp(mi.label.name, AudioNmonitor) == 0)
|
|
|
|
sc->sc_monitor_port = mi.index;
|
|
|
|
} else if (mi.mixer_class == oclass) {
|
|
|
|
if (strcmp(mi.label.name, AudioNmaster) == 0)
|
|
|
|
sc->sc_outports.master = mi.index;
|
|
|
|
if (strcmp(mi.label.name, AudioNselect) == 0)
|
|
|
|
au_setup_ports(sc, &sc->sc_outports, &mi,
|
|
|
|
otable);
|
2005-02-14 02:53:20 +03:00
|
|
|
} else if (mi.mixer_class == rclass) {
|
|
|
|
/*
|
|
|
|
* These are the preferred mixers for the audio record
|
|
|
|
* controls, so set the flags here, but don't check.
|
|
|
|
*/
|
|
|
|
if (strcmp(mi.label.name, AudioNmaster) == 0) {
|
|
|
|
sc->sc_inports.master = mi.index;
|
|
|
|
record_master_found = 1;
|
|
|
|
}
|
|
|
|
#if 1 /* Deprecated. Use AudioNmaster. */
|
|
|
|
if (strcmp(mi.label.name, AudioNrecord) == 0) {
|
|
|
|
sc->sc_inports.master = mi.index;
|
|
|
|
record_master_found = 1;
|
|
|
|
}
|
|
|
|
if (strcmp(mi.label.name, AudioNvolume) == 0) {
|
|
|
|
sc->sc_inports.master = mi.index;
|
|
|
|
record_master_found = 1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if (strcmp(mi.label.name, AudioNsource) == 0) {
|
|
|
|
if (mi.type == AUDIO_MIXER_ENUM) {
|
|
|
|
int i;
|
|
|
|
for(i = 0; i < mi.un.e.num_mem; i++)
|
|
|
|
if (strcmp(mi.un.e.member[i].label.name,
|
|
|
|
AudioNmixerout) == 0)
|
|
|
|
sc->sc_inports.mixerout =
|
|
|
|
mi.un.e.member[i].ord;
|
|
|
|
}
|
|
|
|
au_setup_ports(sc, &sc->sc_inports, &mi,
|
|
|
|
itable);
|
|
|
|
record_source_found = 1;
|
|
|
|
}
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
}
|
2000-05-01 21:10:40 +04:00
|
|
|
DPRINTF(("audio_attach: inputs ports=0x%x, input master=%d, "
|
|
|
|
"output ports=0x%x, output master=%d\n",
|
|
|
|
sc->sc_inports.allports, sc->sc_inports.master,
|
|
|
|
sc->sc_outports.allports, sc->sc_outports.master));
|
2006-06-19 14:19:08 +04:00
|
|
|
|
2008-03-01 17:16:49 +03:00
|
|
|
selinit(&sc->sc_rsel);
|
|
|
|
selinit(&sc->sc_wsel);
|
|
|
|
|
2008-02-13 21:31:51 +03:00
|
|
|
#ifdef AUDIO_PM_IDLE
|
2007-12-09 23:27:42 +03:00
|
|
|
callout_init(&sc->sc_idle_counter, 0);
|
|
|
|
callout_setfunc(&sc->sc_idle_counter, audio_idle, self);
|
2008-02-13 21:31:51 +03:00
|
|
|
#endif
|
2007-12-09 23:27:42 +03:00
|
|
|
|
|
|
|
if (!pmf_device_register(self, audio_suspend, audio_resume))
|
|
|
|
aprint_error_dev(self, "couldn't establish power handler\n");
|
2008-02-13 21:31:51 +03:00
|
|
|
#ifdef AUDIO_PM_IDLE
|
2007-12-09 23:27:42 +03:00
|
|
|
if (!device_active_register(self, audio_activity))
|
|
|
|
aprint_error_dev(self, "couldn't register activity handler\n");
|
2008-02-13 21:31:51 +03:00
|
|
|
#endif
|
2007-12-09 23:27:42 +03:00
|
|
|
|
|
|
|
if (!pmf_event_register(self, PMFE_AUDIO_VOLUME_DOWN,
|
|
|
|
audio_volume_down, true))
|
|
|
|
aprint_error_dev(self, "couldn't add volume down handler\n");
|
|
|
|
if (!pmf_event_register(self, PMFE_AUDIO_VOLUME_UP,
|
|
|
|
audio_volume_up, true))
|
|
|
|
aprint_error_dev(self, "couldn't add volume up handler\n");
|
|
|
|
if (!pmf_event_register(self, PMFE_AUDIO_VOLUME_TOGGLE,
|
|
|
|
audio_volume_toggle, true))
|
|
|
|
aprint_error_dev(self, "couldn't add volume toggle handler\n");
|
|
|
|
|
2008-02-13 21:31:51 +03:00
|
|
|
#ifdef AUDIO_PM_IDLE
|
2007-12-09 23:27:42 +03:00
|
|
|
callout_schedule(&sc->sc_idle_counter, audio_idle_timeout * hz);
|
2008-02-13 21:31:51 +03:00
|
|
|
#endif
|
1997-10-19 11:41:33 +04:00
|
|
|
}
|
|
|
|
|
1999-09-09 14:24:39 +04:00
|
|
|
int
|
2008-03-04 21:23:44 +03:00
|
|
|
audioactivate(device_t self, enum devact act)
|
1999-09-09 14:24:39 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
1999-09-09 14:24:39 +04:00
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
sc = device_private(self);
|
1999-09-09 14:24:39 +04:00
|
|
|
switch (act) {
|
|
|
|
case DVACT_ACTIVATE:
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EOPNOTSUPP;
|
1999-09-09 14:24:39 +04:00
|
|
|
|
|
|
|
case DVACT_DEACTIVATE:
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_dying = true;
|
1999-09-09 14:24:39 +04:00
|
|
|
break;
|
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
1999-09-09 14:24:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2008-03-04 21:23:44 +03:00
|
|
|
audiodetach(device_t self, int flags)
|
1999-09-09 14:24:39 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
1999-09-09 14:24:39 +04:00
|
|
|
int maj, mn;
|
|
|
|
int s;
|
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
sc = device_private(self);
|
1999-09-09 14:24:39 +04:00
|
|
|
DPRINTF(("audio_detach: sc=%p flags=%d\n", sc, flags));
|
|
|
|
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_dying = true;
|
1999-09-09 14:24:39 +04:00
|
|
|
|
2007-12-09 23:27:42 +03:00
|
|
|
pmf_event_deregister(self, PMFE_AUDIO_VOLUME_DOWN,
|
|
|
|
audio_volume_down, true);
|
|
|
|
pmf_event_deregister(self, PMFE_AUDIO_VOLUME_UP,
|
|
|
|
audio_volume_up, true);
|
|
|
|
pmf_event_deregister(self, PMFE_AUDIO_VOLUME_TOGGLE,
|
|
|
|
audio_volume_toggle, true);
|
|
|
|
|
2008-02-13 21:31:51 +03:00
|
|
|
#ifdef AUDIO_PM_IDLE
|
2007-12-09 23:27:42 +03:00
|
|
|
callout_stop(&sc->sc_idle_counter);
|
|
|
|
|
2007-12-23 22:14:03 +03:00
|
|
|
device_active_deregister(self, audio_activity);
|
2008-02-13 21:31:51 +03:00
|
|
|
#endif
|
2007-12-23 22:14:03 +03:00
|
|
|
|
2007-12-09 23:27:42 +03:00
|
|
|
pmf_device_deregister(self);
|
|
|
|
|
1999-09-09 14:24:39 +04:00
|
|
|
wakeup(&sc->sc_wchan);
|
|
|
|
wakeup(&sc->sc_rchan);
|
|
|
|
s = splaudio();
|
|
|
|
if (--sc->sc_refcnt >= 0) {
|
|
|
|
if (tsleep(&sc->sc_refcnt, PZERO, "auddet", hz * 120))
|
|
|
|
printf("audiodetach: %s didn't detach\n",
|
2008-03-04 21:23:44 +03:00
|
|
|
device_xname(sc->dev));
|
1999-09-09 14:24:39 +04:00
|
|
|
}
|
|
|
|
splx(s);
|
|
|
|
|
|
|
|
/* free resources */
|
|
|
|
audio_free_ring(sc, &sc->sc_pr);
|
|
|
|
audio_free_ring(sc, &sc->sc_rr);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_destruct_pfilters(sc);
|
|
|
|
audio_destruct_rfilters(sc);
|
1999-09-09 14:24:39 +04:00
|
|
|
|
|
|
|
/* locate the major number */
|
2002-09-06 17:18:43 +04:00
|
|
|
maj = cdevsw_lookup_major(&audio_cdevsw);
|
1999-09-09 14:24:39 +04:00
|
|
|
|
|
|
|
/* Nuke the vnodes for any open instances (calls close). */
|
2006-03-28 21:38:24 +04:00
|
|
|
mn = device_unit(self);
|
1999-11-09 19:50:47 +03:00
|
|
|
vdevgone(maj, mn | SOUND_DEVICE, mn | SOUND_DEVICE, VCHR);
|
|
|
|
vdevgone(maj, mn | AUDIO_DEVICE, mn | AUDIO_DEVICE, VCHR);
|
|
|
|
vdevgone(maj, mn | AUDIOCTL_DEVICE, mn | AUDIOCTL_DEVICE, VCHR);
|
|
|
|
vdevgone(maj, mn | MIXER_DEVICE, mn | MIXER_DEVICE, VCHR);
|
1999-09-09 14:24:39 +04:00
|
|
|
|
2007-02-10 00:55:00 +03:00
|
|
|
if (sc->sc_sih_rd) {
|
2007-10-08 20:18:02 +04:00
|
|
|
softint_disestablish(sc->sc_sih_rd);
|
2007-02-10 00:55:00 +03:00
|
|
|
sc->sc_sih_rd = NULL;
|
|
|
|
}
|
|
|
|
if (sc->sc_sih_wr) {
|
2007-10-08 20:18:02 +04:00
|
|
|
softint_disestablish(sc->sc_sih_wr);
|
2007-02-10 00:55:00 +03:00
|
|
|
sc->sc_sih_wr = NULL;
|
|
|
|
}
|
2006-06-19 14:19:08 +04:00
|
|
|
|
2008-02-13 21:31:51 +03:00
|
|
|
#ifdef AUDIO_PM_IDLE
|
2007-12-09 23:27:42 +03:00
|
|
|
callout_destroy(&sc->sc_idle_counter);
|
2008-02-13 21:31:51 +03:00
|
|
|
#endif
|
2008-03-01 17:16:49 +03:00
|
|
|
seldestroy(&sc->sc_rsel);
|
|
|
|
seldestroy(&sc->sc_wsel);
|
2007-12-09 23:27:42 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
1999-09-09 14:24:39 +04:00
|
|
|
}
|
|
|
|
|
1997-10-19 11:41:33 +04:00
|
|
|
int
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
au_portof(struct audio_softc *sc, char *name, int class)
|
1997-10-19 11:41:33 +04:00
|
|
|
{
|
|
|
|
mixer_devinfo_t mi;
|
|
|
|
|
2002-03-23 20:17:10 +03:00
|
|
|
for(mi.index = 0;
|
1997-10-19 11:41:33 +04:00
|
|
|
sc->hw_if->query_devinfo(sc->hw_hdl, &mi) == 0;
|
|
|
|
mi.index++)
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
if (mi.mixer_class == class && strcmp(mi.label.name, name) == 0)
|
1997-10-19 11:41:33 +04:00
|
|
|
return mi.index;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
au_setup_ports(struct audio_softc *sc, struct au_mixer_ports *ports,
|
|
|
|
mixer_devinfo_t *mi, const struct portname *tbl)
|
1997-10-19 11:41:33 +04:00
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
ports->index = mi->index;
|
1997-10-19 11:41:33 +04:00
|
|
|
if (mi->type == AUDIO_MIXER_ENUM) {
|
2007-03-01 20:31:35 +03:00
|
|
|
ports->isenum = true;
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
for(i = 0; tbl[i].name; i++)
|
|
|
|
for(j = 0; j < mi->un.e.num_mem; j++)
|
|
|
|
if (strcmp(mi->un.e.member[j].label.name,
|
|
|
|
tbl[i].name) == 0) {
|
|
|
|
ports->allports |= tbl[i].mask;
|
|
|
|
ports->aumask[ports->nports] = tbl[i].mask;
|
|
|
|
ports->misel[ports->nports] =
|
|
|
|
mi->un.e.member[j].ord;
|
|
|
|
ports->miport[ports->nports] =
|
|
|
|
au_portof(sc, mi->un.e.member[j].label.name,
|
|
|
|
mi->mixer_class);
|
|
|
|
if (ports->mixerout != -1 &&
|
2007-08-15 01:34:03 +04:00
|
|
|
ports->miport[ports->nports] != -1)
|
2007-03-01 20:31:35 +03:00
|
|
|
ports->isdual = true;
|
2007-08-15 01:34:03 +04:00
|
|
|
++ports->nports;
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
} else if (mi->type == AUDIO_MIXER_SET) {
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
for(i = 0; tbl[i].name; i++)
|
|
|
|
for(j = 0; j < mi->un.s.num_mem; j++)
|
|
|
|
if (strcmp(mi->un.s.member[j].label.name,
|
|
|
|
tbl[i].name) == 0) {
|
|
|
|
ports->allports |= tbl[i].mask;
|
|
|
|
ports->aumask[ports->nports] = tbl[i].mask;
|
|
|
|
ports->misel[ports->nports] =
|
|
|
|
mi->un.s.member[j].mask;
|
2007-08-15 01:34:03 +04:00
|
|
|
ports->miport[ports->nports] =
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
au_portof(sc, mi->un.s.member[j].label.name,
|
|
|
|
mi->mixer_class);
|
2007-08-15 01:34:03 +04:00
|
|
|
++ports->nports;
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1997-08-20 03:49:33 +04:00
|
|
|
/*
|
|
|
|
* Called from hardware driver. This is where the MI audio driver gets
|
1997-09-06 05:14:48 +04:00
|
|
|
* probed/attached to the hardware driver.
|
1997-08-20 03:49:33 +04:00
|
|
|
*/
|
2008-03-04 21:23:44 +03:00
|
|
|
device_t
|
|
|
|
audio_attach_mi(const struct audio_hw_if *ahwp, void *hdlp, device_t dev)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
1997-08-20 03:49:33 +04:00
|
|
|
struct audio_attach_args arg;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1998-08-18 01:16:09 +04:00
|
|
|
#ifdef DIAGNOSTIC
|
|
|
|
if (ahwp == NULL) {
|
2003-01-31 05:15:57 +03:00
|
|
|
aprint_error("audio_attach_mi: NULL\n");
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
1997-10-29 05:00:20 +03:00
|
|
|
}
|
1998-08-18 01:16:09 +04:00
|
|
|
#endif
|
|
|
|
arg.type = AUDIODEV_TYPE_AUDIO;
|
|
|
|
arg.hwif = ahwp;
|
|
|
|
arg.hdl = hdlp;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return config_found(dev, &arg, audioprint);
|
1997-10-29 05:00:20 +03:00
|
|
|
}
|
|
|
|
|
1997-08-20 03:49:33 +04:00
|
|
|
#ifdef AUDIO_DEBUG
|
2001-10-03 03:31:54 +04:00
|
|
|
void audio_printsc(struct audio_softc *);
|
2005-01-15 19:23:03 +03:00
|
|
|
void audio_print_params(const char *, struct audio_params *);
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-08-20 03:49:33 +04:00
|
|
|
void
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_printsc(struct audio_softc *sc)
|
1997-08-20 03:49:33 +04:00
|
|
|
{
|
|
|
|
printf("hwhandle %p hw_if %p ", sc->hw_hdl, sc->hw_if);
|
|
|
|
printf("open 0x%x mode 0x%x\n", sc->sc_open, sc->sc_mode);
|
|
|
|
printf("rchan 0x%x wchan 0x%x ", sc->sc_rchan, sc->sc_wchan);
|
2002-03-23 20:17:10 +03:00
|
|
|
printf("rring used 0x%x pring used=%d\n",
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_stream_get_used(&sc->sc_rr.s),
|
|
|
|
audio_stream_get_used(&sc->sc_pr.s));
|
1997-08-20 03:49:33 +04:00
|
|
|
printf("rbus 0x%x pbus 0x%x ", sc->sc_rbus, sc->sc_pbus);
|
|
|
|
printf("blksize %d", sc->sc_pr.blksize);
|
|
|
|
printf("hiwat %d lowat %d\n", sc->sc_pr.usedhigh, sc->sc_pr.usedlow);
|
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-08-20 03:49:33 +04:00
|
|
|
void
|
2005-01-15 19:23:03 +03:00
|
|
|
audio_print_params(const char *s, struct audio_params *p)
|
1997-08-20 03:49:33 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
printf("%s enc=%u %uch %u/%ubit %uHz\n", s, p->encoding, p->channels,
|
|
|
|
p->validbits, p->precision, p->sample_rate);
|
1997-08-20 03:49:33 +04:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int
|
2002-03-23 20:17:10 +03:00
|
|
|
audio_alloc_ring(struct audio_softc *sc, struct audio_ringbuffer *r,
|
2001-10-03 03:31:54 +04:00
|
|
|
int direction, size_t bufsize)
|
1997-08-20 03:49:33 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
const struct audio_hw_if *hw;
|
|
|
|
void *hdl;
|
|
|
|
|
|
|
|
hw = sc->hw_if;
|
|
|
|
hdl = sc->hw_hdl;
|
1997-08-20 03:49:33 +04:00
|
|
|
/*
|
|
|
|
* Alloc DMA play and record buffers
|
|
|
|
*/
|
|
|
|
if (bufsize < AUMINBUF)
|
|
|
|
bufsize = AUMINBUF;
|
1999-02-17 05:37:38 +03:00
|
|
|
ROUNDSIZE(bufsize);
|
1997-08-20 03:49:33 +04:00
|
|
|
if (hw->round_buffersize)
|
1999-02-17 05:37:38 +03:00
|
|
|
bufsize = hw->round_buffersize(hdl, direction, bufsize);
|
1998-03-03 12:16:15 +03:00
|
|
|
if (hw->allocm)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
r->s.start = hw->allocm(hdl, direction, bufsize,
|
|
|
|
M_DEVBUF, M_WAITOK);
|
1997-08-20 03:49:33 +04:00
|
|
|
else
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
r->s.start = malloc(bufsize, M_DEVBUF, M_WAITOK);
|
|
|
|
if (r->s.start == 0)
|
1997-08-20 03:49:33 +04:00
|
|
|
return ENOMEM;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
r->s.bufsize = bufsize;
|
1997-08-20 03:49:33 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_free_ring(struct audio_softc *sc, struct audio_ringbuffer *r)
|
1997-08-20 03:49:33 +04:00
|
|
|
{
|
1999-02-17 05:37:38 +03:00
|
|
|
|
|
|
|
if (sc->hw_if->freem)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
sc->hw_if->freem(sc->hw_hdl, r->s.start, M_DEVBUF);
|
1999-02-17 05:37:38 +03:00
|
|
|
else
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
free(r->s.start, M_DEVBUF);
|
|
|
|
r->s.start = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
audio_setup_pfilters(struct audio_softc *sc, const audio_params_t *pp,
|
|
|
|
stream_filter_list_t *pfilters)
|
|
|
|
{
|
|
|
|
stream_filter_t *pf[AUDIO_MAX_FILTERS];
|
|
|
|
audio_stream_t ps[AUDIO_MAX_FILTERS];
|
|
|
|
const audio_params_t *from_param;
|
|
|
|
audio_params_t *to_param;
|
|
|
|
int i, n;
|
|
|
|
|
2006-04-19 18:10:58 +04:00
|
|
|
while (sc->sc_writing) {
|
|
|
|
sc->sc_waitcomp = 1;
|
|
|
|
(void)tsleep(sc, 0, "audioch", 10*hz);
|
|
|
|
}
|
2006-04-18 23:15:27 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
memset(pf, 0, sizeof(pf));
|
|
|
|
memset(ps, 0, sizeof(ps));
|
|
|
|
from_param = pp;
|
|
|
|
for (i = 0; i < pfilters->req_size; i++) {
|
|
|
|
n = pfilters->req_size - i - 1;
|
|
|
|
to_param = &pfilters->filters[n].param;
|
|
|
|
audio_check_params(to_param);
|
|
|
|
pf[i] = pfilters->filters[n].factory(sc, from_param, to_param);
|
|
|
|
if (pf[i] == NULL)
|
|
|
|
break;
|
|
|
|
if (audio_stream_ctor(&ps[i], from_param, AU_RING_SIZE))
|
|
|
|
break;
|
|
|
|
if (i > 0)
|
|
|
|
pf[i]->set_fetcher(pf[i], &pf[i - 1]->base);
|
|
|
|
from_param = to_param;
|
|
|
|
}
|
|
|
|
if (i < pfilters->req_size) { /* failure */
|
|
|
|
DPRINTF(("%s: pfilters failure\n", __func__));
|
|
|
|
for (; i >= 0; i--) {
|
|
|
|
if (pf[i] != NULL)
|
|
|
|
pf[i]->dtor(pf[i]);
|
|
|
|
audio_stream_dtor(&ps[i]);
|
|
|
|
}
|
2006-04-19 18:10:58 +04:00
|
|
|
sc->sc_waitcomp = 0;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
audio_destruct_pfilters(sc);
|
|
|
|
memcpy(sc->sc_pfilters, pf, sizeof(pf));
|
|
|
|
memcpy(sc->sc_pstreams, ps, sizeof(ps));
|
|
|
|
sc->sc_npfilters = pfilters->req_size;
|
|
|
|
for (i = 0; i < pfilters->req_size; i++) {
|
|
|
|
pf[i]->set_inputbuffer(pf[i], &sc->sc_pstreams[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* hardware format and the buffer near to userland */
|
|
|
|
if (pfilters->req_size <= 0) {
|
|
|
|
sc->sc_pr.s.param = *pp;
|
|
|
|
sc->sc_pustream = &sc->sc_pr.s;
|
|
|
|
} else {
|
|
|
|
sc->sc_pr.s.param = pfilters->filters[0].param;
|
|
|
|
sc->sc_pustream = &sc->sc_pstreams[0];
|
|
|
|
}
|
|
|
|
#ifdef AUDIO_DEBUG
|
|
|
|
printf("%s: HW-buffer=%p pustream=%p\n",
|
|
|
|
__func__, &sc->sc_pr.s, sc->sc_pustream);
|
|
|
|
for (i = 0; i < pfilters->req_size; i++) {
|
|
|
|
char num[100];
|
|
|
|
snprintf(num, 100, "[%d]", i);
|
|
|
|
audio_print_params(num, &sc->sc_pstreams[i].param);
|
|
|
|
}
|
|
|
|
audio_print_params("[HW]", &sc->sc_pr.s.param);
|
|
|
|
#endif /* AUDIO_DEBUG */
|
2006-04-18 23:15:27 +04:00
|
|
|
|
2006-04-19 18:10:58 +04:00
|
|
|
sc->sc_waitcomp = 0;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
audio_setup_rfilters(struct audio_softc *sc, const audio_params_t *rp,
|
|
|
|
stream_filter_list_t *rfilters)
|
|
|
|
{
|
|
|
|
stream_filter_t *rf[AUDIO_MAX_FILTERS];
|
|
|
|
audio_stream_t rs[AUDIO_MAX_FILTERS];
|
|
|
|
const audio_params_t *to_param;
|
|
|
|
audio_params_t *from_param;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
memset(rf, 0, sizeof(rf));
|
|
|
|
memset(rs, 0, sizeof(rs));
|
|
|
|
for (i = 0; i < rfilters->req_size; i++) {
|
|
|
|
from_param = &rfilters->filters[i].param;
|
|
|
|
audio_check_params(from_param);
|
|
|
|
to_param = i + 1 < rfilters->req_size
|
|
|
|
? &rfilters->filters[i + 1].param : rp;
|
|
|
|
rf[i] = rfilters->filters[i].factory(sc, from_param, to_param);
|
|
|
|
if (rf[i] == NULL)
|
|
|
|
break;
|
|
|
|
if (audio_stream_ctor(&rs[i], to_param, AU_RING_SIZE))
|
|
|
|
break;
|
|
|
|
if (i > 0) {
|
|
|
|
rf[i]->set_fetcher(rf[i], &rf[i - 1]->base);
|
|
|
|
} else {
|
|
|
|
/* rf[0] has no previous fetcher because
|
|
|
|
* the audio hardware fills data to the
|
|
|
|
* input buffer. */
|
|
|
|
rf[0]->set_inputbuffer(rf[0], &sc->sc_rr.s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i < rfilters->req_size) { /* failure */
|
|
|
|
DPRINTF(("%s: rfilters failure\n", __func__));
|
|
|
|
for (; i >= 0; i--) {
|
|
|
|
if (rf[i] != NULL)
|
|
|
|
rf[i]->dtor(rf[i]);
|
|
|
|
audio_stream_dtor(&rs[i]);
|
|
|
|
}
|
|
|
|
return EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
audio_destruct_rfilters(sc);
|
|
|
|
memcpy(sc->sc_rfilters, rf, sizeof(rf));
|
|
|
|
memcpy(sc->sc_rstreams, rs, sizeof(rs));
|
|
|
|
sc->sc_nrfilters = rfilters->req_size;
|
|
|
|
for (i = 1; i < rfilters->req_size; i++) {
|
|
|
|
rf[i]->set_inputbuffer(rf[i], &sc->sc_rstreams[i - 1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* hardware format and the buffer near to userland */
|
|
|
|
if (rfilters->req_size <= 0) {
|
|
|
|
sc->sc_rr.s.param = *rp;
|
|
|
|
sc->sc_rustream = &sc->sc_rr.s;
|
|
|
|
} else {
|
|
|
|
sc->sc_rr.s.param = rfilters->filters[0].param;
|
|
|
|
sc->sc_rustream = &sc->sc_rstreams[rfilters->req_size - 1];
|
|
|
|
}
|
|
|
|
#ifdef AUDIO_DEBUG
|
|
|
|
printf("%s: HW-buffer=%p pustream=%p\n",
|
|
|
|
__func__, &sc->sc_rr.s, sc->sc_rustream);
|
|
|
|
audio_print_params("[HW]", &sc->sc_rr.s.param);
|
|
|
|
for (i = 0; i < rfilters->req_size; i++) {
|
|
|
|
char num[100];
|
|
|
|
snprintf(num, 100, "[%d]", i);
|
|
|
|
audio_print_params(num, &sc->sc_rstreams[i].param);
|
|
|
|
}
|
|
|
|
#endif /* AUDIO_DEBUG */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
audio_destruct_pfilters(struct audio_softc *sc)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < sc->sc_npfilters; i++) {
|
|
|
|
sc->sc_pfilters[i]->dtor(sc->sc_pfilters[i]);
|
|
|
|
sc->sc_pfilters[i] = NULL;
|
|
|
|
audio_stream_dtor(&sc->sc_pstreams[i]);
|
|
|
|
}
|
|
|
|
sc->sc_npfilters = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
audio_destruct_rfilters(struct audio_softc *sc)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < sc->sc_nrfilters; i++) {
|
|
|
|
sc->sc_rfilters[i]->dtor(sc->sc_rfilters[i]);
|
|
|
|
sc->sc_rfilters[i] = NULL;
|
|
|
|
audio_stream_dtor(&sc->sc_rstreams[i]);
|
|
|
|
}
|
|
|
|
sc->sc_nrfilters = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
audio_stream_dtor(audio_stream_t *stream)
|
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (stream->start != NULL)
|
|
|
|
free(stream->start, M_DEVBUF);
|
|
|
|
memset(stream, 0, sizeof(audio_stream_t));
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
audio_stream_ctor(audio_stream_t *stream, const audio_params_t *param, int size)
|
|
|
|
{
|
|
|
|
int frame_size;
|
|
|
|
|
|
|
|
size = min(size, AU_RING_SIZE);
|
|
|
|
stream->bufsize = size;
|
2007-12-22 21:34:56 +03:00
|
|
|
stream->start = malloc(size, M_DEVBUF, M_NOWAIT);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (stream->start == NULL)
|
|
|
|
return ENOMEM;
|
2005-01-17 17:13:19 +03:00
|
|
|
frame_size = (param->precision + 7) / 8 * param->channels;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
size = (size / frame_size) * frame_size;
|
|
|
|
stream->end = stream->start + size;
|
|
|
|
stream->inp = stream->start;
|
|
|
|
stream->outp = stream->start;
|
|
|
|
stream->used = 0;
|
|
|
|
stream->param = *param;
|
2007-03-01 20:31:35 +03:00
|
|
|
stream->loop = false;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
stream_filter_list_append(stream_filter_list_t *list,
|
|
|
|
stream_filter_factory_t factory,
|
|
|
|
const audio_params_t *param)
|
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (list->req_size >= AUDIO_MAX_FILTERS) {
|
|
|
|
printf("%s: increase AUDIO_MAX_FILTERS in sys/dev/audio_if.h\n",
|
|
|
|
__func__);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
list->filters[list->req_size].factory = factory;
|
|
|
|
list->filters[list->req_size].param = *param;
|
|
|
|
list->req_size++;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
stream_filter_list_set(stream_filter_list_t *list, int i,
|
|
|
|
stream_filter_factory_t factory,
|
|
|
|
const audio_params_t *param)
|
|
|
|
{
|
2006-04-18 23:15:27 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (i < 0 || i >= AUDIO_MAX_FILTERS) {
|
|
|
|
printf("%s: invalid index: %d\n", __func__, i);
|
|
|
|
return;
|
|
|
|
}
|
2006-04-18 23:15:27 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
list->filters[i].factory = factory;
|
|
|
|
list->filters[i].param = *param;
|
|
|
|
if (list->req_size <= i)
|
|
|
|
list->req_size = i + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
stream_filter_list_prepend(stream_filter_list_t *list,
|
|
|
|
stream_filter_factory_t factory,
|
|
|
|
const audio_params_t *param)
|
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (list->req_size >= AUDIO_MAX_FILTERS) {
|
|
|
|
printf("%s: increase AUDIO_MAX_FILTERS in sys/dev/audio_if.h\n",
|
|
|
|
__func__);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
memmove(&list->filters[1], &list->filters[0],
|
|
|
|
sizeof(struct stream_filter_req) * list->req_size);
|
|
|
|
list->filters[0].factory = factory;
|
|
|
|
list->filters[0].param = *param;
|
|
|
|
list->req_size++;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-12-11 15:16:03 +03:00
|
|
|
audioopen(dev_t dev, int flags, int ifmt, struct lwp *l)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
1999-09-09 14:24:39 +04:00
|
|
|
struct audio_softc *sc;
|
|
|
|
int error;
|
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
sc = device_private(device_lookup(&audio_cd, AUDIOUNIT(dev)));
|
2000-07-06 04:43:04 +04:00
|
|
|
if (sc == NULL)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return ENXIO;
|
1999-09-09 14:24:39 +04:00
|
|
|
|
|
|
|
if (sc->sc_dying)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EIO;
|
1996-09-02 01:33:43 +04:00
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
device_active(sc->dev, DVA_SYSTEM);
|
2007-12-09 23:27:42 +03:00
|
|
|
|
2006-03-07 18:17:47 +03:00
|
|
|
sc->sc_opencnt++;
|
|
|
|
|
1999-09-09 14:24:39 +04:00
|
|
|
sc->sc_refcnt++;
|
1996-09-02 01:33:43 +04:00
|
|
|
switch (AUDIODEV(dev)) {
|
1995-02-21 04:35:58 +03:00
|
|
|
case SOUND_DEVICE:
|
|
|
|
case AUDIO_DEVICE:
|
2005-12-11 15:16:03 +03:00
|
|
|
error = audio_open(dev, sc, flags, ifmt, l);
|
1999-09-09 14:24:39 +04:00
|
|
|
break;
|
1997-08-19 01:19:02 +04:00
|
|
|
case AUDIOCTL_DEVICE:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = 0;
|
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
case MIXER_DEVICE:
|
2005-12-11 15:16:03 +03:00
|
|
|
error = mixer_open(dev, sc, flags, ifmt, l);
|
1999-09-09 14:24:39 +04:00
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
default:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = ENXIO;
|
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1999-09-09 14:24:39 +04:00
|
|
|
if (--sc->sc_refcnt < 0)
|
|
|
|
wakeup(&sc->sc_refcnt);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-12-11 15:16:03 +03:00
|
|
|
audioclose(dev_t dev, int flags, int ifmt, struct lwp *l)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
1999-09-09 14:24:39 +04:00
|
|
|
int error;
|
1996-09-02 01:33:43 +04:00
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
sc = device_private(device_lookup(&audio_cd, AUDIOUNIT(dev)));
|
2007-12-09 23:27:42 +03:00
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
device_active(sc->dev, DVA_SYSTEM);
|
2007-12-09 23:27:42 +03:00
|
|
|
|
1996-09-02 01:33:43 +04:00
|
|
|
switch (AUDIODEV(dev)) {
|
1995-02-21 04:35:58 +03:00
|
|
|
case SOUND_DEVICE:
|
|
|
|
case AUDIO_DEVICE:
|
2005-12-11 15:16:03 +03:00
|
|
|
error = audio_close(sc, flags, ifmt, l);
|
1999-09-09 14:24:39 +04:00
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
case MIXER_DEVICE:
|
2005-12-11 15:16:03 +03:00
|
|
|
error = mixer_close(sc, flags, ifmt, l);
|
1999-09-09 14:24:39 +04:00
|
|
|
break;
|
1997-08-19 01:19:02 +04:00
|
|
|
case AUDIOCTL_DEVICE:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = 0;
|
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
default:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = ENXIO;
|
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
2006-03-07 18:17:47 +03:00
|
|
|
|
|
|
|
sc->sc_opencnt--;
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audioread(dev_t dev, struct uio *uio, int ioflag)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
1999-09-09 14:24:39 +04:00
|
|
|
struct audio_softc *sc;
|
|
|
|
int error;
|
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
sc = device_private(device_lookup(&audio_cd, AUDIOUNIT(dev)));
|
2000-07-06 04:43:04 +04:00
|
|
|
if (sc == NULL)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return ENXIO;
|
1996-09-02 01:33:43 +04:00
|
|
|
|
1999-09-09 14:24:39 +04:00
|
|
|
if (sc->sc_dying)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EIO;
|
1999-09-09 14:24:39 +04:00
|
|
|
|
|
|
|
sc->sc_refcnt++;
|
1996-09-02 01:33:43 +04:00
|
|
|
switch (AUDIODEV(dev)) {
|
1995-02-21 04:35:58 +03:00
|
|
|
case SOUND_DEVICE:
|
|
|
|
case AUDIO_DEVICE:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = audio_read(sc, uio, ioflag);
|
|
|
|
break;
|
1997-08-19 01:19:02 +04:00
|
|
|
case AUDIOCTL_DEVICE:
|
1995-02-21 04:35:58 +03:00
|
|
|
case MIXER_DEVICE:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = ENODEV;
|
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
default:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = ENXIO;
|
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1999-09-09 14:24:39 +04:00
|
|
|
if (--sc->sc_refcnt < 0)
|
|
|
|
wakeup(&sc->sc_refcnt);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audiowrite(dev_t dev, struct uio *uio, int ioflag)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
1999-09-09 14:24:39 +04:00
|
|
|
struct audio_softc *sc;
|
|
|
|
int error;
|
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
sc = device_private(device_lookup(&audio_cd, AUDIOUNIT(dev)));
|
2000-07-06 04:43:04 +04:00
|
|
|
if (sc == NULL)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return ENXIO;
|
1996-09-02 01:33:43 +04:00
|
|
|
|
1999-09-09 14:24:39 +04:00
|
|
|
if (sc->sc_dying)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EIO;
|
1999-09-09 14:24:39 +04:00
|
|
|
|
|
|
|
sc->sc_refcnt++;
|
1996-09-02 01:33:43 +04:00
|
|
|
switch (AUDIODEV(dev)) {
|
1995-02-21 04:35:58 +03:00
|
|
|
case SOUND_DEVICE:
|
|
|
|
case AUDIO_DEVICE:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = audio_write(sc, uio, ioflag);
|
|
|
|
break;
|
1997-08-19 01:19:02 +04:00
|
|
|
case AUDIOCTL_DEVICE:
|
1995-02-21 04:35:58 +03:00
|
|
|
case MIXER_DEVICE:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = ENODEV;
|
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
default:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = ENXIO;
|
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1999-09-09 14:24:39 +04:00
|
|
|
if (--sc->sc_refcnt < 0)
|
|
|
|
wakeup(&sc->sc_refcnt);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-03-04 08:59:00 +03:00
|
|
|
audioioctl(dev_t dev, u_long cmd, void *addr, int flag, struct lwp *l)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
1999-09-09 14:24:39 +04:00
|
|
|
int error;
|
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
sc = device_private(device_lookup(&audio_cd, AUDIOUNIT(dev)));
|
1999-09-09 14:24:39 +04:00
|
|
|
if (sc->sc_dying)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EIO;
|
1996-09-02 01:33:43 +04:00
|
|
|
|
1999-09-09 14:24:39 +04:00
|
|
|
sc->sc_refcnt++;
|
1996-09-02 01:33:43 +04:00
|
|
|
switch (AUDIODEV(dev)) {
|
1995-02-21 04:35:58 +03:00
|
|
|
case SOUND_DEVICE:
|
|
|
|
case AUDIO_DEVICE:
|
1997-08-19 01:19:02 +04:00
|
|
|
case AUDIOCTL_DEVICE:
|
2008-03-04 21:23:44 +03:00
|
|
|
device_active(sc->dev, DVA_SYSTEM);
|
2005-12-11 15:16:03 +03:00
|
|
|
error = audio_ioctl(sc, cmd, addr, flag, l);
|
1999-09-09 14:24:39 +04:00
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
case MIXER_DEVICE:
|
2005-12-11 15:16:03 +03:00
|
|
|
error = mixer_ioctl(sc, cmd, addr, flag, l);
|
1999-09-09 14:24:39 +04:00
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
default:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = ENXIO;
|
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1999-09-09 14:24:39 +04:00
|
|
|
if (--sc->sc_refcnt < 0)
|
|
|
|
wakeup(&sc->sc_refcnt);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-12-11 15:16:03 +03:00
|
|
|
audiopoll(dev_t dev, int events, struct lwp *l)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
2005-06-21 18:01:11 +04:00
|
|
|
int revents;
|
1999-09-09 14:24:39 +04:00
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
sc = device_private(device_lookup(&audio_cd, AUDIOUNIT(dev)));
|
1999-09-09 14:24:39 +04:00
|
|
|
if (sc->sc_dying)
|
2005-06-21 18:01:11 +04:00
|
|
|
return POLLHUP;
|
1996-09-02 01:33:43 +04:00
|
|
|
|
1999-09-09 14:24:39 +04:00
|
|
|
sc->sc_refcnt++;
|
1996-09-02 01:33:43 +04:00
|
|
|
switch (AUDIODEV(dev)) {
|
1995-02-21 04:35:58 +03:00
|
|
|
case SOUND_DEVICE:
|
|
|
|
case AUDIO_DEVICE:
|
2005-12-11 15:16:03 +03:00
|
|
|
revents = audio_poll(sc, events, l);
|
1999-09-09 14:24:39 +04:00
|
|
|
break;
|
1997-08-19 01:19:02 +04:00
|
|
|
case AUDIOCTL_DEVICE:
|
1995-02-21 04:35:58 +03:00
|
|
|
case MIXER_DEVICE:
|
2005-06-21 18:01:11 +04:00
|
|
|
revents = 0;
|
1999-09-09 14:24:39 +04:00
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
default:
|
2005-06-21 18:01:11 +04:00
|
|
|
revents = POLLERR;
|
1999-09-09 14:24:39 +04:00
|
|
|
break;
|
1996-09-02 01:33:43 +04:00
|
|
|
}
|
1999-09-09 14:24:39 +04:00
|
|
|
if (--sc->sc_refcnt < 0)
|
|
|
|
wakeup(&sc->sc_refcnt);
|
2005-06-21 18:01:11 +04:00
|
|
|
return revents;
|
1996-09-02 01:33:43 +04:00
|
|
|
}
|
|
|
|
|
2002-10-23 13:10:23 +04:00
|
|
|
int
|
|
|
|
audiokqfilter(dev_t dev, struct knote *kn)
|
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
2002-10-23 13:10:23 +04:00
|
|
|
int rv;
|
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
sc = audio_cd.cd_devs[AUDIOUNIT(dev)];
|
2002-10-23 13:10:23 +04:00
|
|
|
if (sc->sc_dying)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 1;
|
2002-10-23 13:10:23 +04:00
|
|
|
|
|
|
|
sc->sc_refcnt++;
|
|
|
|
switch (AUDIODEV(dev)) {
|
|
|
|
case SOUND_DEVICE:
|
|
|
|
case AUDIO_DEVICE:
|
|
|
|
rv = audio_kqfilter(sc, kn);
|
|
|
|
break;
|
|
|
|
case AUDIOCTL_DEVICE:
|
|
|
|
case MIXER_DEVICE:
|
|
|
|
rv = 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
rv = 1;
|
|
|
|
}
|
|
|
|
if (--sc->sc_refcnt < 0)
|
|
|
|
wakeup(&sc->sc_refcnt);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return rv;
|
2002-10-23 13:10:23 +04:00
|
|
|
}
|
|
|
|
|
2000-06-26 08:55:19 +04:00
|
|
|
paddr_t
|
2001-10-03 03:31:54 +04:00
|
|
|
audiommap(dev_t dev, off_t off, int prot)
|
1996-09-02 01:33:43 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
2000-06-26 08:55:19 +04:00
|
|
|
paddr_t error;
|
1999-09-09 14:24:39 +04:00
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
sc = device_private(device_lookup(&audio_cd, AUDIOUNIT(dev)));
|
1999-09-09 14:24:39 +04:00
|
|
|
if (sc->sc_dying)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return -1;
|
1996-09-02 01:33:43 +04:00
|
|
|
|
2008-03-04 21:23:44 +03:00
|
|
|
device_active(sc->dev, DVA_SYSTEM); /* XXXJDM */
|
2007-12-09 23:27:42 +03:00
|
|
|
|
1999-09-09 14:24:39 +04:00
|
|
|
sc->sc_refcnt++;
|
1996-09-02 01:33:43 +04:00
|
|
|
switch (AUDIODEV(dev)) {
|
|
|
|
case SOUND_DEVICE:
|
|
|
|
case AUDIO_DEVICE:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = audio_mmap(sc, off, prot);
|
|
|
|
break;
|
1997-08-19 01:19:02 +04:00
|
|
|
case AUDIOCTL_DEVICE:
|
1996-09-02 01:33:43 +04:00
|
|
|
case MIXER_DEVICE:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = -1;
|
|
|
|
break;
|
1996-09-02 01:33:43 +04:00
|
|
|
default:
|
1999-09-09 14:24:39 +04:00
|
|
|
error = -1;
|
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1999-09-09 14:24:39 +04:00
|
|
|
if (--sc->sc_refcnt < 0)
|
|
|
|
wakeup(&sc->sc_refcnt);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Audio driver
|
|
|
|
*/
|
1995-04-18 03:04:31 +04:00
|
|
|
void
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_init_ringbuffer(struct audio_softc *sc, struct audio_ringbuffer *rp,
|
|
|
|
int mode)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
1997-07-27 05:16:32 +04:00
|
|
|
int nblks;
|
2005-01-15 19:23:03 +03:00
|
|
|
int blksize;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
blksize = rp->blksize;
|
1997-07-28 03:06:04 +04:00
|
|
|
if (blksize < AUMINBLK)
|
|
|
|
blksize = AUMINBLK;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (blksize > rp->s.bufsize / AUMINNOBLK)
|
|
|
|
blksize = rp->s.bufsize / AUMINNOBLK;
|
2003-10-02 11:15:20 +04:00
|
|
|
ROUNDSIZE(blksize);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
DPRINTF(("audio_init_ringbuffer: MI blksize=%d\n", blksize));
|
2003-10-02 11:15:20 +04:00
|
|
|
if (sc->hw_if->round_blocksize)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
blksize = sc->hw_if->round_blocksize(sc->hw_hdl, blksize,
|
|
|
|
mode, &rp->s.param);
|
2003-10-02 11:15:20 +04:00
|
|
|
if (blksize <= 0)
|
|
|
|
panic("audio_init_ringbuffer: blksize");
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
nblks = rp->s.bufsize / blksize;
|
2003-10-02 11:15:20 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
DPRINTF(("audio_init_ringbuffer: final blksize=%d\n", blksize));
|
1997-07-27 05:16:32 +04:00
|
|
|
rp->blksize = blksize;
|
|
|
|
rp->maxblks = nblks;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
rp->s.end = rp->s.start + nblks * blksize;
|
|
|
|
rp->s.outp = rp->s.inp = rp->s.start;
|
|
|
|
rp->s.used = 0;
|
1997-07-27 05:16:32 +04:00
|
|
|
rp->stamp = 0;
|
2006-05-10 05:56:21 +04:00
|
|
|
rp->stamp_last = 0;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
rp->fstamp = 0;
|
1997-07-27 05:16:32 +04:00
|
|
|
rp->drops = 0;
|
2007-03-01 20:31:35 +03:00
|
|
|
rp->pause = false;
|
|
|
|
rp->copying = false;
|
|
|
|
rp->needfill = false;
|
|
|
|
rp->mmapped = false;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1997-08-25 02:31:23 +04:00
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_initbufs(struct audio_softc *sc)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
const struct audio_hw_if *hw;
|
1997-08-25 02:31:23 +04:00
|
|
|
int error;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-08-06 11:39:59 +04:00
|
|
|
DPRINTF(("audio_initbufs: mode=0x%x\n", sc->sc_mode));
|
2005-01-15 19:23:03 +03:00
|
|
|
hw = sc->hw_if;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_init_ringbuffer(sc, &sc->sc_rr, AUMODE_RECORD);
|
1997-08-25 02:31:23 +04:00
|
|
|
if (hw->init_input && (sc->sc_mode & AUMODE_RECORD)) {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
error = hw->init_input(sc->hw_hdl, sc->sc_rr.s.start,
|
|
|
|
sc->sc_rr.s.end - sc->sc_rr.s.start);
|
1997-08-25 02:31:23 +04:00
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
}
|
1997-07-27 05:16:32 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_init_ringbuffer(sc, &sc->sc_pr, AUMODE_PLAY);
|
1997-07-27 05:16:32 +04:00
|
|
|
sc->sc_sil_count = 0;
|
1997-08-25 02:31:23 +04:00
|
|
|
if (hw->init_output && (sc->sc_mode & AUMODE_PLAY)) {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
error = hw->init_output(sc->hw_hdl, sc->sc_pr.s.start,
|
|
|
|
sc->sc_pr.s.end - sc->sc_pr.s.start);
|
1997-08-25 02:31:23 +04:00
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
}
|
1997-07-27 05:16:32 +04:00
|
|
|
|
1997-08-07 03:08:26 +04:00
|
|
|
#ifdef AUDIO_INTR_TIME
|
1998-08-04 15:26:14 +04:00
|
|
|
#define double u_long
|
1997-08-07 03:08:26 +04:00
|
|
|
sc->sc_pnintr = 0;
|
|
|
|
sc->sc_pblktime = (u_long)(
|
2002-03-23 20:17:10 +03:00
|
|
|
(double)sc->sc_pr.blksize * 100000 /
|
|
|
|
(double)(sc->sc_pparams.precision / NBBY *
|
|
|
|
sc->sc_pparams.channels *
|
1998-08-04 15:26:14 +04:00
|
|
|
sc->sc_pparams.sample_rate)) * 10;
|
2002-03-23 20:17:10 +03:00
|
|
|
DPRINTF(("audio: play blktime = %lu for %d\n",
|
1997-08-07 03:08:26 +04:00
|
|
|
sc->sc_pblktime, sc->sc_pr.blksize));
|
|
|
|
sc->sc_rnintr = 0;
|
|
|
|
sc->sc_rblktime = (u_long)(
|
2002-03-23 20:17:10 +03:00
|
|
|
(double)sc->sc_rr.blksize * 100000 /
|
|
|
|
(double)(sc->sc_rparams.precision / NBBY *
|
|
|
|
sc->sc_rparams.channels *
|
1998-08-04 15:26:14 +04:00
|
|
|
sc->sc_rparams.sample_rate)) * 10;
|
2002-03-23 20:17:10 +03:00
|
|
|
DPRINTF(("audio: record blktime = %lu for %d\n",
|
1997-08-07 03:08:26 +04:00
|
|
|
sc->sc_rblktime, sc->sc_rr.blksize));
|
1998-08-04 15:26:14 +04:00
|
|
|
#undef double
|
1997-08-07 03:08:26 +04:00
|
|
|
#endif
|
1997-08-25 02:31:23 +04:00
|
|
|
|
|
|
|
return 0;
|
1997-08-07 03:08:26 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_calcwater(struct audio_softc *sc)
|
1997-08-07 03:08:26 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
/* set high at 100% */
|
|
|
|
sc->sc_pr.usedhigh = sc->sc_pustream->end - sc->sc_pustream->start;
|
|
|
|
/* set low at 75% of usedhigh */
|
|
|
|
sc->sc_pr.usedlow = sc->sc_pr.usedhigh * 3 / 4;
|
1997-07-27 05:16:32 +04:00
|
|
|
if (sc->sc_pr.usedlow == sc->sc_pr.usedhigh)
|
|
|
|
sc->sc_pr.usedlow -= sc->sc_pr.blksize;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
|
|
|
|
sc->sc_rr.usedhigh = sc->sc_rustream->end - sc->sc_rustream->start
|
|
|
|
- sc->sc_rr.blksize;
|
1997-07-27 05:16:32 +04:00
|
|
|
sc->sc_rr.usedlow = 0;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
DPRINTF(("%s: plow=%d phigh=%d rlow=%d rhigh=%d\n", __func__,
|
|
|
|
sc->sc_pr.usedlow, sc->sc_pr.usedhigh,
|
|
|
|
sc->sc_rr.usedlow, sc->sc_rr.usedhigh));
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
2005-12-24 23:27:29 +03:00
|
|
|
static inline int
|
2005-01-15 19:23:03 +03:00
|
|
|
audio_sleep_timo(int *chan, const char *label, int timo)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
|
|
|
int st;
|
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
if (label == NULL)
|
1995-02-21 04:35:58 +03:00
|
|
|
label = "audio";
|
1997-09-06 05:14:48 +04:00
|
|
|
|
2002-03-23 20:17:10 +03:00
|
|
|
DPRINTFN(3, ("audio_sleep_timo: chan=%p, label=%s, timo=%d\n",
|
|
|
|
chan, label, timo));
|
1995-02-21 04:35:58 +03:00
|
|
|
*chan = 1;
|
1997-07-27 05:16:32 +04:00
|
|
|
st = tsleep(chan, PWAIT | PCATCH, label, timo);
|
1995-02-21 04:35:58 +03:00
|
|
|
*chan = 0;
|
1997-07-27 05:16:32 +04:00
|
|
|
#ifdef AUDIO_DEBUG
|
2000-03-26 14:01:32 +04:00
|
|
|
if (st != 0 && st != EINTR)
|
2001-06-04 03:52:51 +04:00
|
|
|
DPRINTF(("audio_sleep: woke up st=%d\n", st));
|
1997-07-27 05:16:32 +04:00
|
|
|
#endif
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return st;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
2005-12-24 23:27:29 +03:00
|
|
|
static inline int
|
2005-01-15 19:23:03 +03:00
|
|
|
audio_sleep(int *chan, const char *label)
|
1995-07-07 05:52:30 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
return audio_sleep_timo(chan, label, 0);
|
1995-07-07 05:52:30 +04:00
|
|
|
}
|
|
|
|
|
1997-09-06 05:14:48 +04:00
|
|
|
/* call at splaudio() */
|
2005-12-24 23:27:29 +03:00
|
|
|
static inline void
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_wakeup(int *chan)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
|
1998-04-28 13:07:12 +04:00
|
|
|
DPRINTFN(3, ("audio_wakeup: chan=%p, *chan=%d\n", chan, *chan));
|
1995-02-21 04:35:58 +03:00
|
|
|
if (*chan) {
|
1995-03-25 03:00:53 +03:00
|
|
|
wakeup(chan);
|
1995-02-21 04:35:58 +03:00
|
|
|
*chan = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2006-11-16 04:32:37 +03:00
|
|
|
audio_open(dev_t dev, struct audio_softc *sc, int flags, int ifmt,
|
|
|
|
struct lwp *l)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
1997-07-27 05:16:32 +04:00
|
|
|
int error;
|
2003-10-02 11:15:20 +04:00
|
|
|
u_int mode;
|
2004-10-29 16:57:15 +04:00
|
|
|
const struct audio_hw_if *hw;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
|
|
|
hw = sc->hw_if;
|
2005-01-15 19:23:03 +03:00
|
|
|
if (hw == NULL)
|
1997-08-20 03:49:33 +04:00
|
|
|
return ENXIO;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2002-03-23 20:17:10 +03:00
|
|
|
DPRINTF(("audio_open: flags=0x%x sc=%p hdl=%p\n",
|
1999-09-09 14:24:39 +04:00
|
|
|
flags, sc, sc->hw_hdl));
|
1997-08-19 01:19:02 +04:00
|
|
|
|
2005-05-19 00:10:25 +04:00
|
|
|
if (((flags & FREAD) && (sc->sc_open & AUOPEN_READ)) ||
|
|
|
|
((flags & FWRITE) && (sc->sc_open & AUOPEN_WRITE)))
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EBUSY;
|
2006-05-16 17:46:19 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (hw->open != NULL) {
|
|
|
|
error = hw->open(sc->hw_hdl, flags);
|
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-08-25 02:31:23 +04:00
|
|
|
sc->sc_async_audio = 0;
|
|
|
|
sc->sc_rchan = 0;
|
|
|
|
sc->sc_wchan = 0;
|
|
|
|
sc->sc_sil_count = 0;
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_rbus = false;
|
|
|
|
sc->sc_pbus = false;
|
1997-08-25 02:31:23 +04:00
|
|
|
sc->sc_eof = 0;
|
|
|
|
sc->sc_playdrop = 0;
|
|
|
|
|
2005-04-25 17:19:46 +04:00
|
|
|
sc->sc_full_duplex =
|
1997-08-26 23:03:55 +04:00
|
|
|
(flags & (FWRITE|FREAD)) == (FWRITE|FREAD) &&
|
1997-08-25 02:31:23 +04:00
|
|
|
(hw->get_props(sc->hw_hdl) & AUDIO_PROP_FULLDUPLEX);
|
|
|
|
|
|
|
|
mode = 0;
|
|
|
|
if (flags & FREAD) {
|
1995-02-21 04:35:58 +03:00
|
|
|
sc->sc_open |= AUOPEN_READ;
|
1997-08-25 02:31:23 +04:00
|
|
|
mode |= AUMODE_RECORD;
|
|
|
|
}
|
|
|
|
if (flags & FWRITE) {
|
1995-02-21 04:35:58 +03:00
|
|
|
sc->sc_open |= AUOPEN_WRITE;
|
1997-08-25 02:31:23 +04:00
|
|
|
mode |= AUMODE_PLAY | AUMODE_PLAY_ALL;
|
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Multiplex device: /dev/audio (MU-Law) and /dev/sound (linear)
|
|
|
|
* The /dev/audio is always (re)set to 8-bit MU-Law mono
|
|
|
|
* For the other devices, you get what they were last set to.
|
|
|
|
*/
|
|
|
|
if (ISDEVAUDIO(dev)) {
|
2003-10-02 11:15:20 +04:00
|
|
|
error = audio_set_defaults(sc, mode);
|
|
|
|
} else {
|
|
|
|
struct audio_info ai;
|
|
|
|
|
|
|
|
AUDIO_INITINFO(&ai);
|
|
|
|
ai.mode = mode;
|
|
|
|
error = audiosetinfo(sc, &ai);
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
2003-10-02 11:15:20 +04:00
|
|
|
if (error)
|
|
|
|
goto bad;
|
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
#ifdef DIAGNOSTIC
|
1995-02-21 04:35:58 +03:00
|
|
|
/*
|
|
|
|
* Sample rate and precision are supposed to be set to proper
|
|
|
|
* default values by the hardware driver, so that it may give
|
|
|
|
* us these values.
|
|
|
|
*/
|
1997-05-01 16:27:10 +04:00
|
|
|
if (sc->sc_rparams.precision == 0 || sc->sc_pparams.precision == 0) {
|
1997-04-30 01:01:33 +04:00
|
|
|
printf("audio_open: 0 precision\n");
|
|
|
|
return EINVAL;
|
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
#endif
|
1997-03-20 19:13:55 +03:00
|
|
|
|
2001-01-25 18:25:34 +03:00
|
|
|
/* audio_close() decreases sc_pr.usedlow, recalculate here */
|
|
|
|
audio_calcwater(sc);
|
1997-03-20 19:13:55 +03:00
|
|
|
|
1997-08-25 02:31:23 +04:00
|
|
|
DPRINTF(("audio_open: done sc_mode = 0x%x\n", sc->sc_mode));
|
2002-03-23 20:17:10 +03:00
|
|
|
|
1997-08-25 02:31:23 +04:00
|
|
|
return 0;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
1997-08-25 02:31:23 +04:00
|
|
|
bad:
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (hw->close != NULL)
|
|
|
|
hw->close(sc->hw_hdl);
|
1997-08-25 02:31:23 +04:00
|
|
|
sc->sc_open = 0;
|
|
|
|
sc->sc_mode = 0;
|
|
|
|
sc->sc_full_duplex = 0;
|
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Must be called from task context.
|
|
|
|
*/
|
|
|
|
void
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_init_record(struct audio_softc *sc)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
int s;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
s = splaudio();
|
1995-07-07 05:52:30 +04:00
|
|
|
if (sc->hw_if->speaker_ctl &&
|
1997-07-27 05:16:32 +04:00
|
|
|
(!sc->sc_full_duplex || (sc->sc_mode & AUMODE_PLAY) == 0))
|
1995-02-21 04:35:58 +03:00
|
|
|
sc->hw_if->speaker_ctl(sc->hw_hdl, SPKR_OFF);
|
|
|
|
splx(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Must be called from task context.
|
|
|
|
*/
|
|
|
|
void
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_init_play(struct audio_softc *sc)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
int s;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
s = splaudio();
|
1997-07-27 05:16:32 +04:00
|
|
|
sc->sc_wstamp = sc->sc_pr.stamp;
|
1995-02-21 04:35:58 +03:00
|
|
|
if (sc->hw_if->speaker_ctl)
|
|
|
|
sc->hw_if->speaker_ctl(sc->hw_hdl, SPKR_ON);
|
|
|
|
splx(s);
|
|
|
|
}
|
|
|
|
|
1995-04-18 03:04:31 +04:00
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_drain(struct audio_softc *sc)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_ringbuffer *cb;
|
1997-07-27 05:16:32 +04:00
|
|
|
int error, drops;
|
1997-09-06 05:14:48 +04:00
|
|
|
int s;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
int i, used;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
DPRINTF(("audio_drain: enter busy=%d\n", sc->sc_pbus));
|
2005-01-15 19:23:03 +03:00
|
|
|
cb = &sc->sc_pr;
|
|
|
|
if (cb->mmapped)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
used = audio_stream_get_used(&sc->sc_pr.s);
|
|
|
|
s = splaudio();
|
|
|
|
for (i = 0; i < sc->sc_npfilters; i++)
|
|
|
|
used += audio_stream_get_used(&sc->sc_pstreams[i]);
|
|
|
|
splx(s);
|
|
|
|
if (used <= 0)
|
1997-07-27 05:16:32 +04:00
|
|
|
return 0;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
if (!sc->sc_pbus) {
|
|
|
|
/* We've never started playing, probably because the
|
|
|
|
* block was too short. Pad it and start now.
|
|
|
|
*/
|
1997-09-06 05:14:48 +04:00
|
|
|
int cc;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
uint8_t *inp = cb->s.inp;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cc = cb->blksize - (inp - cb->s.start) % cb->blksize;
|
|
|
|
audio_fill_silence(&cb->s.param, inp, cc);
|
1997-07-27 05:16:32 +04:00
|
|
|
s = splaudio();
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb->s.inp = audio_stream_add_inp(&cb->s, inp, cc);
|
1997-08-25 02:31:23 +04:00
|
|
|
error = audiostartp(sc);
|
1997-07-27 05:16:32 +04:00
|
|
|
splx(s);
|
1997-08-25 02:31:23 +04:00
|
|
|
if (error)
|
|
|
|
return error;
|
1997-07-27 05:16:32 +04:00
|
|
|
}
|
2002-03-23 20:17:10 +03:00
|
|
|
/*
|
1997-07-27 05:16:32 +04:00
|
|
|
* Play until a silence block has been played, then we
|
|
|
|
* know all has been drained.
|
|
|
|
* XXX This should be done some other way to avoid
|
|
|
|
* playing silence.
|
|
|
|
*/
|
1997-08-20 03:49:33 +04:00
|
|
|
#ifdef DIAGNOSTIC
|
|
|
|
if (cb->copying) {
|
|
|
|
printf("audio_drain: copying in progress!?!\n");
|
2007-03-01 20:31:35 +03:00
|
|
|
cb->copying = false;
|
1997-08-20 03:49:33 +04:00
|
|
|
}
|
|
|
|
#endif
|
1997-07-27 05:16:32 +04:00
|
|
|
drops = cb->drops;
|
1997-09-06 05:14:48 +04:00
|
|
|
error = 0;
|
|
|
|
s = splaudio();
|
|
|
|
while (cb->drops == drops && !error) {
|
2002-03-23 20:17:10 +03:00
|
|
|
DPRINTF(("audio_drain: used=%d, drops=%ld\n",
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_stream_get_used(&sc->sc_pr.s), cb->drops));
|
1995-07-07 05:52:30 +04:00
|
|
|
/*
|
|
|
|
* When the process is exiting, it ignores all signals and
|
1998-12-28 01:52:23 +03:00
|
|
|
* we can't interrupt this sleep, so we set a timeout
|
|
|
|
* just in case.
|
1995-07-07 05:52:30 +04:00
|
|
|
*/
|
1998-05-18 22:27:43 +04:00
|
|
|
error = audio_sleep_timo(&sc->sc_wchan, "aud_dr", 30*hz);
|
1999-09-09 14:24:39 +04:00
|
|
|
if (sc->sc_dying)
|
|
|
|
error = EIO;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1997-09-06 05:14:48 +04:00
|
|
|
splx(s);
|
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Close an audio chip.
|
|
|
|
*/
|
|
|
|
/* ARGSUSED */
|
|
|
|
int
|
2006-11-16 04:32:37 +03:00
|
|
|
audio_close(struct audio_softc *sc, int flags, int ifmt,
|
|
|
|
struct lwp *l)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
const struct audio_hw_if *hw;
|
1995-02-21 04:35:58 +03:00
|
|
|
int s;
|
|
|
|
|
1999-09-09 14:24:39 +04:00
|
|
|
DPRINTF(("audio_close: sc=%p\n", sc));
|
2005-01-15 19:23:03 +03:00
|
|
|
hw = sc->hw_if;
|
1998-08-09 11:25:58 +04:00
|
|
|
s = splaudio();
|
2002-03-23 20:17:10 +03:00
|
|
|
/* Stop recording. */
|
1998-08-09 11:25:58 +04:00
|
|
|
if ((flags & FREAD) && sc->sc_rbus) {
|
2002-03-23 20:17:10 +03:00
|
|
|
/*
|
1997-12-03 04:01:19 +03:00
|
|
|
* XXX Some drivers (e.g. SB) use the same routine
|
|
|
|
* to halt input and output so don't halt input if
|
|
|
|
* in full duplex mode. These drivers should be fixed.
|
|
|
|
*/
|
2005-01-15 19:23:03 +03:00
|
|
|
if (!sc->sc_full_duplex || hw->halt_input != hw->halt_output)
|
|
|
|
hw->halt_input(sc->hw_hdl);
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_rbus = false;
|
1997-12-03 04:01:19 +03:00
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
/*
|
|
|
|
* Block until output drains, but allow ^C interrupt.
|
|
|
|
*/
|
1997-07-27 05:16:32 +04:00
|
|
|
sc->sc_pr.usedlow = sc->sc_pr.blksize; /* avoid excessive wakeups */
|
1995-02-21 04:35:58 +03:00
|
|
|
/*
|
|
|
|
* If there is pending output, let it drain (unless
|
|
|
|
* the output is paused).
|
|
|
|
*/
|
1998-08-09 11:25:58 +04:00
|
|
|
if ((flags & FWRITE) && sc->sc_pbus) {
|
|
|
|
if (!sc->sc_pr.pause && !audio_drain(sc) && hw->drain)
|
1995-02-21 04:35:58 +03:00
|
|
|
(void)hw->drain(sc->hw_hdl);
|
2005-01-15 19:23:03 +03:00
|
|
|
hw->halt_output(sc->hw_hdl);
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_pbus = false;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
2002-03-23 20:17:10 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (hw->close != NULL)
|
|
|
|
hw->close(sc->hw_hdl);
|
2002-03-23 20:17:10 +03:00
|
|
|
|
2005-05-04 05:57:23 +04:00
|
|
|
sc->sc_open = 0;
|
|
|
|
sc->sc_mode = 0;
|
1997-08-11 05:38:12 +04:00
|
|
|
sc->sc_async_audio = 0;
|
1997-08-25 02:31:23 +04:00
|
|
|
sc->sc_full_duplex = 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
splx(s);
|
1995-07-07 05:52:30 +04:00
|
|
|
DPRINTF(("audio_close: done\n"));
|
1995-02-21 04:35:58 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_read(struct audio_softc *sc, struct uio *uio, int ioflag)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
struct audio_ringbuffer *cb;
|
|
|
|
const uint8_t *outp;
|
|
|
|
uint8_t *inp;
|
1997-07-27 05:16:32 +04:00
|
|
|
int error, s, used, cc, n;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb = &sc->sc_rr;
|
1997-07-27 05:16:32 +04:00
|
|
|
if (cb->mmapped)
|
|
|
|
return EINVAL;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
DPRINTFN(1,("audio_read: cc=%zu mode=%d\n",
|
|
|
|
uio->uio_resid, sc->sc_mode));
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2008-02-13 21:31:51 +03:00
|
|
|
#ifdef AUDIO_PM_IDLE
|
2007-12-13 17:40:36 +03:00
|
|
|
if (device_is_active(&sc->dev) || sc->sc_idle)
|
|
|
|
device_active(&sc->dev, DVA_SYSTEM);
|
2008-02-13 21:31:51 +03:00
|
|
|
#endif
|
2007-12-13 17:40:36 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
error = 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
/*
|
|
|
|
* If hardware is half-duplex and currently playing, return
|
|
|
|
* silence blocks based on the number of blocks we have output.
|
|
|
|
*/
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (!sc->sc_full_duplex && (sc->sc_mode & AUMODE_PLAY)) {
|
1997-07-27 05:16:32 +04:00
|
|
|
while (uio->uio_resid > 0 && !error) {
|
1995-02-21 04:35:58 +03:00
|
|
|
s = splaudio();
|
1997-07-27 05:16:32 +04:00
|
|
|
for(;;) {
|
|
|
|
cc = sc->sc_pr.stamp - sc->sc_wstamp;
|
|
|
|
if (cc > 0)
|
|
|
|
break;
|
1998-12-28 01:52:23 +03:00
|
|
|
DPRINTF(("audio_read: stamp=%lu, wstamp=%lu\n",
|
1997-07-27 05:16:32 +04:00
|
|
|
sc->sc_pr.stamp, sc->sc_wstamp));
|
1995-02-21 04:35:58 +03:00
|
|
|
if (ioflag & IO_NDELAY) {
|
|
|
|
splx(s);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EWOULDBLOCK;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1998-05-18 22:27:43 +04:00
|
|
|
error = audio_sleep(&sc->sc_rchan, "aud_hr");
|
1999-09-09 14:24:39 +04:00
|
|
|
if (sc->sc_dying)
|
|
|
|
error = EIO;
|
1996-02-20 14:47:22 +03:00
|
|
|
if (error) {
|
1995-02-21 04:35:58 +03:00
|
|
|
splx(s);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
splx(s);
|
1997-07-27 05:16:32 +04:00
|
|
|
|
|
|
|
if (uio->uio_resid < cc)
|
|
|
|
cc = uio->uio_resid;
|
1998-12-28 01:52:23 +03:00
|
|
|
DPRINTFN(1,("audio_read: reading in write mode, "
|
|
|
|
"cc=%d\n", cc));
|
1997-07-27 05:16:32 +04:00
|
|
|
error = audio_silence_copyout(sc, cc, uio);
|
|
|
|
sc->sc_wstamp += cc;
|
2002-03-23 20:17:10 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
while (uio->uio_resid > 0 && !error) {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
s = splaudio();
|
|
|
|
while ((used = audio_stream_get_used(sc->sc_rustream)) <= 0) {
|
|
|
|
if (!sc->sc_rbus) {
|
|
|
|
error = audiostartr(sc);
|
1997-09-06 05:14:48 +04:00
|
|
|
if (error) {
|
|
|
|
splx(s);
|
2002-03-16 11:58:49 +03:00
|
|
|
return error;
|
1997-09-06 05:14:48 +04:00
|
|
|
}
|
1997-08-25 02:31:23 +04:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (ioflag & IO_NDELAY) {
|
|
|
|
splx(s);
|
|
|
|
return EWOULDBLOCK;
|
2002-03-09 23:30:42 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
DPRINTFN(2, ("audio_read: sleep used=%d\n", used));
|
|
|
|
error = audio_sleep(&sc->sc_rchan, "aud_rd");
|
|
|
|
if (sc->sc_dying)
|
|
|
|
error = EIO;
|
|
|
|
if (error) {
|
|
|
|
splx(s);
|
|
|
|
return error;
|
1997-09-06 05:14:48 +04:00
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
2002-03-07 17:37:02 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
outp = sc->sc_rustream->outp;
|
|
|
|
inp = sc->sc_rustream->inp;
|
2007-03-01 20:31:35 +03:00
|
|
|
cb->copying = true;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
splx(s);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* cc is the amount of data in the sc_rustream excluding
|
2008-01-23 17:14:55 +03:00
|
|
|
* wrapped data. Note the tricky case of inp == outp, which
|
|
|
|
* must mean the buffer is full, not empty, because used > 0.
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
*/
|
2008-01-23 17:14:55 +03:00
|
|
|
cc = outp < inp ? inp - outp :sc->sc_rustream->end - outp;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
DPRINTFN(1,("audio_read: outp=%p, cc=%d\n", outp, cc));
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2000-05-02 04:00:00 +04:00
|
|
|
n = uio->uio_resid;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
error = uiomove(__UNCONST(outp), cc, uio);
|
|
|
|
n -= uio->uio_resid; /* number of bytes actually moved */
|
2000-05-02 04:00:00 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
s = splaudio();
|
|
|
|
sc->sc_rustream->outp = audio_stream_add_outp
|
|
|
|
(sc->sc_rustream, outp, n);
|
2007-03-01 20:31:35 +03:00
|
|
|
cb->copying = false;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
splx(s);
|
1997-07-27 05:16:32 +04:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_clear(struct audio_softc *sc)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
int s;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
s = splaudio();
|
1997-08-07 03:08:26 +04:00
|
|
|
if (sc->sc_rbus) {
|
1997-08-19 01:19:02 +04:00
|
|
|
audio_wakeup(&sc->sc_rchan);
|
1995-02-21 04:35:58 +03:00
|
|
|
sc->hw_if->halt_input(sc->hw_hdl);
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_rbus = false;
|
1997-08-07 03:08:26 +04:00
|
|
|
}
|
|
|
|
if (sc->sc_pbus) {
|
1997-08-19 01:19:02 +04:00
|
|
|
audio_wakeup(&sc->sc_wchan);
|
1997-08-07 03:08:26 +04:00
|
|
|
sc->hw_if->halt_output(sc->hw_hdl);
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_pbus = false;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
splx(s);
|
|
|
|
}
|
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
void
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_calc_blksize(struct audio_softc *sc, int mode)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
const audio_params_t *parm;
|
1997-07-27 05:16:32 +04:00
|
|
|
struct audio_ringbuffer *rb;
|
|
|
|
|
1997-08-08 04:03:26 +04:00
|
|
|
if (sc->sc_blkset)
|
|
|
|
return;
|
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
if (mode == AUMODE_PLAY) {
|
|
|
|
rb = &sc->sc_pr;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
parm = &rb->s.param;
|
1997-07-27 05:16:32 +04:00
|
|
|
} else {
|
|
|
|
rb = &sc->sc_rr;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
parm = &rb->s.param;
|
1997-07-27 05:16:32 +04:00
|
|
|
}
|
2002-03-23 20:17:10 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
rb->blksize = parm->sample_rate * audio_blk_ms / 1000 *
|
|
|
|
parm->channels * parm->precision / NBBY;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
2002-03-23 20:17:10 +03:00
|
|
|
DPRINTF(("audio_calc_blksize: %s blksize=%d\n",
|
2003-10-02 11:15:20 +04:00
|
|
|
mode == AUMODE_PLAY ? "play" : "record", rb->blksize));
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_fill_silence(struct audio_params *params, uint8_t *p, int n)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
uint8_t auzero0, auzero1;
|
|
|
|
int nfill;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
auzero1 = 0; /* initialize to please gcc */
|
|
|
|
nfill = 1;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
switch (params->encoding) {
|
1997-03-13 05:19:32 +03:00
|
|
|
case AUDIO_ENCODING_ULAW:
|
2002-03-23 20:17:10 +03:00
|
|
|
auzero0 = 0x7f;
|
1997-03-13 05:19:32 +03:00
|
|
|
break;
|
|
|
|
case AUDIO_ENCODING_ALAW:
|
1997-07-27 05:16:32 +04:00
|
|
|
auzero0 = 0x55;
|
1997-03-13 05:19:32 +03:00
|
|
|
break;
|
1997-10-17 03:57:56 +04:00
|
|
|
case AUDIO_ENCODING_MPEG_L1_STREAM:
|
|
|
|
case AUDIO_ENCODING_MPEG_L1_PACKETS:
|
|
|
|
case AUDIO_ENCODING_MPEG_L1_SYSTEM:
|
|
|
|
case AUDIO_ENCODING_MPEG_L2_STREAM:
|
|
|
|
case AUDIO_ENCODING_MPEG_L2_PACKETS:
|
|
|
|
case AUDIO_ENCODING_MPEG_L2_SYSTEM:
|
1997-03-13 05:19:32 +03:00
|
|
|
case AUDIO_ENCODING_ADPCM: /* is this right XXX */
|
1997-07-15 11:46:04 +04:00
|
|
|
case AUDIO_ENCODING_SLINEAR_LE:
|
|
|
|
case AUDIO_ENCODING_SLINEAR_BE:
|
2001-09-03 22:51:43 +04:00
|
|
|
auzero0 = 0;/* fortunately this works for any number of bits */
|
1997-05-07 22:51:31 +04:00
|
|
|
break;
|
|
|
|
case AUDIO_ENCODING_ULINEAR_LE:
|
|
|
|
case AUDIO_ENCODING_ULINEAR_BE:
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (params->precision > 8) {
|
|
|
|
nfill = (params->precision + NBBY - 1)/ NBBY;
|
2001-09-03 22:51:43 +04:00
|
|
|
auzero0 = 0x80;
|
|
|
|
auzero1 = 0;
|
1997-05-07 22:51:31 +04:00
|
|
|
} else
|
1997-07-27 05:16:32 +04:00
|
|
|
auzero0 = 0x80;
|
1997-05-07 22:51:31 +04:00
|
|
|
break;
|
1997-03-13 05:19:32 +03:00
|
|
|
default:
|
1997-10-19 11:41:33 +04:00
|
|
|
DPRINTF(("audio: bad encoding %d\n", params->encoding));
|
1997-07-27 05:16:32 +04:00
|
|
|
auzero0 = 0;
|
1997-03-13 05:19:32 +03:00
|
|
|
break;
|
|
|
|
}
|
1997-05-07 22:51:31 +04:00
|
|
|
if (nfill == 1) {
|
|
|
|
while (--n >= 0)
|
1997-07-27 05:16:32 +04:00
|
|
|
*p++ = auzero0; /* XXX memset */
|
2001-09-03 22:51:43 +04:00
|
|
|
} else /* nfill must no longer be 2 */ {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (params->encoding == AUDIO_ENCODING_ULINEAR_LE) {
|
2001-09-03 22:51:43 +04:00
|
|
|
int k = nfill;
|
|
|
|
while (--k > 0)
|
|
|
|
*p++ = auzero1;
|
|
|
|
n -= nfill - 1;
|
|
|
|
}
|
|
|
|
while (n >= nfill) {
|
2002-09-23 07:44:56 +04:00
|
|
|
int k = nfill;
|
1997-07-27 05:16:32 +04:00
|
|
|
*p++ = auzero0;
|
2001-09-03 22:51:43 +04:00
|
|
|
while (--k > 0)
|
|
|
|
*p++ = auzero1;
|
|
|
|
|
|
|
|
n -= nfill;
|
1997-05-07 22:51:31 +04:00
|
|
|
}
|
2001-09-03 22:51:43 +04:00
|
|
|
if (n-- > 0) /* XXX must be 1 - DIAGNOSTIC check? */
|
|
|
|
*p++ = auzero0;
|
1997-05-07 22:51:31 +04:00
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1996-03-07 18:00:07 +03:00
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_silence_copyout(struct audio_softc *sc, int n, struct uio *uio)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
uint8_t zerobuf[128];
|
1997-05-11 04:41:12 +04:00
|
|
|
int error;
|
1997-03-13 05:19:32 +03:00
|
|
|
int k;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-05-11 04:41:12 +04:00
|
|
|
audio_fill_silence(&sc->sc_rparams, zerobuf, sizeof zerobuf);
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-05-11 04:41:12 +04:00
|
|
|
error = 0;
|
2002-03-23 20:17:10 +03:00
|
|
|
while (n > 0 && uio->uio_resid > 0 && !error) {
|
1997-05-11 04:41:12 +04:00
|
|
|
k = min(n, min(uio->uio_resid, sizeof zerobuf));
|
|
|
|
error = uiomove(zerobuf, k, uio);
|
|
|
|
n -= k;
|
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
uio_fetcher_fetch_to(stream_fetcher_t *self, audio_stream_t *p,
|
2006-11-16 04:32:37 +03:00
|
|
|
int max_used)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
{
|
|
|
|
uio_fetcher_t *this;
|
|
|
|
int size;
|
|
|
|
int stream_space;
|
|
|
|
int error;
|
|
|
|
|
|
|
|
this = (uio_fetcher_t *)self;
|
2006-05-10 05:56:21 +04:00
|
|
|
this->last_used = audio_stream_get_used(p);
|
|
|
|
if (this->last_used >= this->usedhigh)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
|
|
|
/*
|
|
|
|
* uio_fetcher ignores max_used and move the data as
|
|
|
|
* much as possible in order to return the correct value
|
|
|
|
* for audio_prinfo::seek and kfilters.
|
|
|
|
*/
|
|
|
|
stream_space = audio_stream_get_space(p);
|
|
|
|
size = min(this->uio->uio_resid, stream_space);
|
|
|
|
|
|
|
|
/* the first fragment of the space */
|
|
|
|
stream_space = p->end - p->inp;
|
|
|
|
if (stream_space >= size) {
|
|
|
|
error = uiomove(p->inp, size, this->uio);
|
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
p->inp = audio_stream_add_inp(p, p->inp, size);
|
|
|
|
} else {
|
|
|
|
error = uiomove(p->inp, stream_space, this->uio);
|
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
p->inp = audio_stream_add_inp(p, p->inp, stream_space);
|
|
|
|
error = uiomove(p->start, size - stream_space, this->uio);
|
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
p->inp = audio_stream_add_inp(p, p->inp, size - stream_space);
|
|
|
|
}
|
|
|
|
this->last_used = audio_stream_get_used(p);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2006-11-16 04:32:37 +03:00
|
|
|
null_fetcher_fetch_to(stream_fetcher_t *self,
|
|
|
|
audio_stream_t *p, int max_used)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
uio_fetcher_ctor(uio_fetcher_t *this, struct uio *u, int h)
|
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
this->base.fetch_to = uio_fetcher_fetch_to;
|
|
|
|
this->uio = u;
|
|
|
|
this->usedhigh = h;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_write(struct audio_softc *sc, struct uio *uio, int ioflag)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
uio_fetcher_t ufetcher;
|
|
|
|
audio_stream_t stream;
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_ringbuffer *cb;
|
|
|
|
stream_fetcher_t *fetcher;
|
|
|
|
stream_filter_t *filter;
|
|
|
|
uint8_t *inp, *einp;
|
|
|
|
int saveerror, error, s, n, cc, used;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
DPRINTFN(2,("audio_write: sc=%p count=%zu used=%d(hi=%d)\n",
|
|
|
|
sc, uio->uio_resid, audio_stream_get_used(sc->sc_pustream),
|
1998-12-28 01:52:23 +03:00
|
|
|
sc->sc_pr.usedhigh));
|
2005-01-15 19:23:03 +03:00
|
|
|
cb = &sc->sc_pr;
|
1997-07-27 05:16:32 +04:00
|
|
|
if (cb->mmapped)
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
if (uio->uio_resid == 0) {
|
|
|
|
sc->sc_eof++;
|
|
|
|
return 0;
|
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2008-02-13 21:31:51 +03:00
|
|
|
#ifdef AUDIO_PM_IDLE
|
2007-12-13 17:40:36 +03:00
|
|
|
if (device_is_active(&sc->dev) || sc->sc_idle)
|
|
|
|
device_active(&sc->dev, DVA_SYSTEM);
|
2008-02-13 21:31:51 +03:00
|
|
|
#endif
|
2007-12-13 17:40:36 +03:00
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
/*
|
|
|
|
* If half-duplex and currently recording, throw away data.
|
|
|
|
*/
|
1997-07-27 05:16:32 +04:00
|
|
|
if (!sc->sc_full_duplex &&
|
1995-07-07 05:52:30 +04:00
|
|
|
(sc->sc_mode & AUMODE_RECORD)) {
|
1995-02-21 04:35:58 +03:00
|
|
|
uio->uio_offset += uio->uio_resid;
|
|
|
|
uio->uio_resid = 0;
|
1995-07-07 05:52:30 +04:00
|
|
|
DPRINTF(("audio_write: half-dpx read busy\n"));
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
if (!(sc->sc_mode & AUMODE_PLAY_ALL) && sc->sc_playdrop > 0) {
|
|
|
|
n = min(sc->sc_playdrop, uio->uio_resid);
|
1997-08-25 02:31:23 +04:00
|
|
|
DPRINTF(("audio_write: playdrop %d\n", n));
|
1997-07-27 05:16:32 +04:00
|
|
|
uio->uio_offset += n;
|
|
|
|
uio->uio_resid -= n;
|
|
|
|
sc->sc_playdrop -= n;
|
|
|
|
if (uio->uio_resid == 0)
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
/**
|
|
|
|
* setup filter pipeline
|
2002-03-07 17:37:02 +03:00
|
|
|
*/
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
uio_fetcher_ctor(&ufetcher, uio, cb->usedhigh);
|
|
|
|
if (sc->sc_npfilters > 0) {
|
|
|
|
fetcher = &sc->sc_pfilters[sc->sc_npfilters - 1]->base;
|
|
|
|
} else {
|
|
|
|
fetcher = &ufetcher.base;
|
2002-03-07 17:37:02 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
error = 0;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
while (uio->uio_resid > 0 && !error) {
|
1997-09-06 05:14:48 +04:00
|
|
|
s = splaudio();
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
/* wait if the first buffer is occupied */
|
2005-01-15 19:23:03 +03:00
|
|
|
while ((used = audio_stream_get_used(sc->sc_pustream))
|
|
|
|
>= cb->usedhigh) {
|
1998-12-28 01:52:23 +03:00
|
|
|
DPRINTFN(2, ("audio_write: sleep used=%d lowat=%d "
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
"hiwat=%d\n", used,
|
|
|
|
cb->usedlow, cb->usedhigh));
|
1997-09-06 05:14:48 +04:00
|
|
|
if (ioflag & IO_NDELAY) {
|
|
|
|
splx(s);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EWOULDBLOCK;
|
1997-09-06 05:14:48 +04:00
|
|
|
}
|
1998-05-18 22:27:43 +04:00
|
|
|
error = audio_sleep(&sc->sc_wchan, "aud_wr");
|
1999-09-09 14:24:39 +04:00
|
|
|
if (sc->sc_dying)
|
|
|
|
error = EIO;
|
1997-09-06 05:14:48 +04:00
|
|
|
if (error) {
|
|
|
|
splx(s);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1997-09-06 05:14:48 +04:00
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
inp = cb->s.inp;
|
2007-03-01 20:31:35 +03:00
|
|
|
cb->copying = true;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
stream = cb->s;
|
|
|
|
used = stream.used;
|
1995-02-21 04:35:58 +03:00
|
|
|
splx(s);
|
|
|
|
|
2002-03-23 20:17:10 +03:00
|
|
|
/*
|
2006-05-16 17:46:19 +04:00
|
|
|
* write to the sc_pustream as much as possible
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
*
|
|
|
|
* work with a temporary audio_stream_t to narrow
|
|
|
|
* splaudio() enclosure
|
1997-08-04 13:29:51 +04:00
|
|
|
*/
|
2006-04-18 23:15:27 +04:00
|
|
|
|
2006-04-19 18:10:58 +04:00
|
|
|
sc->sc_writing = 1;
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (sc->sc_npfilters > 0) {
|
|
|
|
filter = sc->sc_pfilters[0];
|
|
|
|
filter->set_fetcher(filter, &ufetcher.base);
|
2006-04-18 23:15:27 +04:00
|
|
|
fetcher = &sc->sc_pfilters[sc->sc_npfilters - 1]->base;
|
2006-05-16 17:46:19 +04:00
|
|
|
cc = cb->blksize * 2;
|
|
|
|
error = fetcher->fetch_to(fetcher, &stream, cc);
|
|
|
|
if (error != 0) {
|
|
|
|
fetcher = &ufetcher.base;
|
|
|
|
cc = sc->sc_pustream->end - sc->sc_pustream->start;
|
|
|
|
error = fetcher->fetch_to(fetcher, sc->sc_pustream, cc);
|
|
|
|
}
|
2006-04-18 23:15:27 +04:00
|
|
|
} else {
|
|
|
|
fetcher = &ufetcher.base;
|
2006-05-16 17:46:19 +04:00
|
|
|
cc = stream.end - stream.start;
|
|
|
|
error = fetcher->fetch_to(fetcher, &stream, cc);
|
2006-04-18 23:15:27 +04:00
|
|
|
}
|
2006-04-19 18:10:58 +04:00
|
|
|
sc->sc_writing = 0;
|
|
|
|
if (sc->sc_waitcomp)
|
|
|
|
wakeup(sc);
|
2006-04-18 23:15:27 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
s = splaudio();
|
|
|
|
if (sc->sc_npfilters > 0) {
|
2006-05-10 05:56:21 +04:00
|
|
|
cb->fstamp += ufetcher.last_used
|
|
|
|
- audio_stream_get_used(sc->sc_pustream);
|
2002-03-09 23:30:42 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb->s.used += stream.used - used;
|
|
|
|
cb->s.inp = stream.inp;
|
|
|
|
einp = cb->s.inp;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
/*
|
|
|
|
* This is a very suboptimal way of keeping track of
|
|
|
|
* silence in the buffer, but it is simple.
|
|
|
|
*/
|
|
|
|
sc->sc_sil_count = 0;
|
|
|
|
|
2002-03-23 20:17:10 +03:00
|
|
|
/*
|
1998-12-28 01:52:23 +03:00
|
|
|
* If the interrupt routine wants the last block filled AND
|
1997-07-27 05:16:32 +04:00
|
|
|
* the copy did not fill the last block completely it needs to
|
|
|
|
* be padded.
|
|
|
|
*/
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (cb->needfill && inp < einp &&
|
|
|
|
(inp - cb->s.start) / cb->blksize ==
|
|
|
|
(einp - cb->s.start) / cb->blksize) {
|
1998-12-28 01:52:23 +03:00
|
|
|
/* Figure out how many bytes to a block boundary. */
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cc = cb->blksize - (einp - cb->s.start) % cb->blksize;
|
1997-07-27 05:16:32 +04:00
|
|
|
DPRINTF(("audio_write: partial fill %d\n", cc));
|
|
|
|
} else
|
|
|
|
cc = 0;
|
2007-03-01 20:31:35 +03:00
|
|
|
cb->needfill = false;
|
|
|
|
cb->copying = false;
|
1999-06-07 23:24:38 +04:00
|
|
|
if (!sc->sc_pbus && !cb->pause) {
|
|
|
|
saveerror = error;
|
|
|
|
error = audiostartp(sc);
|
|
|
|
if (saveerror != 0) {
|
2001-09-16 20:34:23 +04:00
|
|
|
/* Report the first error that occurred. */
|
1999-06-07 23:24:38 +04:00
|
|
|
error = saveerror;
|
|
|
|
}
|
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
splx(s);
|
1998-12-28 01:52:23 +03:00
|
|
|
if (cc != 0) {
|
1998-04-28 13:07:12 +04:00
|
|
|
DPRINTFN(1, ("audio_write: fill %d\n", cc));
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_fill_silence(&cb->s.param, einp, cc);
|
1997-07-27 05:16:32 +04:00
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
2006-04-18 23:15:27 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-03-04 08:59:00 +03:00
|
|
|
audio_ioctl(struct audio_softc *sc, u_long cmd, void *addr, int flag,
|
2005-12-11 15:16:03 +03:00
|
|
|
struct lwp *l)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
const struct audio_hw_if *hw;
|
1997-07-27 05:16:32 +04:00
|
|
|
struct audio_offset *ao;
|
2003-10-02 11:15:20 +04:00
|
|
|
u_long stamp;
|
2005-01-15 19:23:03 +03:00
|
|
|
int error, s, offs, fd;
|
2007-02-22 01:59:35 +03:00
|
|
|
bool rbus, pbus;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2000-03-01 03:44:35 +03:00
|
|
|
DPRINTF(("audio_ioctl(%lu,'%c',%lu)\n",
|
2002-03-23 20:17:10 +03:00
|
|
|
IOCPARM_LEN(cmd), (char)IOCGROUP(cmd), cmd&0xff));
|
2005-01-15 19:23:03 +03:00
|
|
|
hw = sc->hw_if;
|
|
|
|
error = 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
switch (cmd) {
|
1997-08-01 21:04:00 +04:00
|
|
|
case FIONBIO:
|
|
|
|
/* All handled in the upper FS layer. */
|
|
|
|
break;
|
1997-08-11 05:38:12 +04:00
|
|
|
|
2003-05-26 16:43:35 +04:00
|
|
|
case FIONREAD:
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
*(int *)addr = audio_stream_get_used(sc->sc_rustream);
|
2003-05-26 16:43:35 +04:00
|
|
|
break;
|
|
|
|
|
1996-02-20 13:00:31 +03:00
|
|
|
case FIOASYNC:
|
|
|
|
if (*(int *)addr) {
|
1997-08-11 05:38:12 +04:00
|
|
|
if (sc->sc_async_audio)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EBUSY;
|
2005-12-11 15:16:03 +03:00
|
|
|
sc->sc_async_audio = l->l_proc;
|
|
|
|
DPRINTF(("audio_ioctl: FIOASYNC %p\n", l->l_proc));
|
1996-02-20 13:00:31 +03:00
|
|
|
} else
|
1997-08-11 05:38:12 +04:00
|
|
|
sc->sc_async_audio = 0;
|
1996-02-20 13:00:31 +03:00
|
|
|
break;
|
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
case AUDIO_FLUSH:
|
|
|
|
DPRINTF(("AUDIO_FLUSH\n"));
|
2002-03-23 20:17:10 +03:00
|
|
|
rbus = sc->sc_rbus;
|
|
|
|
pbus = sc->sc_pbus;
|
1995-02-21 04:35:58 +03:00
|
|
|
audio_clear(sc);
|
|
|
|
s = splaudio();
|
1997-08-25 02:31:23 +04:00
|
|
|
error = audio_initbufs(sc);
|
|
|
|
if (error) {
|
|
|
|
splx(s);
|
|
|
|
return error;
|
|
|
|
}
|
1997-12-03 04:01:19 +03:00
|
|
|
if ((sc->sc_mode & AUMODE_PLAY) && !sc->sc_pbus && pbus)
|
1997-08-25 02:31:23 +04:00
|
|
|
error = audiostartp(sc);
|
|
|
|
if (!error &&
|
1997-12-03 04:01:19 +03:00
|
|
|
(sc->sc_mode & AUMODE_RECORD) && !sc->sc_rbus && rbus)
|
1997-08-25 02:31:23 +04:00
|
|
|
error = audiostartr(sc);
|
1995-02-21 04:35:58 +03:00
|
|
|
splx(s);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/*
|
1996-02-17 05:28:56 +03:00
|
|
|
* Number of read (write) samples dropped. We don't know where or
|
1995-02-21 04:35:58 +03:00
|
|
|
* when they were dropped.
|
|
|
|
*/
|
|
|
|
case AUDIO_RERROR:
|
1997-07-27 05:16:32 +04:00
|
|
|
*(int *)addr = sc->sc_rr.drops;
|
1996-02-17 05:28:56 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AUDIO_PERROR:
|
1997-07-27 05:16:32 +04:00
|
|
|
*(int *)addr = sc->sc_pr.drops;
|
1995-02-21 04:35:58 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
/*
|
1997-07-27 05:16:32 +04:00
|
|
|
* Offsets into buffer.
|
1995-02-21 04:35:58 +03:00
|
|
|
*/
|
1997-07-27 05:16:32 +04:00
|
|
|
case AUDIO_GETIOFFS:
|
2003-10-02 11:15:20 +04:00
|
|
|
ao = (struct audio_offset *)addr;
|
1995-02-21 04:35:58 +03:00
|
|
|
s = splaudio();
|
1997-07-27 05:16:32 +04:00
|
|
|
/* figure out where next DMA will start */
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
stamp = sc->sc_rustream == &sc->sc_rr.s
|
|
|
|
? sc->sc_rr.stamp : sc->sc_rr.fstamp;
|
|
|
|
offs = sc->sc_rustream->inp - sc->sc_rustream->start;
|
1995-02-21 04:35:58 +03:00
|
|
|
splx(s);
|
2003-10-02 11:15:20 +04:00
|
|
|
ao->samples = stamp;
|
|
|
|
ao->deltablks =
|
|
|
|
(stamp / sc->sc_rr.blksize) -
|
|
|
|
(sc->sc_rr.stamp_last / sc->sc_rr.blksize);
|
|
|
|
sc->sc_rr.stamp_last = stamp;
|
|
|
|
ao->offset = offs;
|
1995-02-21 04:35:58 +03:00
|
|
|
break;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
|
|
|
case AUDIO_GETOOFFS:
|
2003-10-02 11:15:20 +04:00
|
|
|
ao = (struct audio_offset *)addr;
|
1997-07-27 05:16:32 +04:00
|
|
|
s = splaudio();
|
|
|
|
/* figure out where next DMA will start */
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
stamp = sc->sc_pustream == &sc->sc_pr.s
|
|
|
|
? sc->sc_pr.stamp : sc->sc_pr.fstamp;
|
|
|
|
offs = sc->sc_pustream->outp - sc->sc_pustream->start
|
|
|
|
+ sc->sc_pr.blksize;
|
2003-10-02 11:15:20 +04:00
|
|
|
splx(s);
|
|
|
|
ao->samples = stamp;
|
|
|
|
ao->deltablks =
|
|
|
|
(stamp / sc->sc_pr.blksize) -
|
|
|
|
(sc->sc_pr.stamp_last / sc->sc_pr.blksize);
|
|
|
|
sc->sc_pr.stamp_last = stamp;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (sc->sc_pustream->start + offs >= sc->sc_pustream->end)
|
1997-07-27 05:16:32 +04:00
|
|
|
offs = 0;
|
|
|
|
ao->offset = offs;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* How many bytes will elapse until mike hears the first
|
|
|
|
* sample of what we write next?
|
|
|
|
*/
|
|
|
|
case AUDIO_WSEEK:
|
2007-03-09 16:20:12 +03:00
|
|
|
*(u_long *)addr = audio_stream_get_used(sc->sc_pustream);
|
1997-07-27 05:16:32 +04:00
|
|
|
break;
|
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
case AUDIO_SETINFO:
|
1997-08-06 11:39:59 +04:00
|
|
|
DPRINTF(("AUDIO_SETINFO mode=0x%x\n", sc->sc_mode));
|
2003-04-25 07:02:11 +04:00
|
|
|
error = audiosetinfo(sc, (struct audio_info *)addr);
|
1995-02-21 04:35:58 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AUDIO_GETINFO:
|
|
|
|
DPRINTF(("AUDIO_GETINFO\n"));
|
2007-06-11 17:05:46 +04:00
|
|
|
error = audiogetinfo(sc, (struct audio_info *)addr, 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AUDIO_GETBUFINFO:
|
|
|
|
DPRINTF(("AUDIO_GETBUFINFO\n"));
|
|
|
|
error = audiogetinfo(sc, (struct audio_info *)addr, 1);
|
1995-02-21 04:35:58 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AUDIO_DRAIN:
|
|
|
|
DPRINTF(("AUDIO_DRAIN\n"));
|
|
|
|
error = audio_drain(sc);
|
|
|
|
if (!error && hw->drain)
|
|
|
|
error = hw->drain(sc->hw_hdl);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AUDIO_GETDEV:
|
|
|
|
DPRINTF(("AUDIO_GETDEV\n"));
|
|
|
|
error = hw->getdev(sc->hw_hdl, (audio_device_t *)addr);
|
|
|
|
break;
|
2002-03-23 20:17:10 +03:00
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
case AUDIO_GETENC:
|
|
|
|
DPRINTF(("AUDIO_GETENC\n"));
|
2005-01-15 19:23:03 +03:00
|
|
|
error = hw->query_encoding(sc->hw_hdl,
|
|
|
|
(struct audio_encoding *)addr);
|
1995-02-21 04:35:58 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AUDIO_GETFD:
|
|
|
|
DPRINTF(("AUDIO_GETFD\n"));
|
1997-10-11 15:16:28 +04:00
|
|
|
*(int *)addr = sc->sc_full_duplex;
|
1995-02-21 04:35:58 +03:00
|
|
|
break;
|
1997-10-11 15:16:28 +04:00
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
case AUDIO_SETFD:
|
|
|
|
DPRINTF(("AUDIO_SETFD\n"));
|
1997-08-19 01:19:02 +04:00
|
|
|
fd = *(int *)addr;
|
1997-08-01 02:33:08 +04:00
|
|
|
if (hw->get_props(sc->hw_hdl) & AUDIO_PROP_FULLDUPLEX) {
|
1997-07-28 03:51:48 +04:00
|
|
|
if (hw->setfd)
|
1997-08-19 01:19:02 +04:00
|
|
|
error = hw->setfd(sc->hw_hdl, fd);
|
1997-07-28 03:51:48 +04:00
|
|
|
else
|
|
|
|
error = 0;
|
|
|
|
if (!error)
|
1997-08-19 01:19:02 +04:00
|
|
|
sc->sc_full_duplex = fd;
|
1997-07-28 03:51:48 +04:00
|
|
|
} else {
|
1997-08-19 01:19:02 +04:00
|
|
|
if (fd)
|
1997-07-28 03:51:48 +04:00
|
|
|
error = ENOTTY;
|
|
|
|
else
|
|
|
|
error = 0;
|
|
|
|
}
|
1997-07-27 05:16:32 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AUDIO_GETPROPS:
|
|
|
|
DPRINTF(("AUDIO_GETPROPS\n"));
|
1997-08-01 02:33:08 +04:00
|
|
|
*(int *)addr = hw->get_props(sc->hw_hdl);
|
1995-02-21 04:35:58 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2001-10-03 04:04:47 +04:00
|
|
|
if (hw->dev_ioctl) {
|
2005-12-11 15:16:03 +03:00
|
|
|
error = hw->dev_ioctl(sc->hw_hdl, cmd, addr, flag, l);
|
2001-10-03 04:04:47 +04:00
|
|
|
} else {
|
|
|
|
DPRINTF(("audio_ioctl: unknown ioctl\n"));
|
|
|
|
error = EINVAL;
|
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
break;
|
|
|
|
}
|
2000-03-01 03:44:35 +03:00
|
|
|
DPRINTF(("audio_ioctl(%lu,'%c',%lu) result %d\n",
|
2002-03-23 20:17:10 +03:00
|
|
|
IOCPARM_LEN(cmd), (char)IOCGROUP(cmd), cmd&0xff, error));
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-12-11 15:16:03 +03:00
|
|
|
audio_poll(struct audio_softc *sc, int events, struct lwp *l)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
int revents;
|
|
|
|
int s;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
int used;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-08-25 02:31:23 +04:00
|
|
|
DPRINTF(("audio_poll: events=0x%x mode=%d\n", events, sc->sc_mode));
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
revents = 0;
|
|
|
|
s = splaudio();
|
2003-04-25 07:02:11 +04:00
|
|
|
if (events & (POLLIN | POLLRDNORM)) {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
used = audio_stream_get_used(sc->sc_rustream);
|
2002-06-02 06:00:30 +04:00
|
|
|
/*
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
* If half duplex and playing, audio_read() will generate
|
2002-06-02 06:00:30 +04:00
|
|
|
* silence at the play rate; poll for silence being
|
|
|
|
* available. Otherwise, poll for recorded sound.
|
|
|
|
*/
|
|
|
|
if ((!sc->sc_full_duplex && (sc->sc_mode & AUMODE_PLAY)) ?
|
2002-03-23 20:17:10 +03:00
|
|
|
sc->sc_pr.stamp > sc->sc_wstamp :
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
used > sc->sc_rr.usedlow)
|
1996-09-07 16:40:22 +04:00
|
|
|
revents |= events & (POLLIN | POLLRDNORM);
|
2003-04-25 07:02:11 +04:00
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2003-04-25 07:02:11 +04:00
|
|
|
if (events & (POLLOUT | POLLWRNORM)) {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
used = audio_stream_get_used(sc->sc_pustream);
|
2002-06-02 06:00:30 +04:00
|
|
|
/*
|
|
|
|
* If half duplex and recording, audio_write() will throw
|
|
|
|
* away play data, which means we are always ready to write.
|
|
|
|
* Otherwise, poll for play buffer being below its low water
|
|
|
|
* mark.
|
|
|
|
*/
|
|
|
|
if ((!sc->sc_full_duplex && (sc->sc_mode & AUMODE_RECORD)) ||
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
used <= sc->sc_pr.usedlow)
|
1996-09-07 16:40:22 +04:00
|
|
|
revents |= events & (POLLOUT | POLLWRNORM);
|
2003-04-25 07:02:11 +04:00
|
|
|
}
|
1996-09-07 16:40:22 +04:00
|
|
|
|
|
|
|
if (revents == 0) {
|
|
|
|
if (events & (POLLIN | POLLRDNORM))
|
2005-12-11 15:16:03 +03:00
|
|
|
selrecord(l, &sc->sc_rsel);
|
1996-09-07 16:40:22 +04:00
|
|
|
|
|
|
|
if (events & (POLLOUT | POLLWRNORM))
|
2005-12-11 15:16:03 +03:00
|
|
|
selrecord(l, &sc->sc_wsel);
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1996-09-07 16:40:22 +04:00
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
splx(s);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return revents;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
2002-10-23 13:10:23 +04:00
|
|
|
static void
|
|
|
|
filt_audiordetach(struct knote *kn)
|
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
2002-10-23 13:10:23 +04:00
|
|
|
int s;
|
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
sc = kn->kn_hook;
|
2002-10-23 13:10:23 +04:00
|
|
|
s = splaudio();
|
2002-11-26 21:49:40 +03:00
|
|
|
SLIST_REMOVE(&sc->sc_rsel.sel_klist, kn, knote, kn_selnext);
|
2002-10-23 13:10:23 +04:00
|
|
|
splx(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2006-11-16 04:32:37 +03:00
|
|
|
filt_audioread(struct knote *kn, long hint)
|
2002-10-23 13:10:23 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
2002-10-23 13:10:23 +04:00
|
|
|
int s;
|
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
sc = kn->kn_hook;
|
2002-10-23 13:10:23 +04:00
|
|
|
s = splaudio();
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (!sc->sc_full_duplex && (sc->sc_mode & AUMODE_PLAY))
|
2002-10-23 13:10:23 +04:00
|
|
|
kn->kn_data = sc->sc_pr.stamp - sc->sc_wstamp;
|
|
|
|
else
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
kn->kn_data = audio_stream_get_used(sc->sc_rustream)
|
|
|
|
- sc->sc_rr.usedlow;
|
2002-10-23 13:10:23 +04:00
|
|
|
splx(s);
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return kn->kn_data > 0;
|
2002-10-23 13:10:23 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct filterops audioread_filtops =
|
|
|
|
{ 1, NULL, filt_audiordetach, filt_audioread };
|
|
|
|
|
|
|
|
static void
|
|
|
|
filt_audiowdetach(struct knote *kn)
|
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
2002-10-23 13:10:23 +04:00
|
|
|
int s;
|
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
sc = kn->kn_hook;
|
2002-10-23 13:10:23 +04:00
|
|
|
s = splaudio();
|
2002-11-26 21:49:40 +03:00
|
|
|
SLIST_REMOVE(&sc->sc_wsel.sel_klist, kn, knote, kn_selnext);
|
2002-10-23 13:10:23 +04:00
|
|
|
splx(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2006-11-16 04:32:37 +03:00
|
|
|
filt_audiowrite(struct knote *kn, long hint)
|
2002-10-23 13:10:23 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_stream_t *stream;
|
2002-10-23 13:10:23 +04:00
|
|
|
int s;
|
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
sc = kn->kn_hook;
|
2002-10-23 13:10:23 +04:00
|
|
|
s = splaudio();
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
stream = sc->sc_pustream;
|
|
|
|
kn->kn_data = (stream->end - stream->start)
|
|
|
|
- audio_stream_get_used(stream);
|
2002-10-23 13:10:23 +04:00
|
|
|
splx(s);
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return kn->kn_data > 0;
|
2002-10-23 13:10:23 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct filterops audiowrite_filtops =
|
|
|
|
{ 1, NULL, filt_audiowdetach, filt_audiowrite };
|
|
|
|
|
|
|
|
int
|
|
|
|
audio_kqfilter(struct audio_softc *sc, struct knote *kn)
|
|
|
|
{
|
|
|
|
struct klist *klist;
|
|
|
|
int s;
|
|
|
|
|
|
|
|
switch (kn->kn_filter) {
|
|
|
|
case EVFILT_READ:
|
2002-11-26 21:49:40 +03:00
|
|
|
klist = &sc->sc_rsel.sel_klist;
|
2002-10-23 13:10:23 +04:00
|
|
|
kn->kn_fop = &audioread_filtops;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EVFILT_WRITE:
|
2002-11-26 21:49:40 +03:00
|
|
|
klist = &sc->sc_wsel.sel_klist;
|
2002-10-23 13:10:23 +04:00
|
|
|
kn->kn_fop = &audiowrite_filtops;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2007-12-05 20:19:46 +03:00
|
|
|
return EINVAL;
|
2002-10-23 13:10:23 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
kn->kn_hook = sc;
|
|
|
|
|
|
|
|
s = splaudio();
|
|
|
|
SLIST_INSERT_HEAD(klist, kn, kn_selnext);
|
|
|
|
splx(s);
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
2002-10-23 13:10:23 +04:00
|
|
|
}
|
|
|
|
|
2000-06-26 08:55:19 +04:00
|
|
|
paddr_t
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_mmap(struct audio_softc *sc, off_t off, int prot)
|
1996-09-02 01:33:43 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
const struct audio_hw_if *hw;
|
1997-07-27 05:16:32 +04:00
|
|
|
struct audio_ringbuffer *cb;
|
1999-09-09 14:24:39 +04:00
|
|
|
int s;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
2000-07-19 17:44:24 +04:00
|
|
|
DPRINTF(("audio_mmap: off=%lld, prot=%d\n", (long long)off, prot));
|
2005-01-15 19:23:03 +03:00
|
|
|
hw = sc->hw_if;
|
1997-08-01 02:33:08 +04:00
|
|
|
if (!(hw->get_props(sc->hw_hdl) & AUDIO_PROP_MMAP) || !hw->mappage)
|
1997-07-29 00:56:05 +04:00
|
|
|
return -1;
|
1997-07-27 05:16:32 +04:00
|
|
|
#if 0
|
|
|
|
/* XXX
|
|
|
|
* The idea here was to use the protection to determine if
|
|
|
|
* we are mapping the read or write buffer, but it fails.
|
|
|
|
* The VM system is broken in (at least) two ways.
|
|
|
|
* 1) If you map memory VM_PROT_WRITE you SIGSEGV
|
|
|
|
* when writing to it, so VM_PROT_READ|VM_PROT_WRITE
|
|
|
|
* has to be used for mmapping the play buffer.
|
|
|
|
* 2) Even if calling mmap() with VM_PROT_READ|VM_PROT_WRITE
|
|
|
|
* audio_mmap will get called at some point with VM_PROT_READ
|
|
|
|
* only.
|
|
|
|
* So, alas, we always map the play buffer for now.
|
|
|
|
*/
|
|
|
|
if (prot == (VM_PROT_READ|VM_PROT_WRITE) ||
|
|
|
|
prot == VM_PROT_WRITE)
|
|
|
|
cb = &sc->sc_pr;
|
|
|
|
else if (prot == VM_PROT_READ)
|
|
|
|
cb = &sc->sc_rr;
|
|
|
|
else
|
1997-07-29 00:56:05 +04:00
|
|
|
return -1;
|
1997-07-27 05:16:32 +04:00
|
|
|
#else
|
|
|
|
cb = &sc->sc_pr;
|
|
|
|
#endif
|
1996-09-02 01:33:43 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if ((u_int)off >= cb->s.bufsize)
|
1997-07-29 00:56:05 +04:00
|
|
|
return -1;
|
1997-07-27 05:16:32 +04:00
|
|
|
if (!cb->mmapped) {
|
2007-03-01 20:31:35 +03:00
|
|
|
cb->mmapped = true;
|
1997-07-27 05:16:32 +04:00
|
|
|
if (cb == &sc->sc_pr) {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_fill_silence(&cb->s.param, cb->s.start,
|
|
|
|
cb->s.bufsize);
|
1997-07-27 05:16:32 +04:00
|
|
|
s = splaudio();
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
sc->sc_pustream = &cb->s;
|
1997-07-27 05:16:32 +04:00
|
|
|
if (!sc->sc_pbus)
|
1997-08-25 02:31:23 +04:00
|
|
|
(void)audiostartp(sc);
|
1997-07-27 05:16:32 +04:00
|
|
|
splx(s);
|
|
|
|
} else {
|
|
|
|
s = splaudio();
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
sc->sc_rustream = &cb->s;
|
1997-07-27 05:16:32 +04:00
|
|
|
if (!sc->sc_rbus)
|
1997-08-25 02:31:23 +04:00
|
|
|
(void)audiostartr(sc);
|
1997-07-27 05:16:32 +04:00
|
|
|
splx(s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return hw->mappage(sc->hw_hdl, cb->s.start, off, prot);
|
1996-09-02 01:33:43 +04:00
|
|
|
}
|
|
|
|
|
1997-08-25 02:31:23 +04:00
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audiostartr(struct audio_softc *sc)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
1996-03-07 18:00:07 +03:00
|
|
|
int error;
|
2002-03-23 20:17:10 +03:00
|
|
|
|
|
|
|
DPRINTF(("audiostartr: start=%p used=%d(hi=%d) mmapped=%d\n",
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
sc->sc_rr.s.start, audio_stream_get_used(&sc->sc_rr.s),
|
|
|
|
sc->sc_rr.usedhigh, sc->sc_rr.mmapped));
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1998-08-10 00:28:07 +04:00
|
|
|
if (sc->hw_if->trigger_input)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
error = sc->hw_if->trigger_input(sc->hw_hdl, sc->sc_rr.s.start,
|
|
|
|
sc->sc_rr.s.end, sc->sc_rr.blksize,
|
|
|
|
audio_rint, (void *)sc, &sc->sc_rr.s.param);
|
1998-08-10 00:28:07 +04:00
|
|
|
else
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
error = sc->hw_if->start_input(sc->hw_hdl, sc->sc_rr.s.start,
|
1998-08-10 00:28:07 +04:00
|
|
|
sc->sc_rr.blksize, audio_rint, (void *)sc);
|
1996-03-07 18:00:07 +03:00
|
|
|
if (error) {
|
|
|
|
DPRINTF(("audiostartr failed: %d\n", error));
|
1997-08-25 02:31:23 +04:00
|
|
|
return error;
|
|
|
|
}
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_rbus = true;
|
1997-08-25 02:31:23 +04:00
|
|
|
return 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1997-08-25 02:31:23 +04:00
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audiostartp(struct audio_softc *sc)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
1996-03-07 18:00:07 +03:00
|
|
|
int error;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
int used;
|
2002-03-23 20:17:10 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
used = audio_stream_get_used(&sc->sc_pr.s);
|
2005-01-29 21:16:49 +03:00
|
|
|
DPRINTF(("audiostartp: start=%p used=%d(hi=%d blk=%d) mmapped=%d\n",
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
sc->sc_pr.s.start, used, sc->sc_pr.usedhigh,
|
2005-01-29 21:16:49 +03:00
|
|
|
sc->sc_pr.blksize, sc->sc_pr.mmapped));
|
2002-03-23 20:17:10 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (!sc->sc_pr.mmapped && used < sc->sc_pr.blksize) {
|
2004-07-08 02:30:22 +04:00
|
|
|
wakeup(&sc->sc_wchan);
|
2005-01-29 21:16:49 +03:00
|
|
|
DPRINTF(("%s: wakeup and return\n", __func__));
|
1998-08-10 00:28:07 +04:00
|
|
|
return 0;
|
2004-07-08 02:30:22 +04:00
|
|
|
}
|
1998-08-10 00:28:07 +04:00
|
|
|
|
2005-01-29 21:16:49 +03:00
|
|
|
if (sc->hw_if->trigger_output) {
|
|
|
|
DPRINTF(("%s: call trigger_output\n", __func__));
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
error = sc->hw_if->trigger_output(sc->hw_hdl, sc->sc_pr.s.start,
|
|
|
|
sc->sc_pr.s.end, sc->sc_pr.blksize,
|
2005-01-15 07:57:18 +03:00
|
|
|
audio_pint, (void *)sc, &sc->sc_pr.s.param);
|
2005-01-29 21:16:49 +03:00
|
|
|
} else {
|
|
|
|
DPRINTF(("%s: call start_output\n", __func__));
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
error = sc->hw_if->start_output(sc->hw_hdl,
|
|
|
|
__UNCONST(sc->sc_pr.s.outp), sc->sc_pr.blksize,
|
|
|
|
audio_pint, (void *)sc);
|
2005-01-29 21:16:49 +03:00
|
|
|
}
|
1998-08-10 00:28:07 +04:00
|
|
|
if (error) {
|
|
|
|
DPRINTF(("audiostartp failed: %d\n", error));
|
2002-03-23 20:17:10 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_pbus = true;
|
1997-08-25 02:31:23 +04:00
|
|
|
return 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1996-02-16 05:25:43 +03:00
|
|
|
/*
|
1997-07-27 05:16:32 +04:00
|
|
|
* When the play interrupt routine finds that the write isn't keeping
|
|
|
|
* the buffer filled it will insert silence in the buffer to make up
|
|
|
|
* for this. The part of the buffer that is filled with silence
|
1998-08-05 20:38:09 +04:00
|
|
|
* is kept track of in a very approximate way: it starts at sc_sil_start
|
|
|
|
* and extends sc_sil_count bytes. If there is already silence in
|
|
|
|
* the requested area nothing is done; so when the whole buffer is
|
|
|
|
* silent nothing happens. When the writer starts again sc_sil_count
|
|
|
|
* is set to 0.
|
1996-02-16 05:25:43 +03:00
|
|
|
*/
|
1997-07-27 05:16:32 +04:00
|
|
|
/* XXX
|
|
|
|
* Putting silence into the output buffer should not really be done
|
|
|
|
* at splaudio, but there is no softaudio level to do it at yet.
|
|
|
|
*/
|
2005-12-24 23:27:29 +03:00
|
|
|
static inline void
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_pint_silence(struct audio_softc *sc, struct audio_ringbuffer *cb,
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
uint8_t *inp, int cc)
|
1996-02-16 05:25:43 +03:00
|
|
|
{
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
uint8_t *s, *e, *p, *q;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
|
|
|
if (sc->sc_sil_count > 0) {
|
|
|
|
s = sc->sc_sil_start; /* start of silence */
|
1998-12-28 01:52:23 +03:00
|
|
|
e = s + sc->sc_sil_count; /* end of sil., may be beyond end */
|
1997-07-27 05:16:32 +04:00
|
|
|
p = inp; /* adjusted pointer to area to fill */
|
|
|
|
if (p < s)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
p += cb->s.end - cb->s.start;
|
|
|
|
q = p + cc;
|
1997-07-27 05:16:32 +04:00
|
|
|
/* Check if there is already silence. */
|
|
|
|
if (!(s <= p && p < e &&
|
|
|
|
s <= q && q <= e)) {
|
|
|
|
if (s <= p)
|
1998-04-28 13:07:12 +04:00
|
|
|
sc->sc_sil_count = max(sc->sc_sil_count, q-s);
|
1998-12-28 01:52:23 +03:00
|
|
|
DPRINTFN(5,("audio_pint_silence: fill cc=%d inp=%p, "
|
2002-03-23 20:17:10 +03:00
|
|
|
"count=%d size=%d\n",
|
|
|
|
cc, inp, sc->sc_sil_count,
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
(int)(cb->s.end - cb->s.start)));
|
|
|
|
audio_fill_silence(&cb->s.param, inp, cc);
|
1997-07-27 05:16:32 +04:00
|
|
|
} else {
|
1998-12-28 01:52:23 +03:00
|
|
|
DPRINTFN(5,("audio_pint_silence: already silent "
|
|
|
|
"cc=%d inp=%p\n", cc, inp));
|
2002-03-23 20:17:10 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
sc->sc_sil_start = inp;
|
|
|
|
sc->sc_sil_count = cc;
|
2002-03-23 20:17:10 +03:00
|
|
|
DPRINTFN(5, ("audio_pint_silence: start fill %p %d\n",
|
|
|
|
inp, cc));
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_fill_silence(&cb->s.param, inp, cc);
|
1997-07-27 05:16:32 +04:00
|
|
|
}
|
1996-02-16 05:25:43 +03:00
|
|
|
}
|
|
|
|
|
2007-02-10 00:55:00 +03:00
|
|
|
static void
|
|
|
|
audio_softintr_rd(void *cookie)
|
|
|
|
{
|
|
|
|
struct audio_softc *sc = cookie;
|
|
|
|
struct proc *p;
|
|
|
|
|
2007-02-15 21:12:05 +03:00
|
|
|
audio_wakeup(&sc->sc_rchan);
|
2008-03-01 17:16:49 +03:00
|
|
|
selnotify(&sc->sc_rsel, 0, 0);
|
2007-02-10 00:55:00 +03:00
|
|
|
if (sc->sc_async_audio != NULL) {
|
|
|
|
DPRINTFN(3, ("audio_softintr_rd: sending SIGIO %p\n",
|
|
|
|
sc->sc_async_audio));
|
|
|
|
mutex_enter(&proclist_mutex);
|
|
|
|
if ((p = sc->sc_async_audio) != NULL)
|
|
|
|
psignal(p, SIGIO);
|
|
|
|
mutex_exit(&proclist_mutex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
audio_softintr_wr(void *cookie)
|
|
|
|
{
|
|
|
|
struct audio_softc *sc = cookie;
|
|
|
|
struct proc *p;
|
|
|
|
|
2007-02-15 21:12:05 +03:00
|
|
|
audio_wakeup(&sc->sc_wchan);
|
2008-03-01 17:16:49 +03:00
|
|
|
selnotify(&sc->sc_wsel, 0, 0);
|
2007-02-10 00:55:00 +03:00
|
|
|
if (sc->sc_async_audio != NULL) {
|
|
|
|
DPRINTFN(3, ("audio_softintr_wr: sending SIGIO %p\n",
|
|
|
|
sc->sc_async_audio));
|
|
|
|
mutex_enter(&proclist_mutex);
|
|
|
|
if ((p = sc->sc_async_audio) != NULL)
|
|
|
|
psignal(p, SIGIO);
|
|
|
|
mutex_exit(&proclist_mutex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
/*
|
2003-05-03 22:10:37 +04:00
|
|
|
* Called from HW driver module on completion of DMA output.
|
1995-02-21 04:35:58 +03:00
|
|
|
* Start output of new block, wrap in ring buffer if needed.
|
|
|
|
* If no more buffers to play, output zero instead.
|
|
|
|
* Do a wakeup if necessary.
|
|
|
|
*/
|
|
|
|
void
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_pint(void *v)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
stream_fetcher_t null_fetcher;
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_softc *sc;
|
|
|
|
const struct audio_hw_if *hw;
|
|
|
|
struct audio_ringbuffer *cb;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
stream_fetcher_t *fetcher;
|
|
|
|
uint8_t *inp;
|
|
|
|
int cc, used;
|
1998-08-28 16:07:41 +04:00
|
|
|
int blksize;
|
1996-03-07 18:00:07 +03:00
|
|
|
int error;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
sc = v;
|
2002-03-23 20:17:10 +03:00
|
|
|
if (!sc->sc_open)
|
|
|
|
return; /* ignore interrupt if not open */
|
1997-10-16 20:41:18 +04:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
hw = sc->hw_if;
|
|
|
|
cb = &sc->sc_pr;
|
1998-08-28 16:07:41 +04:00
|
|
|
blksize = cb->blksize;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb->s.outp = audio_stream_add_outp(&cb->s, cb->s.outp, blksize);
|
|
|
|
cb->stamp += blksize;
|
1997-07-27 05:16:32 +04:00
|
|
|
if (cb->mmapped) {
|
2002-03-23 20:17:10 +03:00
|
|
|
DPRINTFN(5, ("audio_pint: mmapped outp=%p cc=%d inp=%p\n",
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb->s.outp, blksize, cb->s.inp));
|
2005-01-15 19:23:03 +03:00
|
|
|
if (hw->trigger_output == NULL)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
(void)hw->start_output(sc->hw_hdl, __UNCONST(cb->s.outp),
|
1998-08-28 16:07:41 +04:00
|
|
|
blksize, audio_pint, (void *)sc);
|
1997-07-27 05:16:32 +04:00
|
|
|
return;
|
|
|
|
}
|
2002-03-23 20:17:10 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
#ifdef AUDIO_INTR_TIME
|
|
|
|
{
|
|
|
|
struct timeval tv;
|
|
|
|
u_long t;
|
|
|
|
microtime(&tv);
|
|
|
|
t = tv.tv_usec + 1000000 * tv.tv_sec;
|
|
|
|
if (sc->sc_pnintr) {
|
|
|
|
long lastdelta, totdelta;
|
|
|
|
lastdelta = t - sc->sc_plastintr - sc->sc_pblktime;
|
1998-08-04 15:26:14 +04:00
|
|
|
if (lastdelta > sc->sc_pblktime / 3) {
|
1998-12-28 01:52:23 +03:00
|
|
|
printf("audio: play interrupt(%d) off "
|
2002-03-23 20:17:10 +03:00
|
|
|
"relative by %ld us (%lu)\n",
|
|
|
|
sc->sc_pnintr, lastdelta,
|
1998-12-28 01:52:23 +03:00
|
|
|
sc->sc_pblktime);
|
1997-07-27 05:16:32 +04:00
|
|
|
}
|
2002-03-23 20:17:10 +03:00
|
|
|
totdelta = t - sc->sc_pfirstintr -
|
1998-12-28 01:52:23 +03:00
|
|
|
sc->sc_pblktime * sc->sc_pnintr;
|
1998-08-04 15:26:14 +04:00
|
|
|
if (totdelta > sc->sc_pblktime) {
|
1998-12-28 01:52:23 +03:00
|
|
|
printf("audio: play interrupt(%d) off "
|
2002-03-23 20:17:10 +03:00
|
|
|
"absolute by %ld us (%lu) (LOST)\n",
|
|
|
|
sc->sc_pnintr, totdelta,
|
1998-12-28 01:52:23 +03:00
|
|
|
sc->sc_pblktime);
|
1997-07-27 05:16:32 +04:00
|
|
|
sc->sc_pnintr++; /* avoid repeated messages */
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
sc->sc_pfirstintr = t;
|
|
|
|
sc->sc_plastintr = t;
|
|
|
|
sc->sc_pnintr++;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
used = audio_stream_get_used(&cb->s);
|
|
|
|
/*
|
|
|
|
* "used <= cb->usedlow" should be "used < blksize" ideally.
|
|
|
|
* Some HW drivers such as uaudio(4) does not call audio_pint()
|
|
|
|
* at accurate timing. If used < blksize, uaudio(4) already
|
|
|
|
* request transfer of garbage data.
|
|
|
|
*/
|
|
|
|
if (used <= cb->usedlow && !cb->copying && sc->sc_npfilters > 0) {
|
|
|
|
/* we might have data in filter pipeline */
|
|
|
|
null_fetcher.fetch_to = null_fetcher_fetch_to;
|
|
|
|
fetcher = &sc->sc_pfilters[sc->sc_npfilters - 1]->base;
|
|
|
|
sc->sc_pfilters[0]->set_fetcher(sc->sc_pfilters[0],
|
|
|
|
&null_fetcher);
|
|
|
|
used = audio_stream_get_used(sc->sc_pustream);
|
|
|
|
cc = cb->s.end - cb->s.start;
|
2006-05-16 17:46:19 +04:00
|
|
|
if (blksize * 2 < cc)
|
|
|
|
cc = blksize * 2;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
fetcher->fetch_to(fetcher, &cb->s, cc);
|
2006-05-10 05:56:21 +04:00
|
|
|
cb->fstamp += used - audio_stream_get_used(sc->sc_pustream);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
used = audio_stream_get_used(&cb->s);
|
|
|
|
}
|
|
|
|
if (used < blksize) {
|
1997-07-27 05:16:32 +04:00
|
|
|
/* we don't have a full block to use */
|
|
|
|
if (cb->copying) {
|
|
|
|
/* writer is in progress, don't disturb */
|
2007-03-01 20:31:35 +03:00
|
|
|
cb->needfill = true;
|
1998-04-28 13:07:12 +04:00
|
|
|
DPRINTFN(1, ("audio_pint: copying in progress\n"));
|
1997-07-27 05:16:32 +04:00
|
|
|
} else {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
inp = cb->s.inp;
|
|
|
|
cc = blksize - (inp - cb->s.start) % blksize;
|
1997-07-27 05:16:32 +04:00
|
|
|
if (cb->pause)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb->pdrops += cc;
|
1997-07-27 05:16:32 +04:00
|
|
|
else {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb->drops += cc;
|
|
|
|
sc->sc_playdrop += cc;
|
1997-07-27 05:16:32 +04:00
|
|
|
}
|
|
|
|
audio_pint_silence(sc, cb, inp, cc);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb->s.inp = audio_stream_add_inp(&cb->s, inp, cc);
|
1997-07-27 05:16:32 +04:00
|
|
|
|
|
|
|
/* Clear next block so we keep ahead of the DMA. */
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
used = audio_stream_get_used(&cb->s);
|
|
|
|
if (used + cc < cb->s.end - cb->s.start)
|
1998-08-28 16:07:41 +04:00
|
|
|
audio_pint_silence(sc, cb, inp, blksize);
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
}
|
1997-07-27 05:16:32 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
DPRINTFN(5, ("audio_pint: outp=%p cc=%d\n", cb->s.outp, blksize));
|
2005-01-15 19:23:03 +03:00
|
|
|
if (hw->trigger_output == NULL) {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
error = hw->start_output(sc->hw_hdl, __UNCONST(cb->s.outp),
|
|
|
|
blksize, audio_pint, (void *)sc);
|
1998-08-10 00:28:07 +04:00
|
|
|
if (error) {
|
|
|
|
/* XXX does this really help? */
|
|
|
|
DPRINTF(("audio_pint restart failed: %d\n", error));
|
|
|
|
audio_clear(sc);
|
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1998-09-01 11:27:06 +04:00
|
|
|
DPRINTFN(2, ("audio_pint: mode=%d pause=%d used=%d lowat=%d\n",
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
sc->sc_mode, cb->pause,
|
|
|
|
audio_stream_get_used(sc->sc_pustream), cb->usedlow));
|
1997-07-27 05:16:32 +04:00
|
|
|
if ((sc->sc_mode & AUMODE_PLAY) && !cb->pause) {
|
2007-02-15 21:12:05 +03:00
|
|
|
if (audio_stream_get_used(sc->sc_pustream) <= cb->usedlow)
|
2007-10-08 20:18:02 +04:00
|
|
|
softint_schedule(sc->sc_sih_wr);
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
/* Possible to return one or more "phantom blocks" now. */
|
2007-02-15 21:12:05 +03:00
|
|
|
if (!sc->sc_full_duplex && sc->sc_rchan)
|
2007-10-08 20:18:02 +04:00
|
|
|
softint_schedule(sc->sc_sih_rd);
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2003-05-03 22:10:37 +04:00
|
|
|
* Called from HW driver module on completion of DMA input.
|
1995-02-21 04:35:58 +03:00
|
|
|
* Mark it as input in the ring buffer (fiddle pointers).
|
|
|
|
* Do a wakeup if necessary.
|
|
|
|
*/
|
|
|
|
void
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_rint(void *v)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
stream_fetcher_t null_fetcher;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
struct audio_softc *sc;
|
|
|
|
const struct audio_hw_if *hw;
|
|
|
|
struct audio_ringbuffer *cb;
|
|
|
|
stream_fetcher_t *last_fetcher;
|
|
|
|
int cc;
|
|
|
|
int used;
|
1998-08-28 16:07:41 +04:00
|
|
|
int blksize;
|
1996-03-07 18:00:07 +03:00
|
|
|
int error;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
sc = v;
|
|
|
|
cb = &sc->sc_rr;
|
2002-03-23 20:17:10 +03:00
|
|
|
if (!sc->sc_open)
|
|
|
|
return; /* ignore interrupt if not open */
|
1997-10-19 11:41:33 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
hw = sc->hw_if;
|
1998-08-28 16:07:41 +04:00
|
|
|
blksize = cb->blksize;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb->s.inp = audio_stream_add_inp(&cb->s, cb->s.inp, blksize);
|
1998-08-28 16:07:41 +04:00
|
|
|
cb->stamp += blksize;
|
1997-07-27 05:16:32 +04:00
|
|
|
if (cb->mmapped) {
|
2002-03-23 20:17:10 +03:00
|
|
|
DPRINTFN(2, ("audio_rint: mmapped inp=%p cc=%d\n",
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb->s.inp, blksize));
|
2005-01-15 19:23:03 +03:00
|
|
|
if (hw->trigger_input == NULL)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
(void)hw->start_input(sc->hw_hdl, cb->s.inp, blksize,
|
1998-08-10 00:28:07 +04:00
|
|
|
audio_rint, (void *)sc);
|
1997-07-27 05:16:32 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef AUDIO_INTR_TIME
|
|
|
|
{
|
|
|
|
struct timeval tv;
|
|
|
|
u_long t;
|
|
|
|
microtime(&tv);
|
|
|
|
t = tv.tv_usec + 1000000 * tv.tv_sec;
|
|
|
|
if (sc->sc_rnintr) {
|
|
|
|
long lastdelta, totdelta;
|
|
|
|
lastdelta = t - sc->sc_rlastintr - sc->sc_rblktime;
|
|
|
|
if (lastdelta > sc->sc_rblktime / 5) {
|
1998-12-28 01:52:23 +03:00
|
|
|
printf("audio: record interrupt(%d) off "
|
2002-03-23 20:17:10 +03:00
|
|
|
"relative by %ld us (%lu)\n",
|
|
|
|
sc->sc_rnintr, lastdelta,
|
1998-12-28 01:52:23 +03:00
|
|
|
sc->sc_rblktime);
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
2002-03-23 20:17:10 +03:00
|
|
|
totdelta = t - sc->sc_rfirstintr -
|
1998-12-28 01:52:23 +03:00
|
|
|
sc->sc_rblktime * sc->sc_rnintr;
|
1997-07-27 05:16:32 +04:00
|
|
|
if (totdelta > sc->sc_rblktime / 2) {
|
|
|
|
sc->sc_rnintr++;
|
1998-12-28 01:52:23 +03:00
|
|
|
printf("audio: record interrupt(%d) off "
|
2002-03-23 20:17:10 +03:00
|
|
|
"absolute by %ld us (%lu)\n",
|
|
|
|
sc->sc_rnintr, totdelta,
|
1998-12-28 01:52:23 +03:00
|
|
|
sc->sc_rblktime);
|
1997-07-27 05:16:32 +04:00
|
|
|
sc->sc_rnintr++; /* avoid repeated messages */
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
sc->sc_rfirstintr = t;
|
|
|
|
sc->sc_rlastintr = t;
|
|
|
|
sc->sc_rnintr++;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1997-07-27 05:16:32 +04:00
|
|
|
#endif
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (!cb->pause && sc->sc_nrfilters > 0) {
|
|
|
|
null_fetcher.fetch_to = null_fetcher_fetch_to;
|
|
|
|
last_fetcher = &sc->sc_rfilters[sc->sc_nrfilters - 1]->base;
|
|
|
|
sc->sc_rfilters[0]->set_fetcher(sc->sc_rfilters[0],
|
|
|
|
&null_fetcher);
|
|
|
|
used = audio_stream_get_used(sc->sc_rustream);
|
|
|
|
cc = sc->sc_rustream->end - sc->sc_rustream->start;
|
|
|
|
error = last_fetcher->fetch_to
|
|
|
|
(last_fetcher, sc->sc_rustream, cc);
|
|
|
|
cb->fstamp += audio_stream_get_used(sc->sc_rustream) - used;
|
|
|
|
/* XXX what should do for error? */
|
|
|
|
}
|
|
|
|
used = audio_stream_get_used(&sc->sc_rr.s);
|
1997-07-27 05:16:32 +04:00
|
|
|
if (cb->pause) {
|
1998-04-28 13:07:12 +04:00
|
|
|
DPRINTFN(1, ("audio_rint: pdrops %lu\n", cb->pdrops));
|
1998-08-28 16:07:41 +04:00
|
|
|
cb->pdrops += blksize;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb->s.outp = audio_stream_add_outp(&cb->s, cb->s.outp, blksize);
|
|
|
|
} else if (used + blksize > cb->s.end - cb->s.start && !cb->copying) {
|
1998-04-28 13:07:12 +04:00
|
|
|
DPRINTFN(1, ("audio_rint: drops %lu\n", cb->drops));
|
1998-08-28 16:07:41 +04:00
|
|
|
cb->drops += blksize;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
cb->s.outp = audio_stream_add_outp(&cb->s, cb->s.outp, blksize);
|
1997-07-27 05:16:32 +04:00
|
|
|
}
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
DPRINTFN(2, ("audio_rint: inp=%p cc=%d\n", cb->s.inp, blksize));
|
2005-01-15 19:23:03 +03:00
|
|
|
if (hw->trigger_input == NULL) {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
error = hw->start_input(sc->hw_hdl, cb->s.inp, blksize,
|
1998-08-10 00:28:07 +04:00
|
|
|
audio_rint, (void *)sc);
|
|
|
|
if (error) {
|
|
|
|
/* XXX does this really help? */
|
|
|
|
DPRINTF(("audio_rint: restart failed: %d\n", error));
|
|
|
|
audio_clear(sc);
|
|
|
|
}
|
1997-07-27 05:16:32 +04:00
|
|
|
}
|
|
|
|
|
2007-10-08 20:18:02 +04:00
|
|
|
softint_schedule(sc->sc_sih_rd);
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1997-03-20 09:48:48 +03:00
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audio_check_params(struct audio_params *p)
|
1997-03-20 09:48:48 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
|
1997-07-15 11:46:04 +04:00
|
|
|
if (p->encoding == AUDIO_ENCODING_PCM16) {
|
|
|
|
if (p->precision == 8)
|
|
|
|
p->encoding = AUDIO_ENCODING_ULINEAR;
|
|
|
|
else
|
|
|
|
p->encoding = AUDIO_ENCODING_SLINEAR;
|
|
|
|
} else if (p->encoding == AUDIO_ENCODING_PCM8) {
|
|
|
|
if (p->precision == 8)
|
|
|
|
p->encoding = AUDIO_ENCODING_ULINEAR;
|
|
|
|
else
|
|
|
|
return EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p->encoding == AUDIO_ENCODING_SLINEAR)
|
1997-05-07 22:51:31 +04:00
|
|
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
1997-07-15 11:46:04 +04:00
|
|
|
p->encoding = AUDIO_ENCODING_SLINEAR_LE;
|
1997-05-07 22:51:31 +04:00
|
|
|
#else
|
1997-07-15 11:46:04 +04:00
|
|
|
p->encoding = AUDIO_ENCODING_SLINEAR_BE;
|
1997-05-07 22:51:31 +04:00
|
|
|
#endif
|
|
|
|
if (p->encoding == AUDIO_ENCODING_ULINEAR)
|
|
|
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
|
|
|
p->encoding = AUDIO_ENCODING_ULINEAR_LE;
|
|
|
|
#else
|
|
|
|
p->encoding = AUDIO_ENCODING_ULINEAR_BE;
|
|
|
|
#endif
|
1997-03-20 09:48:48 +03:00
|
|
|
|
1997-04-30 01:01:33 +04:00
|
|
|
switch (p->encoding) {
|
1997-03-20 09:48:48 +03:00
|
|
|
case AUDIO_ENCODING_ULAW:
|
|
|
|
case AUDIO_ENCODING_ALAW:
|
1997-04-30 01:01:33 +04:00
|
|
|
if (p->precision != 8)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EINVAL;
|
1997-03-20 09:48:48 +03:00
|
|
|
break;
|
2001-05-02 16:49:41 +04:00
|
|
|
case AUDIO_ENCODING_ADPCM:
|
|
|
|
if (p->precision != 4 && p->precision != 8)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EINVAL;
|
2001-05-02 16:49:41 +04:00
|
|
|
break;
|
1997-07-15 11:46:04 +04:00
|
|
|
case AUDIO_ENCODING_SLINEAR_LE:
|
|
|
|
case AUDIO_ENCODING_SLINEAR_BE:
|
1997-05-07 22:51:31 +04:00
|
|
|
case AUDIO_ENCODING_ULINEAR_LE:
|
|
|
|
case AUDIO_ENCODING_ULINEAR_BE:
|
2001-09-03 22:51:43 +04:00
|
|
|
/* XXX is: our zero-fill can handle any multiple of 8 */
|
|
|
|
if (p->precision != 8 && p->precision != 16 &&
|
|
|
|
p->precision != 24 && p->precision != 32)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EINVAL;
|
|
|
|
if (p->precision == 8 && p->encoding == AUDIO_ENCODING_SLINEAR_BE)
|
|
|
|
p->encoding = AUDIO_ENCODING_SLINEAR_LE;
|
|
|
|
if (p->precision == 8 && p->encoding == AUDIO_ENCODING_ULINEAR_BE)
|
|
|
|
p->encoding = AUDIO_ENCODING_ULINEAR_LE;
|
|
|
|
if (p->validbits > p->precision)
|
|
|
|
return EINVAL;
|
1997-03-20 09:48:48 +03:00
|
|
|
break;
|
1997-10-17 03:57:56 +04:00
|
|
|
case AUDIO_ENCODING_MPEG_L1_STREAM:
|
|
|
|
case AUDIO_ENCODING_MPEG_L1_PACKETS:
|
|
|
|
case AUDIO_ENCODING_MPEG_L1_SYSTEM:
|
|
|
|
case AUDIO_ENCODING_MPEG_L2_STREAM:
|
|
|
|
case AUDIO_ENCODING_MPEG_L2_PACKETS:
|
|
|
|
case AUDIO_ENCODING_MPEG_L2_SYSTEM:
|
|
|
|
break;
|
1997-03-20 09:48:48 +03:00
|
|
|
default:
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return EINVAL;
|
1997-03-20 09:48:48 +03:00
|
|
|
}
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
/* sanity check # of channels*/
|
|
|
|
if (p->channels < 1 || p->channels > AUDIO_MAX_CHANNELS)
|
|
|
|
return EINVAL;
|
1997-07-28 03:06:04 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
1997-03-20 09:48:48 +03:00
|
|
|
}
|
|
|
|
|
2003-10-02 11:15:20 +04:00
|
|
|
int
|
|
|
|
audio_set_defaults(struct audio_softc *sc, u_int mode)
|
|
|
|
{
|
|
|
|
struct audio_info ai;
|
|
|
|
|
|
|
|
/* default parameters */
|
|
|
|
sc->sc_rparams = audio_default;
|
|
|
|
sc->sc_pparams = audio_default;
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_blkset = false;
|
2003-10-02 11:15:20 +04:00
|
|
|
|
|
|
|
AUDIO_INITINFO(&ai);
|
|
|
|
ai.record.sample_rate = sc->sc_rparams.sample_rate;
|
|
|
|
ai.record.encoding = sc->sc_rparams.encoding;
|
|
|
|
ai.record.channels = sc->sc_rparams.channels;
|
|
|
|
ai.record.precision = sc->sc_rparams.precision;
|
|
|
|
ai.play.sample_rate = sc->sc_pparams.sample_rate;
|
|
|
|
ai.play.encoding = sc->sc_pparams.encoding;
|
|
|
|
ai.play.channels = sc->sc_pparams.channels;
|
|
|
|
ai.play.precision = sc->sc_pparams.precision;
|
|
|
|
ai.mode = mode;
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return audiosetinfo(sc, &ai);
|
2003-10-02 11:15:20 +04:00
|
|
|
}
|
|
|
|
|
1997-10-19 11:41:33 +04:00
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
au_set_lr_value(struct audio_softc *sc, mixer_ctrl_t *ct, int l, int r)
|
1997-10-19 11:41:33 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
|
1997-10-19 11:41:33 +04:00
|
|
|
ct->type = AUDIO_MIXER_VALUE;
|
|
|
|
ct->un.value.num_channels = 2;
|
|
|
|
ct->un.value.level[AUDIO_MIXER_LEVEL_LEFT] = l;
|
|
|
|
ct->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] = r;
|
|
|
|
if (sc->hw_if->set_port(sc->hw_hdl, ct) == 0)
|
|
|
|
return 0;
|
|
|
|
ct->un.value.num_channels = 1;
|
|
|
|
ct->un.value.level[AUDIO_MIXER_LEVEL_MONO] = (l+r)/2;
|
|
|
|
return sc->hw_if->set_port(sc->hw_hdl, ct);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
au_set_gain(struct audio_softc *sc, struct au_mixer_ports *ports,
|
|
|
|
int gain, int balance)
|
1997-10-19 11:41:33 +04:00
|
|
|
{
|
|
|
|
mixer_ctrl_t ct;
|
|
|
|
int i, error;
|
|
|
|
int l, r;
|
|
|
|
u_int mask;
|
|
|
|
int nset;
|
|
|
|
|
|
|
|
if (balance == AUDIO_MID_BALANCE) {
|
|
|
|
l = r = gain;
|
|
|
|
} else if (balance < AUDIO_MID_BALANCE) {
|
|
|
|
l = gain;
|
2002-11-08 08:02:07 +03:00
|
|
|
r = (balance * gain) / AUDIO_MID_BALANCE;
|
|
|
|
} else {
|
|
|
|
r = gain;
|
|
|
|
l = ((AUDIO_RIGHT_BALANCE - balance) * gain)
|
1997-10-19 11:41:33 +04:00
|
|
|
/ AUDIO_MID_BALANCE;
|
|
|
|
}
|
|
|
|
DPRINTF(("au_set_gain: gain=%d balance=%d, l=%d r=%d\n",
|
|
|
|
gain, balance, l, r));
|
|
|
|
|
|
|
|
if (ports->index == -1) {
|
|
|
|
usemaster:
|
|
|
|
if (ports->master == -1)
|
|
|
|
return 0; /* just ignore it silently */
|
|
|
|
ct.dev = ports->master;
|
|
|
|
error = au_set_lr_value(sc, &ct, l, r);
|
|
|
|
} else {
|
|
|
|
ct.dev = ports->index;
|
|
|
|
if (ports->isenum) {
|
|
|
|
ct.type = AUDIO_MIXER_ENUM;
|
|
|
|
error = sc->hw_if->get_port(sc->hw_hdl, &ct);
|
|
|
|
if (error)
|
|
|
|
return error;
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
if (ports->isdual) {
|
|
|
|
if (ports->cur_port == -1)
|
|
|
|
ct.dev = ports->master;
|
|
|
|
else
|
|
|
|
ct.dev = ports->miport[ports->cur_port];
|
|
|
|
error = au_set_lr_value(sc, &ct, l, r);
|
|
|
|
} else {
|
|
|
|
for(i = 0; i < ports->nports; i++)
|
|
|
|
if (ports->misel[i] == ct.un.ord) {
|
|
|
|
ct.dev = ports->miport[i];
|
|
|
|
if (ct.dev == -1 ||
|
|
|
|
au_set_lr_value(sc, &ct, l, r))
|
|
|
|
goto usemaster;
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ct.type = AUDIO_MIXER_SET;
|
|
|
|
error = sc->hw_if->get_port(sc->hw_hdl, &ct);
|
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
mask = ct.un.mask;
|
|
|
|
nset = 0;
|
|
|
|
for(i = 0; i < ports->nports; i++) {
|
|
|
|
if (ports->misel[i] & mask) {
|
|
|
|
ct.dev = ports->miport[i];
|
|
|
|
if (ct.dev != -1 &&
|
|
|
|
au_set_lr_value(sc, &ct, l, r) == 0)
|
|
|
|
nset++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (nset == 0)
|
|
|
|
goto usemaster;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!error)
|
|
|
|
mixer_signal(sc);
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
au_get_lr_value(struct audio_softc *sc, mixer_ctrl_t *ct, int *l, int *r)
|
1997-10-19 11:41:33 +04:00
|
|
|
{
|
|
|
|
int error;
|
|
|
|
|
|
|
|
ct->un.value.num_channels = 2;
|
|
|
|
if (sc->hw_if->get_port(sc->hw_hdl, ct) == 0) {
|
|
|
|
*l = ct->un.value.level[AUDIO_MIXER_LEVEL_LEFT];
|
|
|
|
*r = ct->un.value.level[AUDIO_MIXER_LEVEL_RIGHT];
|
|
|
|
} else {
|
|
|
|
ct->un.value.num_channels = 1;
|
|
|
|
error = sc->hw_if->get_port(sc->hw_hdl, ct);
|
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
*r = *l = ct->un.value.level[AUDIO_MIXER_LEVEL_MONO];
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-10-03 03:31:54 +04:00
|
|
|
au_get_gain(struct audio_softc *sc, struct au_mixer_ports *ports,
|
|
|
|
u_int *pgain, u_char *pbalance)
|
1997-10-19 11:41:33 +04:00
|
|
|
{
|
|
|
|
mixer_ctrl_t ct;
|
|
|
|
int i, l, r, n;
|
2005-01-15 19:23:03 +03:00
|
|
|
int lgain, rgain;
|
1997-10-19 11:41:33 +04:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
lgain = AUDIO_MAX_GAIN / 2;
|
|
|
|
rgain = AUDIO_MAX_GAIN / 2;
|
1997-10-19 11:41:33 +04:00
|
|
|
if (ports->index == -1) {
|
|
|
|
usemaster:
|
|
|
|
if (ports->master == -1)
|
|
|
|
goto bad;
|
|
|
|
ct.dev = ports->master;
|
|
|
|
ct.type = AUDIO_MIXER_VALUE;
|
|
|
|
if (au_get_lr_value(sc, &ct, &lgain, &rgain))
|
|
|
|
goto bad;
|
|
|
|
} else {
|
|
|
|
ct.dev = ports->index;
|
|
|
|
if (ports->isenum) {
|
|
|
|
ct.type = AUDIO_MIXER_ENUM;
|
|
|
|
if (sc->hw_if->get_port(sc->hw_hdl, &ct))
|
|
|
|
goto bad;
|
|
|
|
ct.type = AUDIO_MIXER_VALUE;
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
if (ports->isdual) {
|
|
|
|
if (ports->cur_port == -1)
|
|
|
|
ct.dev = ports->master;
|
|
|
|
else
|
|
|
|
ct.dev = ports->miport[ports->cur_port];
|
|
|
|
au_get_lr_value(sc, &ct, &lgain, &rgain);
|
|
|
|
} else {
|
|
|
|
for(i = 0; i < ports->nports; i++)
|
|
|
|
if (ports->misel[i] == ct.un.ord) {
|
|
|
|
ct.dev = ports->miport[i];
|
|
|
|
if (ct.dev == -1 ||
|
|
|
|
au_get_lr_value(sc, &ct,
|
|
|
|
&lgain, &rgain))
|
|
|
|
goto usemaster;
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ct.type = AUDIO_MIXER_SET;
|
|
|
|
if (sc->hw_if->get_port(sc->hw_hdl, &ct))
|
|
|
|
goto bad;
|
|
|
|
ct.type = AUDIO_MIXER_VALUE;
|
|
|
|
lgain = rgain = n = 0;
|
|
|
|
for(i = 0; i < ports->nports; i++) {
|
|
|
|
if (ports->misel[i] & ct.un.mask) {
|
|
|
|
ct.dev = ports->miport[i];
|
|
|
|
if (ct.dev == -1 ||
|
|
|
|
au_get_lr_value(sc, &ct, &l, &r))
|
|
|
|
goto usemaster;
|
|
|
|
else {
|
|
|
|
lgain += l;
|
|
|
|
rgain += r;
|
|
|
|
n++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (n != 0) {
|
|
|
|
lgain /= n;
|
|
|
|
rgain /= n;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bad:
|
|
|
|
if (lgain == rgain) { /* handles lgain==rgain==0 */
|
|
|
|
*pgain = lgain;
|
|
|
|
*pbalance = AUDIO_MID_BALANCE;
|
|
|
|
} else if (lgain < rgain) {
|
|
|
|
*pgain = rgain;
|
2002-11-08 08:02:07 +03:00
|
|
|
/* balance should be > AUDIO_MID_BALANCE */
|
|
|
|
*pbalance = AUDIO_RIGHT_BALANCE -
|
|
|
|
(AUDIO_MID_BALANCE * lgain) / rgain;
|
1997-10-19 11:41:33 +04:00
|
|
|
} else /* lgain > rgain */ {
|
|
|
|
*pgain = lgain;
|
2002-11-08 08:02:07 +03:00
|
|
|
/* balance should be < AUDIO_MID_BALANCE */
|
|
|
|
*pbalance = (AUDIO_MID_BALANCE * rgain) / lgain;
|
1997-10-19 11:41:33 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
au_set_port(struct audio_softc *sc, struct au_mixer_ports *ports, u_int port)
|
1997-10-19 11:41:33 +04:00
|
|
|
{
|
|
|
|
mixer_ctrl_t ct;
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
int i, error, use_mixerout;
|
|
|
|
|
|
|
|
use_mixerout = 1;
|
|
|
|
if (port == 0) {
|
|
|
|
if (ports->allports == 0)
|
|
|
|
return 0; /* Allow this special case. */
|
|
|
|
else if (ports->isdual) {
|
|
|
|
if (ports->cur_port == -1) {
|
|
|
|
return 0;
|
|
|
|
} else {
|
|
|
|
port = ports->aumask[ports->cur_port];
|
|
|
|
ports->cur_port = -1;
|
|
|
|
use_mixerout = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
if (ports->index == -1)
|
|
|
|
return EINVAL;
|
|
|
|
ct.dev = ports->index;
|
|
|
|
if (ports->isenum) {
|
|
|
|
if (port & (port-1))
|
|
|
|
return EINVAL; /* Only one port allowed */
|
|
|
|
ct.type = AUDIO_MIXER_ENUM;
|
|
|
|
error = EINVAL;
|
|
|
|
for(i = 0; i < ports->nports; i++)
|
|
|
|
if (ports->aumask[i] == port) {
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
if (ports->isdual && use_mixerout) {
|
|
|
|
ct.un.ord = ports->mixerout;
|
|
|
|
ports->cur_port = i;
|
|
|
|
} else {
|
|
|
|
ct.un.ord = ports->misel[i];
|
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
error = sc->hw_if->set_port(sc->hw_hdl, &ct);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ct.type = AUDIO_MIXER_SET;
|
|
|
|
ct.un.mask = 0;
|
|
|
|
for(i = 0; i < ports->nports; i++)
|
2002-03-23 20:17:10 +03:00
|
|
|
if (ports->aumask[i] & port)
|
1997-10-19 11:41:33 +04:00
|
|
|
ct.un.mask |= ports->misel[i];
|
|
|
|
if (port != 0 && ct.un.mask == 0)
|
|
|
|
error = EINVAL;
|
|
|
|
else
|
|
|
|
error = sc->hw_if->set_port(sc->hw_hdl, &ct);
|
|
|
|
}
|
|
|
|
if (!error)
|
|
|
|
mixer_signal(sc);
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
au_get_port(struct audio_softc *sc, struct au_mixer_ports *ports)
|
1997-10-19 11:41:33 +04:00
|
|
|
{
|
|
|
|
mixer_ctrl_t ct;
|
|
|
|
int i, aumask;
|
|
|
|
|
|
|
|
if (ports->index == -1)
|
|
|
|
return 0;
|
|
|
|
ct.dev = ports->index;
|
|
|
|
ct.type = ports->isenum ? AUDIO_MIXER_ENUM : AUDIO_MIXER_SET;
|
|
|
|
if (sc->hw_if->get_port(sc->hw_hdl, &ct))
|
|
|
|
return 0;
|
|
|
|
aumask = 0;
|
|
|
|
if (ports->isenum) {
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
if (ports->isdual && ports->cur_port != -1) {
|
|
|
|
if (ports->mixerout == ct.un.ord)
|
|
|
|
aumask = ports->aumask[ports->cur_port];
|
|
|
|
else
|
|
|
|
ports->cur_port = -1;
|
|
|
|
}
|
|
|
|
if (aumask == 0)
|
|
|
|
for(i = 0; i < ports->nports; i++)
|
|
|
|
if (ports->misel[i] == ct.un.ord)
|
|
|
|
aumask = ports->aumask[i];
|
1997-10-19 11:41:33 +04:00
|
|
|
} else {
|
|
|
|
for(i = 0; i < ports->nports; i++)
|
|
|
|
if (ct.un.mask & ports->misel[i])
|
|
|
|
aumask |= ports->aumask[i];
|
|
|
|
}
|
|
|
|
return aumask;
|
|
|
|
}
|
|
|
|
|
1995-04-18 03:04:31 +04:00
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audiosetinfo(struct audio_softc *sc, struct audio_info *ai)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
stream_filter_list_t pfilters, rfilters;
|
|
|
|
audio_params_t pp, rp;
|
|
|
|
struct audio_prinfo *r, *p;
|
|
|
|
const struct audio_hw_if *hw;
|
|
|
|
audio_stream_t *oldpus, *oldrus;
|
|
|
|
int s, setmode;
|
1997-08-25 02:31:23 +04:00
|
|
|
int error;
|
1997-04-30 01:01:33 +04:00
|
|
|
int np, nr;
|
1997-07-27 05:16:32 +04:00
|
|
|
unsigned int blks;
|
1997-08-19 03:20:09 +04:00
|
|
|
int oldpblksize, oldrblksize;
|
1997-10-19 11:41:33 +04:00
|
|
|
u_int gain;
|
2007-02-22 01:59:35 +03:00
|
|
|
bool rbus, pbus;
|
|
|
|
bool cleared, modechange, pausechange;
|
1997-10-19 11:41:33 +04:00
|
|
|
u_char balance;
|
2002-03-23 20:17:10 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
hw = sc->hw_if;
|
2005-01-15 19:23:03 +03:00
|
|
|
if (hw == NULL) /* HW has not attached */
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return ENXIO;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
DPRINTF(("%s sc=%p ai=%p\n", __func__, sc, ai));
|
|
|
|
r = &ai->record;
|
|
|
|
p = &ai->play;
|
1997-08-25 02:31:23 +04:00
|
|
|
rbus = sc->sc_rbus;
|
|
|
|
pbus = sc->sc_pbus;
|
|
|
|
error = 0;
|
2007-03-01 20:31:35 +03:00
|
|
|
cleared = false;
|
|
|
|
modechange = false;
|
|
|
|
pausechange = false;
|
1997-08-25 02:31:23 +04:00
|
|
|
|
|
|
|
pp = sc->sc_pparams; /* Temporary encoding storage in */
|
|
|
|
rp = sc->sc_rparams; /* case setting the modes fails. */
|
1997-04-30 01:01:33 +04:00
|
|
|
nr = np = 0;
|
1997-08-19 03:20:09 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(p->sample_rate)) {
|
1997-04-30 01:01:33 +04:00
|
|
|
pp.sample_rate = p->sample_rate;
|
|
|
|
np++;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(r->sample_rate)) {
|
1997-04-30 01:01:33 +04:00
|
|
|
rp.sample_rate = r->sample_rate;
|
|
|
|
nr++;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(p->encoding)) {
|
1997-04-30 01:01:33 +04:00
|
|
|
pp.encoding = p->encoding;
|
|
|
|
np++;
|
2002-03-23 20:17:10 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(r->encoding)) {
|
1997-04-30 01:01:33 +04:00
|
|
|
rp.encoding = r->encoding;
|
|
|
|
nr++;
|
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(p->precision)) {
|
1997-04-30 01:01:33 +04:00
|
|
|
pp.precision = p->precision;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
/* we don't have API to specify validbits */
|
|
|
|
pp.validbits = p->precision;
|
1997-04-30 01:01:33 +04:00
|
|
|
np++;
|
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(r->precision)) {
|
1997-04-30 01:01:33 +04:00
|
|
|
rp.precision = r->precision;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
/* we don't have API to specify validbits */
|
|
|
|
rp.validbits = r->precision;
|
1997-04-30 01:01:33 +04:00
|
|
|
nr++;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(p->channels)) {
|
1997-04-30 01:01:33 +04:00
|
|
|
pp.channels = p->channels;
|
|
|
|
np++;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(r->channels)) {
|
1997-04-30 01:01:33 +04:00
|
|
|
rp.channels = r->channels;
|
|
|
|
nr++;
|
|
|
|
}
|
1997-07-27 05:16:32 +04:00
|
|
|
#ifdef AUDIO_DEBUG
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (audiodebug && nr > 0)
|
2005-01-15 19:23:03 +03:00
|
|
|
audio_print_params("audiosetinfo() Setting record params:", &rp);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (audiodebug && np > 0)
|
2005-01-15 19:23:03 +03:00
|
|
|
audio_print_params("audiosetinfo() Setting play params:", &pp);
|
1997-07-27 05:16:32 +04:00
|
|
|
#endif
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (nr > 0 && (error = audio_check_params(&rp)))
|
1997-04-30 01:01:33 +04:00
|
|
|
return error;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (np > 0 && (error = audio_check_params(&pp)))
|
1997-04-30 01:01:33 +04:00
|
|
|
return error;
|
2006-11-01 13:13:37 +03:00
|
|
|
|
|
|
|
oldpblksize = sc->sc_pr.blksize;
|
|
|
|
oldrblksize = sc->sc_rr.blksize;
|
|
|
|
|
1997-08-25 02:31:23 +04:00
|
|
|
setmode = 0;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (nr > 0) {
|
2003-10-02 11:15:20 +04:00
|
|
|
if (!cleared) {
|
1997-07-27 05:16:32 +04:00
|
|
|
audio_clear(sc);
|
2007-03-01 20:31:35 +03:00
|
|
|
cleared = true;
|
2003-10-02 11:15:20 +04:00
|
|
|
}
|
2007-03-01 20:31:35 +03:00
|
|
|
modechange = true;
|
1997-08-25 02:31:23 +04:00
|
|
|
setmode |= AUMODE_RECORD;
|
1997-04-30 01:01:33 +04:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (np > 0) {
|
2003-10-02 11:15:20 +04:00
|
|
|
if (!cleared) {
|
1995-02-21 04:35:58 +03:00
|
|
|
audio_clear(sc);
|
2007-03-01 20:31:35 +03:00
|
|
|
cleared = true;
|
2003-10-02 11:15:20 +04:00
|
|
|
}
|
2007-03-01 20:31:35 +03:00
|
|
|
modechange = true;
|
1997-08-25 02:31:23 +04:00
|
|
|
setmode |= AUMODE_PLAY;
|
|
|
|
}
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(ai->mode)) {
|
2003-10-02 11:15:20 +04:00
|
|
|
if (!cleared) {
|
1997-08-25 02:31:23 +04:00
|
|
|
audio_clear(sc);
|
2007-03-01 20:31:35 +03:00
|
|
|
cleared = true;
|
2003-10-02 11:15:20 +04:00
|
|
|
}
|
2007-03-01 20:31:35 +03:00
|
|
|
modechange = true;
|
1997-08-25 02:31:23 +04:00
|
|
|
sc->sc_mode = ai->mode;
|
|
|
|
if (sc->sc_mode & AUMODE_PLAY_ALL)
|
|
|
|
sc->sc_mode |= AUMODE_PLAY;
|
|
|
|
if ((sc->sc_mode & AUMODE_PLAY) && !sc->sc_full_duplex)
|
|
|
|
/* Play takes precedence */
|
|
|
|
sc->sc_mode &= ~AUMODE_RECORD;
|
|
|
|
}
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
oldpus = sc->sc_pustream;
|
|
|
|
oldrus = sc->sc_rustream;
|
1998-08-10 05:13:20 +04:00
|
|
|
if (modechange) {
|
2002-03-07 17:37:02 +03:00
|
|
|
int indep;
|
|
|
|
|
|
|
|
indep = hw->get_props(sc->hw_hdl) & AUDIO_PROP_INDEPENDENT;
|
1997-08-25 02:31:23 +04:00
|
|
|
if (!indep) {
|
|
|
|
if (setmode == AUMODE_RECORD)
|
|
|
|
pp = rp;
|
|
|
|
else if (setmode == AUMODE_PLAY)
|
|
|
|
rp = pp;
|
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
memset(&pfilters, 0, sizeof(pfilters));
|
|
|
|
memset(&rfilters, 0, sizeof(rfilters));
|
|
|
|
pfilters.append = stream_filter_list_append;
|
|
|
|
pfilters.prepend = stream_filter_list_prepend;
|
|
|
|
pfilters.set = stream_filter_list_set;
|
|
|
|
rfilters.append = stream_filter_list_append;
|
|
|
|
rfilters.prepend = stream_filter_list_prepend;
|
|
|
|
rfilters.set = stream_filter_list_set;
|
2002-03-07 17:37:02 +03:00
|
|
|
/* Some device drivers change channels/sample_rate and change
|
|
|
|
* no channels/sample_rate. */
|
1998-08-09 09:44:51 +04:00
|
|
|
error = hw->set_params(sc->hw_hdl, setmode,
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
sc->sc_mode & (AUMODE_PLAY | AUMODE_RECORD), &pp, &rp,
|
|
|
|
&pfilters, &rfilters);
|
|
|
|
if (error) {
|
|
|
|
DPRINTF(("%s: hw->set_params() failed with %d\n",
|
|
|
|
__func__, error));
|
2006-11-01 09:39:19 +03:00
|
|
|
goto cleanup;
|
2002-03-07 17:37:02 +03:00
|
|
|
}
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
audio_check_params(&pp);
|
|
|
|
audio_check_params(&rp);
|
1997-08-25 02:31:23 +04:00
|
|
|
if (!indep) {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
/* XXX for !indep device, we have to use the same
|
|
|
|
* parameters for the hardware, not userland */
|
1997-08-25 02:31:23 +04:00
|
|
|
if (setmode == AUMODE_RECORD) {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
pp = rp;
|
1997-08-25 02:31:23 +04:00
|
|
|
} else if (setmode == AUMODE_PLAY) {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
rp = pp;
|
1997-08-25 02:31:23 +04:00
|
|
|
}
|
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
|
|
|
|
if (sc->sc_pr.mmapped && pfilters.req_size > 0) {
|
|
|
|
DPRINTF(("%s: mmapped, and filters are requested.\n",
|
|
|
|
__func__));
|
2006-11-01 09:39:19 +03:00
|
|
|
error = EINVAL;
|
|
|
|
goto cleanup;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* construct new filter chain */
|
|
|
|
if (setmode & AUMODE_PLAY) {
|
|
|
|
error = audio_setup_pfilters(sc, &pp, &pfilters);
|
|
|
|
if (error)
|
2006-11-01 09:39:19 +03:00
|
|
|
goto cleanup;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
}
|
|
|
|
if (setmode & AUMODE_RECORD) {
|
|
|
|
error = audio_setup_rfilters(sc, &rp, &rfilters);
|
|
|
|
if (error)
|
2006-11-01 09:39:19 +03:00
|
|
|
goto cleanup;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
}
|
|
|
|
DPRINTF(("%s: filter setup is completed.\n", __func__));
|
|
|
|
|
|
|
|
/* userland formats */
|
1998-08-09 08:54:44 +04:00
|
|
|
sc->sc_pparams = pp;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
sc->sc_rparams = rp;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1997-08-19 03:20:09 +04:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
/* Play params can affect the record params, so recalculate blksize. */
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (nr > 0 || np > 0) {
|
1997-07-27 05:16:32 +04:00
|
|
|
audio_calc_blksize(sc, AUMODE_RECORD);
|
|
|
|
audio_calc_blksize(sc, AUMODE_PLAY);
|
|
|
|
}
|
|
|
|
#ifdef AUDIO_DEBUG
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (audiodebug > 1 && nr > 0)
|
2005-01-15 19:23:03 +03:00
|
|
|
audio_print_params("audiosetinfo() After setting record params:", &sc->sc_rparams);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (audiodebug > 1 && np > 0)
|
2005-01-15 19:23:03 +03:00
|
|
|
audio_print_params("audiosetinfo() After setting play params:", &sc->sc_pparams);
|
1997-07-27 05:16:32 +04:00
|
|
|
#endif
|
1997-04-30 01:01:33 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(p->port)) {
|
2003-10-02 11:15:20 +04:00
|
|
|
if (!cleared) {
|
1995-02-21 04:35:58 +03:00
|
|
|
audio_clear(sc);
|
2007-03-01 20:31:35 +03:00
|
|
|
cleared = true;
|
2003-10-02 11:15:20 +04:00
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
error = au_set_port(sc, &sc->sc_outports, p->port);
|
1996-02-20 14:47:22 +03:00
|
|
|
if (error)
|
2006-11-01 09:39:19 +03:00
|
|
|
goto cleanup;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(r->port)) {
|
2003-10-02 11:15:20 +04:00
|
|
|
if (!cleared) {
|
1995-02-21 04:35:58 +03:00
|
|
|
audio_clear(sc);
|
2007-03-01 20:31:35 +03:00
|
|
|
cleared = true;
|
2003-10-02 11:15:20 +04:00
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
error = au_set_port(sc, &sc->sc_inports, r->port);
|
1996-02-20 14:47:22 +03:00
|
|
|
if (error)
|
2006-11-01 09:39:19 +03:00
|
|
|
goto cleanup;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(p->gain)) {
|
1997-10-19 11:41:33 +04:00
|
|
|
au_get_gain(sc, &sc->sc_outports, &gain, &balance);
|
|
|
|
error = au_set_gain(sc, &sc->sc_outports, p->gain, balance);
|
1996-02-20 14:47:22 +03:00
|
|
|
if (error)
|
2006-11-01 09:39:19 +03:00
|
|
|
goto cleanup;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(r->gain)) {
|
1997-10-19 11:41:33 +04:00
|
|
|
au_get_gain(sc, &sc->sc_inports, &gain, &balance);
|
|
|
|
error = au_set_gain(sc, &sc->sc_inports, r->gain, balance);
|
|
|
|
if (error)
|
2006-11-01 09:39:19 +03:00
|
|
|
goto cleanup;
|
1997-10-19 11:41:33 +04:00
|
|
|
}
|
2002-03-23 20:17:10 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED_CH(p->balance)) {
|
1997-10-19 11:41:33 +04:00
|
|
|
au_get_gain(sc, &sc->sc_outports, &gain, &balance);
|
|
|
|
error = au_set_gain(sc, &sc->sc_outports, gain, p->balance);
|
|
|
|
if (error)
|
2006-11-01 09:39:19 +03:00
|
|
|
goto cleanup;
|
1997-10-19 11:41:33 +04:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED_CH(r->balance)) {
|
1997-10-19 11:41:33 +04:00
|
|
|
au_get_gain(sc, &sc->sc_inports, &gain, &balance);
|
|
|
|
error = au_set_gain(sc, &sc->sc_inports, gain, r->balance);
|
|
|
|
if (error)
|
2006-11-01 09:39:19 +03:00
|
|
|
goto cleanup;
|
1997-10-19 11:41:33 +04:00
|
|
|
}
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(ai->monitor_gain) && sc->sc_monitor_port != -1) {
|
1997-10-19 11:41:33 +04:00
|
|
|
mixer_ctrl_t ct;
|
2002-03-23 20:17:10 +03:00
|
|
|
|
1997-10-19 11:41:33 +04:00
|
|
|
ct.dev = sc->sc_monitor_port;
|
1995-05-08 20:06:38 +04:00
|
|
|
ct.type = AUDIO_MIXER_VALUE;
|
1995-02-21 04:35:58 +03:00
|
|
|
ct.un.value.num_channels = 1;
|
1997-10-19 11:41:33 +04:00
|
|
|
ct.un.value.level[AUDIO_MIXER_LEVEL_MONO] = ai->monitor_gain;
|
1999-05-30 04:21:08 +04:00
|
|
|
error = sc->hw_if->set_port(sc->hw_hdl, &ct);
|
1996-02-20 14:47:22 +03:00
|
|
|
if (error)
|
2006-11-01 09:39:19 +03:00
|
|
|
goto cleanup;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED_CH(p->pause)) {
|
1997-07-27 05:16:32 +04:00
|
|
|
sc->sc_pr.pause = p->pause;
|
2005-06-11 12:14:19 +04:00
|
|
|
pbus = !p->pause;
|
2007-03-01 20:31:35 +03:00
|
|
|
pausechange = true;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED_CH(r->pause)) {
|
1997-07-27 05:16:32 +04:00
|
|
|
sc->sc_rr.pause = r->pause;
|
2005-06-11 12:14:19 +04:00
|
|
|
rbus = !r->pause;
|
2007-03-01 20:31:35 +03:00
|
|
|
pausechange = true;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(ai->blocksize)) {
|
2005-01-29 21:16:49 +03:00
|
|
|
int pblksize, rblksize;
|
|
|
|
|
1997-03-20 19:13:55 +03:00
|
|
|
/* Block size specified explicitly. */
|
1997-08-19 03:20:09 +04:00
|
|
|
if (ai->blocksize == 0) {
|
2005-01-29 21:16:49 +03:00
|
|
|
if (!cleared) {
|
|
|
|
audio_clear(sc);
|
2007-03-01 20:31:35 +03:00
|
|
|
cleared = true;
|
2005-01-29 21:16:49 +03:00
|
|
|
}
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_blkset = false;
|
1997-08-19 03:20:09 +04:00
|
|
|
audio_calc_blksize(sc, AUMODE_RECORD);
|
|
|
|
audio_calc_blksize(sc, AUMODE_PLAY);
|
|
|
|
} else {
|
2007-03-01 20:31:35 +03:00
|
|
|
sc->sc_blkset = true;
|
2005-01-29 21:16:49 +03:00
|
|
|
/* check whether new blocksize changes actually */
|
|
|
|
if (hw->round_blocksize == NULL) {
|
|
|
|
if (!cleared) {
|
|
|
|
audio_clear(sc);
|
2007-03-01 20:31:35 +03:00
|
|
|
cleared = true;
|
2005-01-29 21:16:49 +03:00
|
|
|
}
|
|
|
|
sc->sc_pr.blksize = ai->blocksize;
|
|
|
|
sc->sc_rr.blksize = ai->blocksize;
|
|
|
|
} else {
|
|
|
|
pblksize = hw->round_blocksize(sc->hw_hdl,
|
|
|
|
ai->blocksize, AUMODE_PLAY, &sc->sc_pr.s.param);
|
|
|
|
rblksize = hw->round_blocksize(sc->hw_hdl,
|
|
|
|
ai->blocksize, AUMODE_RECORD, &sc->sc_rr.s.param);
|
|
|
|
if (pblksize != sc->sc_pr.blksize ||
|
|
|
|
rblksize != sc->sc_rr.blksize) {
|
|
|
|
if (!cleared) {
|
|
|
|
audio_clear(sc);
|
2007-03-01 20:31:35 +03:00
|
|
|
cleared = true;
|
2005-01-29 21:16:49 +03:00
|
|
|
}
|
|
|
|
sc->sc_pr.blksize = ai->blocksize;
|
|
|
|
sc->sc_rr.blksize = ai->blocksize;
|
|
|
|
}
|
|
|
|
}
|
1997-08-19 03:20:09 +04:00
|
|
|
}
|
1997-03-20 19:13:55 +03:00
|
|
|
}
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(ai->mode)) {
|
1997-08-25 02:31:23 +04:00
|
|
|
if (sc->sc_mode & AUMODE_PLAY)
|
1995-02-21 04:35:58 +03:00
|
|
|
audio_init_play(sc);
|
1995-07-07 05:52:30 +04:00
|
|
|
if (sc->sc_mode & AUMODE_RECORD)
|
1995-02-21 04:35:58 +03:00
|
|
|
audio_init_record(sc);
|
|
|
|
}
|
1997-03-20 19:13:55 +03:00
|
|
|
|
1997-07-28 03:51:48 +04:00
|
|
|
if (hw->commit_settings) {
|
|
|
|
error = hw->commit_settings(sc->hw_hdl);
|
|
|
|
if (error)
|
2006-11-01 09:39:19 +03:00
|
|
|
goto cleanup;
|
1997-07-28 03:51:48 +04:00
|
|
|
}
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2007-12-13 17:02:53 +03:00
|
|
|
sc->sc_lastinfo = *ai;
|
|
|
|
sc->sc_lastinfovalid = true;
|
|
|
|
|
2006-11-01 09:39:19 +03:00
|
|
|
cleanup:
|
2005-06-11 12:14:19 +04:00
|
|
|
if (cleared || pausechange) {
|
2006-11-01 09:39:19 +03:00
|
|
|
int init_error;
|
|
|
|
|
1997-03-20 19:13:55 +03:00
|
|
|
s = splaudio();
|
2006-11-01 09:39:19 +03:00
|
|
|
init_error = audio_initbufs(sc);
|
|
|
|
if (init_error) goto err;
|
1997-08-19 03:20:09 +04:00
|
|
|
if (sc->sc_pr.blksize != oldpblksize ||
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
sc->sc_rr.blksize != oldrblksize ||
|
|
|
|
sc->sc_pustream != oldpus ||
|
|
|
|
sc->sc_rustream != oldrus)
|
1997-08-19 03:20:09 +04:00
|
|
|
audio_calcwater(sc);
|
1997-08-25 02:31:23 +04:00
|
|
|
if ((sc->sc_mode & AUMODE_PLAY) &&
|
|
|
|
pbus && !sc->sc_pbus)
|
2006-11-01 09:39:19 +03:00
|
|
|
init_error = audiostartp(sc);
|
|
|
|
if (!init_error &&
|
1997-08-25 02:31:23 +04:00
|
|
|
(sc->sc_mode & AUMODE_RECORD) &&
|
|
|
|
rbus && !sc->sc_rbus)
|
2006-11-01 09:39:19 +03:00
|
|
|
init_error = audiostartr(sc);
|
1997-08-25 02:31:23 +04:00
|
|
|
err:
|
1995-02-21 04:35:58 +03:00
|
|
|
splx(s);
|
2006-11-01 09:39:19 +03:00
|
|
|
if (init_error)
|
|
|
|
return init_error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
2002-03-23 20:17:10 +03:00
|
|
|
|
1997-08-07 03:08:26 +04:00
|
|
|
/* Change water marks after initializing the buffers. */
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(ai->hiwat)) {
|
1997-08-07 03:08:26 +04:00
|
|
|
blks = ai->hiwat;
|
|
|
|
if (blks > sc->sc_pr.maxblks)
|
|
|
|
blks = sc->sc_pr.maxblks;
|
1997-10-08 02:40:43 +04:00
|
|
|
if (blks < 2)
|
|
|
|
blks = 2;
|
1997-08-07 03:08:26 +04:00
|
|
|
sc->sc_pr.usedhigh = blks * sc->sc_pr.blksize;
|
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(ai->lowat)) {
|
1997-08-07 03:08:26 +04:00
|
|
|
blks = ai->lowat;
|
|
|
|
if (blks > sc->sc_pr.maxblks - 1)
|
|
|
|
blks = sc->sc_pr.maxblks - 1;
|
|
|
|
sc->sc_pr.usedlow = blks * sc->sc_pr.blksize;
|
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
if (SPECIFIED(ai->hiwat) || SPECIFIED(ai->lowat)) {
|
1997-10-08 02:40:43 +04:00
|
|
|
if (sc->sc_pr.usedlow > sc->sc_pr.usedhigh - sc->sc_pr.blksize)
|
2002-03-23 20:17:10 +03:00
|
|
|
sc->sc_pr.usedlow =
|
1998-12-28 01:52:23 +03:00
|
|
|
sc->sc_pr.usedhigh - sc->sc_pr.blksize;
|
1997-10-08 02:40:43 +04:00
|
|
|
}
|
1997-08-07 03:08:26 +04:00
|
|
|
|
2006-11-01 09:39:19 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1995-04-18 03:04:31 +04:00
|
|
|
int
|
2007-06-11 17:05:46 +04:00
|
|
|
audiogetinfo(struct audio_softc *sc, struct audio_info *ai, int buf_only_mode)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_prinfo *r, *p;
|
|
|
|
const struct audio_hw_if *hw;
|
2002-03-23 20:17:10 +03:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
r = &ai->record;
|
|
|
|
p = &ai->play;
|
|
|
|
hw = sc->hw_if;
|
|
|
|
if (hw == NULL) /* HW has not attached */
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return ENXIO;
|
2002-03-23 20:17:10 +03:00
|
|
|
|
1997-04-30 01:01:33 +04:00
|
|
|
p->sample_rate = sc->sc_pparams.sample_rate;
|
|
|
|
r->sample_rate = sc->sc_rparams.sample_rate;
|
|
|
|
p->channels = sc->sc_pparams.channels;
|
|
|
|
r->channels = sc->sc_rparams.channels;
|
|
|
|
p->precision = sc->sc_pparams.precision;
|
|
|
|
r->precision = sc->sc_rparams.precision;
|
|
|
|
p->encoding = sc->sc_pparams.encoding;
|
|
|
|
r->encoding = sc->sc_rparams.encoding;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2007-06-11 17:05:46 +04:00
|
|
|
if (buf_only_mode) {
|
|
|
|
r->port = 0;
|
|
|
|
p->port = 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2007-06-11 17:05:46 +04:00
|
|
|
r->avail_ports = 0;
|
|
|
|
p->avail_ports = 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2007-06-11 17:05:46 +04:00
|
|
|
r->gain = 0;
|
|
|
|
r->balance = 0;
|
|
|
|
|
|
|
|
p->gain = 0;
|
|
|
|
p->balance = 0;
|
|
|
|
} else {
|
|
|
|
r->port = au_get_port(sc, &sc->sc_inports);
|
|
|
|
p->port = au_get_port(sc, &sc->sc_outports);
|
|
|
|
|
|
|
|
r->avail_ports = sc->sc_inports.allports;
|
|
|
|
p->avail_ports = sc->sc_outports.allports;
|
|
|
|
|
|
|
|
au_get_gain(sc, &sc->sc_inports, &r->gain, &r->balance);
|
|
|
|
au_get_gain(sc, &sc->sc_outports, &p->gain, &p->balance);
|
|
|
|
}
|
1997-10-19 11:41:33 +04:00
|
|
|
|
2007-06-11 17:05:46 +04:00
|
|
|
if (sc->sc_monitor_port != -1 && buf_only_mode == 0) {
|
1997-10-19 11:41:33 +04:00
|
|
|
mixer_ctrl_t ct;
|
2002-03-23 20:17:10 +03:00
|
|
|
|
1997-10-19 11:41:33 +04:00
|
|
|
ct.dev = sc->sc_monitor_port;
|
|
|
|
ct.type = AUDIO_MIXER_VALUE;
|
|
|
|
ct.un.value.num_channels = 1;
|
|
|
|
if (sc->hw_if->get_port(sc->hw_hdl, &ct))
|
|
|
|
ai->monitor_gain = 0;
|
|
|
|
else
|
2002-03-23 20:17:10 +03:00
|
|
|
ai->monitor_gain =
|
1997-10-19 11:41:33 +04:00
|
|
|
ct.un.value.level[AUDIO_MIXER_LEVEL_MONO];
|
|
|
|
} else
|
|
|
|
ai->monitor_gain = 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
p->seek = audio_stream_get_used(sc->sc_pustream);
|
|
|
|
r->seek = audio_stream_get_used(sc->sc_rustream);
|
1997-07-27 05:16:32 +04:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
/*
|
|
|
|
* XXX samples should be a value for userland data.
|
|
|
|
* But drops is a value for HW data.
|
|
|
|
*/
|
|
|
|
p->samples = (sc->sc_pustream == &sc->sc_pr.s
|
|
|
|
? sc->sc_pr.stamp : sc->sc_pr.fstamp) - sc->sc_pr.drops;
|
|
|
|
r->samples = (sc->sc_rustream == &sc->sc_rr.s
|
|
|
|
? sc->sc_rr.stamp : sc->sc_rr.fstamp) - sc->sc_rr.drops;
|
1997-07-27 05:16:32 +04:00
|
|
|
|
|
|
|
p->eof = sc->sc_eof;
|
|
|
|
r->eof = 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
p->pause = sc->sc_pr.pause;
|
|
|
|
r->pause = sc->sc_rr.pause;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
p->error = sc->sc_pr.drops != 0;
|
|
|
|
r->error = sc->sc_rr.drops != 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
p->waiting = r->waiting = 0; /* open never hangs */
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
p->open = (sc->sc_open & AUOPEN_WRITE) != 0;
|
|
|
|
r->open = (sc->sc_open & AUOPEN_READ) != 0;
|
|
|
|
|
|
|
|
p->active = sc->sc_pbus;
|
|
|
|
r->active = sc->sc_rbus;
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
p->buffer_size = sc->sc_pustream->bufsize;
|
2005-02-13 20:05:15 +03:00
|
|
|
r->buffer_size = sc->sc_rustream->bufsize;
|
1997-10-19 11:41:33 +04:00
|
|
|
|
1997-07-27 05:16:32 +04:00
|
|
|
ai->blocksize = sc->sc_pr.blksize;
|
|
|
|
ai->hiwat = sc->sc_pr.usedhigh / sc->sc_pr.blksize;
|
|
|
|
ai->lowat = sc->sc_pr.usedlow / sc->sc_pr.blksize;
|
1995-07-07 05:52:30 +04:00
|
|
|
ai->mode = sc->sc_mode;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mixer driver
|
|
|
|
*/
|
|
|
|
int
|
2006-11-16 04:32:37 +03:00
|
|
|
mixer_open(dev_t dev, struct audio_softc *sc, int flags,
|
|
|
|
int ifmt, struct lwp *l)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
if (sc->hw_if == NULL)
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return ENXIO;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
1999-09-09 14:24:39 +04:00
|
|
|
DPRINTF(("mixer_open: flags=0x%x sc=%p\n", flags, sc));
|
1995-02-21 04:35:58 +03:00
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
1997-08-11 05:38:12 +04:00
|
|
|
/*
|
|
|
|
* Remove a process from those to be signalled on mixer activity.
|
|
|
|
*/
|
|
|
|
static void
|
2005-12-11 15:16:03 +03:00
|
|
|
mixer_remove(struct audio_softc *sc, struct lwp *l)
|
1997-08-11 05:38:12 +04:00
|
|
|
{
|
|
|
|
struct mixer_asyncs **pm, *m;
|
2006-02-25 14:32:51 +03:00
|
|
|
struct proc *p;
|
|
|
|
|
|
|
|
if (l == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
p = l->l_proc;
|
1997-08-11 05:38:12 +04:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
for (pm = &sc->sc_async_mixer; *pm; pm = &(*pm)->next) {
|
1997-08-11 05:38:12 +04:00
|
|
|
if ((*pm)->proc == p) {
|
|
|
|
m = *pm;
|
|
|
|
*pm = m->next;
|
|
|
|
free(m, M_DEVBUF);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-08-19 01:19:02 +04:00
|
|
|
/*
|
2001-10-03 03:31:54 +04:00
|
|
|
* Signal all processes waiting for the mixer.
|
1997-08-19 01:19:02 +04:00
|
|
|
*/
|
|
|
|
static void
|
2001-10-03 03:31:54 +04:00
|
|
|
mixer_signal(struct audio_softc *sc)
|
1997-08-19 01:19:02 +04:00
|
|
|
{
|
|
|
|
struct mixer_asyncs *m;
|
|
|
|
|
2007-02-10 00:55:00 +03:00
|
|
|
for (m = sc->sc_async_mixer; m; m = m->next) {
|
|
|
|
mutex_enter(&proclist_mutex);
|
1997-08-19 01:19:02 +04:00
|
|
|
psignal(m->proc, SIGIO);
|
2007-02-10 00:55:00 +03:00
|
|
|
mutex_exit(&proclist_mutex);
|
|
|
|
}
|
1997-08-19 01:19:02 +04:00
|
|
|
}
|
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
/*
|
|
|
|
* Close a mixer device
|
|
|
|
*/
|
|
|
|
/* ARGSUSED */
|
|
|
|
int
|
2006-11-16 04:32:37 +03:00
|
|
|
mixer_close(struct audio_softc *sc, int flags, int ifmt,
|
2006-10-12 05:30:41 +04:00
|
|
|
struct lwp *l)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2002-03-23 20:17:10 +03:00
|
|
|
|
2005-01-15 19:23:03 +03:00
|
|
|
DPRINTF(("mixer_close: sc %p\n", sc));
|
2005-12-11 15:16:03 +03:00
|
|
|
mixer_remove(sc, l);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return 0;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-03-04 08:59:00 +03:00
|
|
|
mixer_ioctl(struct audio_softc *sc, u_long cmd, void *addr, int flag,
|
2005-12-11 15:16:03 +03:00
|
|
|
struct lwp *l)
|
1995-02-21 04:35:58 +03:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
const struct audio_hw_if *hw;
|
2007-12-09 23:27:42 +03:00
|
|
|
mixer_ctrl_t *mc;
|
2005-01-15 19:23:03 +03:00
|
|
|
int error;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
2000-03-01 03:44:35 +03:00
|
|
|
DPRINTF(("mixer_ioctl(%lu,'%c',%lu)\n",
|
|
|
|
IOCPARM_LEN(cmd), (char)IOCGROUP(cmd), cmd&0xff));
|
2005-01-15 19:23:03 +03:00
|
|
|
hw = sc->hw_if;
|
|
|
|
error = EINVAL;
|
2007-12-09 23:27:42 +03:00
|
|
|
|
|
|
|
/* we can return cached values if we are sleeping */
|
|
|
|
if (cmd != AUDIO_MIXER_READ)
|
2008-03-04 21:23:44 +03:00
|
|
|
device_active(sc->dev, DVA_SYSTEM);
|
2007-12-09 23:27:42 +03:00
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
switch (cmd) {
|
1997-08-11 05:38:12 +04:00
|
|
|
case FIOASYNC:
|
2005-12-11 15:16:03 +03:00
|
|
|
mixer_remove(sc, l); /* remove old entry */
|
1997-08-11 05:38:12 +04:00
|
|
|
if (*(int *)addr) {
|
|
|
|
struct mixer_asyncs *ma;
|
1998-03-03 12:16:15 +03:00
|
|
|
ma = malloc(sizeof (struct mixer_asyncs),
|
2002-03-23 20:17:10 +03:00
|
|
|
M_DEVBUF, M_WAITOK);
|
1997-08-11 05:38:12 +04:00
|
|
|
ma->next = sc->sc_async_mixer;
|
2005-12-11 15:16:03 +03:00
|
|
|
ma->proc = l->l_proc;
|
1997-08-11 05:38:12 +04:00
|
|
|
sc->sc_async_mixer = ma;
|
|
|
|
}
|
|
|
|
error = 0;
|
|
|
|
break;
|
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
case AUDIO_GETDEV:
|
1997-07-28 03:51:48 +04:00
|
|
|
DPRINTF(("AUDIO_GETDEV\n"));
|
|
|
|
error = hw->getdev(sc->hw_hdl, (audio_device_t *)addr);
|
|
|
|
break;
|
2002-03-23 20:17:10 +03:00
|
|
|
|
1995-02-21 04:35:58 +03:00
|
|
|
case AUDIO_MIXER_DEVINFO:
|
1997-07-28 03:51:48 +04:00
|
|
|
DPRINTF(("AUDIO_MIXER_DEVINFO\n"));
|
2000-12-29 13:00:08 +03:00
|
|
|
((mixer_devinfo_t *)addr)->un.v.delta = 0; /* default */
|
1997-07-28 03:51:48 +04:00
|
|
|
error = hw->query_devinfo(sc->hw_hdl, (mixer_devinfo_t *)addr);
|
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
|
|
|
case AUDIO_MIXER_READ:
|
1997-07-28 03:51:48 +04:00
|
|
|
DPRINTF(("AUDIO_MIXER_READ\n"));
|
2007-12-09 23:27:42 +03:00
|
|
|
mc = (mixer_ctrl_t *)addr;
|
|
|
|
|
|
|
|
if (device_is_active(sc->sc_dev) ||
|
|
|
|
sc->sc_mixer_state == NULL)
|
|
|
|
error = hw->get_port(sc->hw_hdl, mc);
|
|
|
|
else if (mc->dev >= sc->sc_nmixer_states)
|
|
|
|
error = ENXIO;
|
|
|
|
else {
|
|
|
|
int dev = mc->dev;
|
|
|
|
memcpy(mc, &sc->sc_mixer_state[dev],
|
|
|
|
sizeof(mixer_ctrl_t));
|
|
|
|
error = 0;
|
|
|
|
}
|
1997-07-28 03:51:48 +04:00
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
|
|
|
case AUDIO_MIXER_WRITE:
|
1997-07-28 03:51:48 +04:00
|
|
|
DPRINTF(("AUDIO_MIXER_WRITE\n"));
|
|
|
|
error = hw->set_port(sc->hw_hdl, (mixer_ctrl_t *)addr);
|
|
|
|
if (!error && hw->commit_settings)
|
|
|
|
error = hw->commit_settings(sc->hw_hdl);
|
1997-08-19 01:19:02 +04:00
|
|
|
if (!error)
|
|
|
|
mixer_signal(sc);
|
1997-07-28 03:51:48 +04:00
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
|
|
|
|
default:
|
2001-10-04 00:48:41 +04:00
|
|
|
if (hw->dev_ioctl)
|
2005-12-11 15:16:03 +03:00
|
|
|
error = hw->dev_ioctl(sc->hw_hdl, cmd, addr, flag, l);
|
2001-10-04 00:48:41 +04:00
|
|
|
else
|
2001-10-03 04:04:47 +04:00
|
|
|
error = EINVAL;
|
1997-07-28 03:51:48 +04:00
|
|
|
break;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
2000-03-01 03:44:35 +03:00
|
|
|
DPRINTF(("mixer_ioctl(%lu,'%c',%lu) result %d\n",
|
|
|
|
IOCPARM_LEN(cmd), (char)IOCGROUP(cmd), cmd&0xff, error));
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return error;
|
1995-02-21 04:35:58 +03:00
|
|
|
}
|
1998-08-28 11:44:12 +04:00
|
|
|
#endif /* NAUDIO > 0 */
|
|
|
|
|
|
|
|
#include "midi.h"
|
|
|
|
|
1998-12-20 17:26:44 +03:00
|
|
|
#if NAUDIO == 0 && (NMIDI > 0 || NMIDIBUS > 0)
|
1998-09-27 20:43:56 +04:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/device.h>
|
|
|
|
#include <sys/audioio.h>
|
|
|
|
#include <dev/audio_if.h>
|
|
|
|
#endif
|
|
|
|
|
1998-12-20 17:26:44 +03:00
|
|
|
#if NAUDIO > 0 || (NMIDI > 0 || NMIDIBUS > 0)
|
1998-08-28 11:44:12 +04:00
|
|
|
int
|
2001-10-03 03:31:54 +04:00
|
|
|
audioprint(void *aux, const char *pnp)
|
1998-08-28 11:44:12 +04:00
|
|
|
{
|
2005-01-15 19:23:03 +03:00
|
|
|
struct audio_attach_args *arg;
|
1998-08-28 11:44:12 +04:00
|
|
|
const char *type;
|
|
|
|
|
|
|
|
if (pnp != NULL) {
|
2005-01-15 19:23:03 +03:00
|
|
|
arg = aux;
|
1998-08-28 11:44:12 +04:00
|
|
|
switch (arg->type) {
|
|
|
|
case AUDIODEV_TYPE_AUDIO:
|
|
|
|
type = "audio";
|
|
|
|
break;
|
|
|
|
case AUDIODEV_TYPE_MIDI:
|
|
|
|
type = "midi";
|
|
|
|
break;
|
|
|
|
case AUDIODEV_TYPE_OPL:
|
|
|
|
type = "opl";
|
|
|
|
break;
|
|
|
|
case AUDIODEV_TYPE_MPU:
|
|
|
|
type = "mpu";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
panic("audioprint: unknown type %d", arg->type);
|
|
|
|
}
|
2003-01-01 03:10:15 +03:00
|
|
|
aprint_normal("%s at %s", type, pnp);
|
1998-08-28 11:44:12 +04:00
|
|
|
}
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* 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.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* 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
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
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
2005-01-11 01:01:36 +03:00
|
|
|
return UNCONF;
|
1998-08-28 11:44:12 +04:00
|
|
|
}
|
|
|
|
|
1998-12-20 17:26:44 +03:00
|
|
|
#endif /* NAUDIO > 0 || (NMIDI > 0 || NMIDIBUS > 0) */
|
2006-06-19 14:19:08 +04:00
|
|
|
|
2006-06-27 06:07:08 +04:00
|
|
|
#if NAUDIO > 0
|
2007-12-09 23:27:42 +03:00
|
|
|
static void
|
|
|
|
audio_mixer_capture(struct audio_softc *sc)
|
2006-06-19 14:19:08 +04:00
|
|
|
{
|
2007-12-09 23:27:42 +03:00
|
|
|
mixer_devinfo_t mi;
|
|
|
|
mixer_ctrl_t *mc;
|
2006-06-19 14:19:08 +04:00
|
|
|
|
2007-12-09 23:27:42 +03:00
|
|
|
for (mi.index = 0; ; mi.index++)
|
|
|
|
if (sc->hw_if->query_devinfo(sc->hw_hdl, &mi) != 0)
|
|
|
|
break;
|
2006-06-19 14:19:08 +04:00
|
|
|
|
2007-12-09 23:27:42 +03:00
|
|
|
#ifdef DIAGNOSTIC
|
|
|
|
if (sc->sc_mixer_state != NULL && sc->sc_nmixer_states != mi.index) {
|
|
|
|
free(sc->sc_mixer_state, M_DEVBUF);
|
|
|
|
sc->sc_mixer_state = NULL;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
sc->sc_nmixer_states = mi.index;
|
|
|
|
if (sc->sc_mixer_state == NULL)
|
|
|
|
sc->sc_mixer_state = malloc(
|
|
|
|
sizeof(mixer_ctrl_t) * sc->sc_nmixer_states,
|
|
|
|
M_DEVBUF, M_NOWAIT);
|
|
|
|
if (sc->sc_mixer_state == NULL) {
|
|
|
|
aprint_error("%s: couldn't allocate memory for mixer state\n",
|
2008-03-04 21:23:44 +03:00
|
|
|
device_xname(sc->dev));
|
2007-12-09 23:27:42 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (mi.index = 0; ; mi.index++) {
|
|
|
|
if (sc->hw_if->query_devinfo(sc->hw_hdl, &mi) != 0)
|
|
|
|
break;
|
|
|
|
if (mi.type == AUDIO_MIXER_CLASS)
|
|
|
|
continue;
|
|
|
|
mc = &sc->sc_mixer_state[mi.index];
|
|
|
|
mc->dev = mi.index;
|
|
|
|
mc->type = mi.type;
|
2007-12-11 03:08:14 +03:00
|
|
|
mc->un.value.num_channels = mi.un.v.num_channels;
|
2007-12-09 23:27:42 +03:00
|
|
|
(void)sc->hw_if->get_port(sc->hw_hdl, mc);
|
2006-06-19 14:19:08 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2007-12-09 23:27:42 +03:00
|
|
|
|
|
|
|
static void
|
|
|
|
audio_mixer_restore(struct audio_softc *sc)
|
|
|
|
{
|
|
|
|
mixer_devinfo_t mi;
|
|
|
|
mixer_ctrl_t *mc;
|
|
|
|
|
|
|
|
if (sc->sc_mixer_state == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (mi.index = 0; ; mi.index++) {
|
|
|
|
if (sc->hw_if->query_devinfo(sc->hw_hdl, &mi) != 0)
|
|
|
|
break;
|
|
|
|
if (mi.type == AUDIO_MIXER_CLASS)
|
|
|
|
continue;
|
|
|
|
mc = &sc->sc_mixer_state[mi.index];
|
|
|
|
(void)sc->hw_if->set_port(sc->hw_hdl, mc);
|
|
|
|
}
|
|
|
|
if (sc->hw_if->commit_settings)
|
|
|
|
sc->hw_if->commit_settings(sc->hw_hdl);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-02-13 21:31:51 +03:00
|
|
|
#ifdef AUDIO_PM_IDLE
|
2007-12-09 23:27:42 +03:00
|
|
|
static void
|
|
|
|
audio_idle(void *arg)
|
|
|
|
{
|
|
|
|
device_t dv = arg;
|
|
|
|
struct audio_softc *sc = device_private(dv);
|
|
|
|
|
|
|
|
#ifdef PNP_DEBUG
|
|
|
|
extern int pnp_debug_idle;
|
|
|
|
if (pnp_debug_idle)
|
|
|
|
printf("%s: idle handler called\n", device_xname(dv));
|
|
|
|
#endif
|
|
|
|
|
2007-12-13 17:40:36 +03:00
|
|
|
sc->sc_idle = true;
|
|
|
|
|
2007-12-09 23:27:42 +03:00
|
|
|
/* XXX joerg Make pmf_device_suspend handle children? */
|
Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.
Add a 'flags' argument to suspend/resume handlers and
callers such as pmf_system_suspend().
Define a flag, PMF_F_SELF, which indicates to PMF that a
device is suspending/resuming itself. Add helper routines,
pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
that call pmf_device_suspend(dev, PMF_F_SELF) and
pmf_device_resume(dev, PMF_F_SELF), respectively. Use
PMF_F_SELF to suspend/resume self in ath(4), audio(4),
rtw(4), and sip(4).
In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
callbacks, provided by the bus front-end, with
self-suspension/resumption. Also, clean up the bus
front-ends. Make sure that the interrupt handler is
disestablished during suspension. Get rid of driver-private
flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
device_is_active()/device_has_power() calls, instead.
In the network-class suspend handler, call if_stop(, 0)
instead of if_stop(, 1), because the latter is superfluous
(bus- and driver-suspension hooks will 'disable' the NIC),
and it may cause recursion.
In the network-class resume handler, prevent infinite
recursion through if_init() by getting out early if we are
self-suspending (PMF_F_SELF).
rtw(4) improvements:
Destroy rtw(4) callouts when we detach it. Make rtw at
pci detachable. Print some more information with the "rx
frame too long" warning.
Remove activate() methods:
Get rid of rtw_activate() and ath_activate(). The device
activate() methods are not good for much these days.
Make ath at cardbus resume with crypto functions intact:
Introduce a boolean device property, "pmf-powerdown". If
pmf-powerdown is present and false, it indicates that a
bus back-end should not remove power from a device.
Honor this property in cardbus_child_suspend().
Set this property to 'false' in ath_attach(), since removing
power from an ath at cardbus seems to lobotomize the WPA
crypto engine. XXX Should the pmf-powerdown property
propagate toward the root of the device tree?
Miscellaneous ath(4) changes:
Warn if ath(4) tries to write crypto keys to suspended
hardware.
Reduce differences between FreeBSD and NetBSD in ath(4)
multicast filter setup.
Make ath_printrxbuf() print an rx descriptor's status &
key index, to help debug crypto errors.
Shorten a staircase in ath_ioctl(). Don't check for
ieee80211_ioctl() return code ERESTART, it never happens.
2008-03-12 21:02:21 +03:00
|
|
|
if (!pmf_device_suspend(dv, PMF_F_SELF))
|
2007-12-09 23:27:42 +03:00
|
|
|
return;
|
|
|
|
|
Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.
Add a 'flags' argument to suspend/resume handlers and
callers such as pmf_system_suspend().
Define a flag, PMF_F_SELF, which indicates to PMF that a
device is suspending/resuming itself. Add helper routines,
pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
that call pmf_device_suspend(dev, PMF_F_SELF) and
pmf_device_resume(dev, PMF_F_SELF), respectively. Use
PMF_F_SELF to suspend/resume self in ath(4), audio(4),
rtw(4), and sip(4).
In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
callbacks, provided by the bus front-end, with
self-suspension/resumption. Also, clean up the bus
front-ends. Make sure that the interrupt handler is
disestablished during suspension. Get rid of driver-private
flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
device_is_active()/device_has_power() calls, instead.
In the network-class suspend handler, call if_stop(, 0)
instead of if_stop(, 1), because the latter is superfluous
(bus- and driver-suspension hooks will 'disable' the NIC),
and it may cause recursion.
In the network-class resume handler, prevent infinite
recursion through if_init() by getting out early if we are
self-suspending (PMF_F_SELF).
rtw(4) improvements:
Destroy rtw(4) callouts when we detach it. Make rtw at
pci detachable. Print some more information with the "rx
frame too long" warning.
Remove activate() methods:
Get rid of rtw_activate() and ath_activate(). The device
activate() methods are not good for much these days.
Make ath at cardbus resume with crypto functions intact:
Introduce a boolean device property, "pmf-powerdown". If
pmf-powerdown is present and false, it indicates that a
bus back-end should not remove power from a device.
Honor this property in cardbus_child_suspend().
Set this property to 'false' in ath_attach(), since removing
power from an ath at cardbus seems to lobotomize the WPA
crypto engine. XXX Should the pmf-powerdown property
propagate toward the root of the device tree?
Miscellaneous ath(4) changes:
Warn if ath(4) tries to write crypto keys to suspended
hardware.
Reduce differences between FreeBSD and NetBSD in ath(4)
multicast filter setup.
Make ath_printrxbuf() print an rx descriptor's status &
key index, to help debug crypto errors.
Shorten a staircase in ath_ioctl(). Don't check for
ieee80211_ioctl() return code ERESTART, it never happens.
2008-03-12 21:02:21 +03:00
|
|
|
if (!pmf_device_suspend(sc->sc_dev, PMF_F_SELF))
|
|
|
|
pmf_device_resume(dv, PMF_F_SELF);
|
2007-12-09 23:27:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
audio_activity(device_t dv, devactive_t type)
|
|
|
|
{
|
|
|
|
struct audio_softc *sc = device_private(dv);
|
|
|
|
|
|
|
|
if (type != DVA_SYSTEM)
|
|
|
|
return;
|
|
|
|
|
|
|
|
callout_schedule(&sc->sc_idle_counter, audio_idle_timeout * hz);
|
|
|
|
|
2007-12-13 17:40:36 +03:00
|
|
|
sc->sc_idle = false;
|
2007-12-09 23:27:42 +03:00
|
|
|
if (!device_is_active(dv)) {
|
|
|
|
/* XXX joerg How to deal with a failing resume... */
|
Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.
Add a 'flags' argument to suspend/resume handlers and
callers such as pmf_system_suspend().
Define a flag, PMF_F_SELF, which indicates to PMF that a
device is suspending/resuming itself. Add helper routines,
pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
that call pmf_device_suspend(dev, PMF_F_SELF) and
pmf_device_resume(dev, PMF_F_SELF), respectively. Use
PMF_F_SELF to suspend/resume self in ath(4), audio(4),
rtw(4), and sip(4).
In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
callbacks, provided by the bus front-end, with
self-suspension/resumption. Also, clean up the bus
front-ends. Make sure that the interrupt handler is
disestablished during suspension. Get rid of driver-private
flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
device_is_active()/device_has_power() calls, instead.
In the network-class suspend handler, call if_stop(, 0)
instead of if_stop(, 1), because the latter is superfluous
(bus- and driver-suspension hooks will 'disable' the NIC),
and it may cause recursion.
In the network-class resume handler, prevent infinite
recursion through if_init() by getting out early if we are
self-suspending (PMF_F_SELF).
rtw(4) improvements:
Destroy rtw(4) callouts when we detach it. Make rtw at
pci detachable. Print some more information with the "rx
frame too long" warning.
Remove activate() methods:
Get rid of rtw_activate() and ath_activate(). The device
activate() methods are not good for much these days.
Make ath at cardbus resume with crypto functions intact:
Introduce a boolean device property, "pmf-powerdown". If
pmf-powerdown is present and false, it indicates that a
bus back-end should not remove power from a device.
Honor this property in cardbus_child_suspend().
Set this property to 'false' in ath_attach(), since removing
power from an ath at cardbus seems to lobotomize the WPA
crypto engine. XXX Should the pmf-powerdown property
propagate toward the root of the device tree?
Miscellaneous ath(4) changes:
Warn if ath(4) tries to write crypto keys to suspended
hardware.
Reduce differences between FreeBSD and NetBSD in ath(4)
multicast filter setup.
Make ath_printrxbuf() print an rx descriptor's status &
key index, to help debug crypto errors.
Shorten a staircase in ath_ioctl(). Don't check for
ieee80211_ioctl() return code ERESTART, it never happens.
2008-03-12 21:02:21 +03:00
|
|
|
pmf_device_resume(sc->sc_dev, PMF_F_SELF);
|
|
|
|
pmf_device_resume(dv, PMF_F_SELF);
|
2007-12-09 23:27:42 +03:00
|
|
|
}
|
|
|
|
}
|
2008-02-13 21:31:51 +03:00
|
|
|
#endif
|
2007-12-09 23:27:42 +03:00
|
|
|
|
|
|
|
static bool
|
Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.
Add a 'flags' argument to suspend/resume handlers and
callers such as pmf_system_suspend().
Define a flag, PMF_F_SELF, which indicates to PMF that a
device is suspending/resuming itself. Add helper routines,
pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
that call pmf_device_suspend(dev, PMF_F_SELF) and
pmf_device_resume(dev, PMF_F_SELF), respectively. Use
PMF_F_SELF to suspend/resume self in ath(4), audio(4),
rtw(4), and sip(4).
In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
callbacks, provided by the bus front-end, with
self-suspension/resumption. Also, clean up the bus
front-ends. Make sure that the interrupt handler is
disestablished during suspension. Get rid of driver-private
flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
device_is_active()/device_has_power() calls, instead.
In the network-class suspend handler, call if_stop(, 0)
instead of if_stop(, 1), because the latter is superfluous
(bus- and driver-suspension hooks will 'disable' the NIC),
and it may cause recursion.
In the network-class resume handler, prevent infinite
recursion through if_init() by getting out early if we are
self-suspending (PMF_F_SELF).
rtw(4) improvements:
Destroy rtw(4) callouts when we detach it. Make rtw at
pci detachable. Print some more information with the "rx
frame too long" warning.
Remove activate() methods:
Get rid of rtw_activate() and ath_activate(). The device
activate() methods are not good for much these days.
Make ath at cardbus resume with crypto functions intact:
Introduce a boolean device property, "pmf-powerdown". If
pmf-powerdown is present and false, it indicates that a
bus back-end should not remove power from a device.
Honor this property in cardbus_child_suspend().
Set this property to 'false' in ath_attach(), since removing
power from an ath at cardbus seems to lobotomize the WPA
crypto engine. XXX Should the pmf-powerdown property
propagate toward the root of the device tree?
Miscellaneous ath(4) changes:
Warn if ath(4) tries to write crypto keys to suspended
hardware.
Reduce differences between FreeBSD and NetBSD in ath(4)
multicast filter setup.
Make ath_printrxbuf() print an rx descriptor's status &
key index, to help debug crypto errors.
Shorten a staircase in ath_ioctl(). Don't check for
ieee80211_ioctl() return code ERESTART, it never happens.
2008-03-12 21:02:21 +03:00
|
|
|
audio_suspend(device_t dv PMF_FN_ARGS)
|
2007-12-09 23:27:42 +03:00
|
|
|
{
|
|
|
|
struct audio_softc *sc = device_private(dv);
|
|
|
|
const struct audio_hw_if *hwp = sc->hw_if;
|
|
|
|
int (s);
|
|
|
|
|
|
|
|
s = splaudio();
|
|
|
|
audio_mixer_capture(sc);
|
|
|
|
if (sc->sc_pbus == true)
|
|
|
|
hwp->halt_output(sc->hw_hdl);
|
|
|
|
if (sc->sc_rbus == true)
|
|
|
|
hwp->halt_input(sc->hw_hdl);
|
2008-02-13 21:31:51 +03:00
|
|
|
#ifdef AUDIO_PM_IDLE
|
2007-12-09 23:27:42 +03:00
|
|
|
callout_stop(&sc->sc_idle_counter);
|
2008-02-13 21:31:51 +03:00
|
|
|
#endif
|
2007-12-09 23:27:42 +03:00
|
|
|
splx(s);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.
Add a 'flags' argument to suspend/resume handlers and
callers such as pmf_system_suspend().
Define a flag, PMF_F_SELF, which indicates to PMF that a
device is suspending/resuming itself. Add helper routines,
pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
that call pmf_device_suspend(dev, PMF_F_SELF) and
pmf_device_resume(dev, PMF_F_SELF), respectively. Use
PMF_F_SELF to suspend/resume self in ath(4), audio(4),
rtw(4), and sip(4).
In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
callbacks, provided by the bus front-end, with
self-suspension/resumption. Also, clean up the bus
front-ends. Make sure that the interrupt handler is
disestablished during suspension. Get rid of driver-private
flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
device_is_active()/device_has_power() calls, instead.
In the network-class suspend handler, call if_stop(, 0)
instead of if_stop(, 1), because the latter is superfluous
(bus- and driver-suspension hooks will 'disable' the NIC),
and it may cause recursion.
In the network-class resume handler, prevent infinite
recursion through if_init() by getting out early if we are
self-suspending (PMF_F_SELF).
rtw(4) improvements:
Destroy rtw(4) callouts when we detach it. Make rtw at
pci detachable. Print some more information with the "rx
frame too long" warning.
Remove activate() methods:
Get rid of rtw_activate() and ath_activate(). The device
activate() methods are not good for much these days.
Make ath at cardbus resume with crypto functions intact:
Introduce a boolean device property, "pmf-powerdown". If
pmf-powerdown is present and false, it indicates that a
bus back-end should not remove power from a device.
Honor this property in cardbus_child_suspend().
Set this property to 'false' in ath_attach(), since removing
power from an ath at cardbus seems to lobotomize the WPA
crypto engine. XXX Should the pmf-powerdown property
propagate toward the root of the device tree?
Miscellaneous ath(4) changes:
Warn if ath(4) tries to write crypto keys to suspended
hardware.
Reduce differences between FreeBSD and NetBSD in ath(4)
multicast filter setup.
Make ath_printrxbuf() print an rx descriptor's status &
key index, to help debug crypto errors.
Shorten a staircase in ath_ioctl(). Don't check for
ieee80211_ioctl() return code ERESTART, it never happens.
2008-03-12 21:02:21 +03:00
|
|
|
audio_resume(device_t dv PMF_FN_ARGS)
|
2007-12-09 23:27:42 +03:00
|
|
|
{
|
|
|
|
struct audio_softc *sc = device_private(dv);
|
|
|
|
int s;
|
|
|
|
|
|
|
|
s = splaudio();
|
2007-12-13 17:02:53 +03:00
|
|
|
if (sc->sc_lastinfovalid)
|
|
|
|
audiosetinfo(sc, &sc->sc_lastinfo);
|
2007-12-09 23:27:42 +03:00
|
|
|
audio_mixer_restore(sc);
|
|
|
|
if (sc->sc_pbus == true)
|
|
|
|
audiostartp(sc);
|
|
|
|
if (sc->sc_rbus == true)
|
|
|
|
audiostartr(sc);
|
|
|
|
splx(s);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
audio_volume_down(device_t dv)
|
|
|
|
{
|
|
|
|
struct audio_softc *sc = device_private(dv);
|
|
|
|
u_int gain, newgain;
|
|
|
|
u_char balance;
|
|
|
|
int s;
|
|
|
|
|
|
|
|
s = splaudio();
|
|
|
|
au_get_gain(sc, &sc->sc_outports, &gain, &balance);
|
|
|
|
newgain = gain - 32;
|
|
|
|
if (newgain > 255)
|
|
|
|
newgain = 0;
|
|
|
|
au_set_gain(sc, &sc->sc_outports, newgain, balance);
|
|
|
|
splx(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
audio_volume_up(device_t dv)
|
|
|
|
{
|
|
|
|
struct audio_softc *sc = device_private(dv);
|
|
|
|
u_int gain, newgain;
|
|
|
|
u_char balance;
|
|
|
|
int s;
|
|
|
|
|
|
|
|
s = splaudio();
|
|
|
|
au_get_gain(sc, &sc->sc_outports, &gain, &balance);
|
|
|
|
newgain = gain + 32;
|
|
|
|
if (newgain > 255)
|
|
|
|
newgain = 255;
|
|
|
|
au_set_gain(sc, &sc->sc_outports, newgain, balance);
|
|
|
|
splx(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
audio_volume_toggle(device_t dv)
|
|
|
|
{
|
|
|
|
struct audio_softc *sc = device_private(dv);
|
|
|
|
u_int gain, newgain;
|
|
|
|
u_char balance;
|
|
|
|
int s;
|
|
|
|
|
|
|
|
s = splaudio();
|
|
|
|
au_get_gain(sc, &sc->sc_outports, &gain, &balance);
|
|
|
|
if (gain != 0) {
|
|
|
|
sc->sc_lastgain = gain;
|
|
|
|
newgain = sc->sc_lastgain;
|
|
|
|
} else
|
|
|
|
newgain = 0;
|
|
|
|
au_set_gain(sc, &sc->sc_outports, newgain, balance);
|
|
|
|
splx(s);
|
|
|
|
}
|
|
|
|
|
2006-06-27 06:07:08 +04:00
|
|
|
#endif /* NAUDIO > 0 */
|