summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/azalia.c26
-rw-r--r--sys/dev/pci/cmpci.c16
-rw-r--r--sys/dev/pci/eso.c16
3 files changed, 42 insertions, 16 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;
diff --git a/sys/dev/pci/cmpci.c b/sys/dev/pci/cmpci.c
index e36689fc89b..753fb0569f8 100644
--- a/sys/dev/pci/cmpci.c
+++ b/sys/dev/pci/cmpci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmpci.c,v 1.19 2008/05/13 02:24:08 brad Exp $ */
+/* $OpenBSD: cmpci.c,v 1.20 2008/05/29 07:20:15 jakemsr Exp $ */
/* $NetBSD: cmpci.c,v 1.25 2004/10/26 06:32:20 xtraeme Exp $ */
/*
@@ -133,6 +133,7 @@ int cmpci_query_encoding(void *, struct audio_encoding *);
int cmpci_set_params(void *, int, int,
struct audio_params *,
struct audio_params *);
+void cmpci_get_default_params(void *, int, struct audio_params*);
int cmpci_round_blocksize(void *, int);
int cmpci_halt_output(void *);
int cmpci_halt_input(void *);
@@ -179,7 +180,7 @@ struct audio_hw_if cmpci_hw_if = {
cmpci_get_props, /* get_props */
cmpci_trigger_output, /* trigger_output */
cmpci_trigger_input, /* trigger_input */
- NULL
+ cmpci_get_default_params
};
/*
@@ -632,6 +633,17 @@ cmpci_query_encoding(void *handle, struct audio_encoding *fp)
return 0;
}
+void
+cmpci_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
cmpci_set_params(void *handle, int setmode, int usemode,
struct audio_params *play, struct audio_params *rec)
diff --git a/sys/dev/pci/eso.c b/sys/dev/pci/eso.c
index b7af1fb89af..b26aec62434 100644
--- a/sys/dev/pci/eso.c
+++ b/sys/dev/pci/eso.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eso.c,v 1.25 2008/04/21 00:32:43 jakemsr Exp $ */
+/* $OpenBSD: eso.c,v 1.26 2008/05/29 07:20:15 jakemsr Exp $ */
/* $NetBSD: eso.c,v 1.48 2006/12/18 23:13:39 kleink Exp $ */
/*
@@ -110,6 +110,7 @@ void eso_close(void *);
int eso_query_encoding(void *, struct audio_encoding *);
int eso_set_params(void *, int, int, struct audio_params *,
struct audio_params *);
+void eso_get_default_params(void *, int, struct audio_params *);
int eso_round_blocksize(void *, int);
int eso_halt_output(void *);
int eso_halt_input(void *);
@@ -158,7 +159,7 @@ struct audio_hw_if eso_hw_if = {
eso_get_props,
eso_trigger_output,
eso_trigger_input,
- NULL
+ eso_get_default_params
};
const char * const eso_rev2model[] = {
@@ -680,6 +681,17 @@ eso_query_encoding(void *hdl, struct audio_encoding *fp)
return (0);
}
+void
+eso_get_default_params(void *addr, int mode, struct audio_params *params)
+{
+ params->sample_rate = 48000;
+ params->encoding = AUDIO_ENCODING_ULINEAR_LE;
+ params->precision = 16;
+ params->channels = 2;
+ params->sw_code = NULL;
+ params->factor = 1;
+}
+
int
eso_set_params(void *hdl, int setmode, int usemode,
struct audio_params *play, struct audio_params *rec)