diff options
Diffstat (limited to 'sys/dev/pci/azalia.c')
-rw-r--r-- | sys/dev/pci/azalia.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index 074272e46fc..67baab2f991 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.50 2008/05/13 02:24:08 brad Exp $ */ +/* $OpenBSD: azalia.c,v 1.51 2008/05/29 07:20:15 jakemsr Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -263,6 +263,7 @@ void azalia_close(void *); int azalia_query_encoding(void *, audio_encoding_t *); int azalia_set_params(void *, int, int, audio_params_t *, audio_params_t *); +void azalia_get_default_params(void *, int, struct audio_params*); int azalia_round_blocksize(void *, int); int azalia_halt_output(void *); int azalia_halt_input(void *); @@ -320,7 +321,7 @@ struct audio_hw_if azalia_hw_if = { azalia_get_props, azalia_trigger_output, azalia_trigger_input, - NULL + azalia_get_default_params }; static const char *pin_devices[16] = { @@ -2137,6 +2138,17 @@ azalia_query_encoding(void *v, audio_encoding_t *enc) return (EINVAL); } +void +azalia_get_default_params(void *addr, int mode, struct audio_params *params) +{ + params->sample_rate = 48000; + params->encoding = AUDIO_ENCODING_SLINEAR_LE; + params->precision = 16; + params->channels = 2; + params->sw_code = NULL; + params->factor = 1; +} + int azalia_set_params(void *v, int smode, int umode, audio_params_t *p, audio_params_t *r) @@ -2150,11 +2162,6 @@ azalia_set_params(void *v, int smode, int umode, audio_params_t *p, az = v; codec = &az->codecs[az->codecno]; if (smode & AUMODE_RECORD && r != NULL) { - if (r->encoding == AUDIO_ENCODING_ULAW) { /*XXX*/ - r->encoding = AUDIO_ENCODING_SLINEAR_LE; - r->precision = 16; - r->sample_rate = codec->rate; - } for (i = 0; i < codec->nformats; i++) { if (r->encoding != codec->formats[i].encoding) continue; @@ -2197,11 +2204,6 @@ azalia_set_params(void *v, int smode, int umode, audio_params_t *p, r->sw_code = rswcode; } if (smode & AUMODE_PLAY && p != NULL) { - if (p->encoding == AUDIO_ENCODING_ULAW) { /*XXX*/ - p->encoding = AUDIO_ENCODING_SLINEAR_LE; - p->precision = 16; - p->sample_rate = codec->rate; - } for (i = 0; i < codec->nformats; i++) { if (p->encoding != codec->formats[i].encoding) continue; |