Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/audio audioattach:
details: https://anonhg.NetBSD.org/src/rev/9a0a4e7691f6
branches: trunk
changeset: 999027:9a0a4e7691f6
user: nakayama <nakayama%NetBSD.org@localhost>
date: Mon May 13 04:09:35 2019 +0000
description:
audioattach:
Output the cause of the audio device disabled along with the error code.
diffstat:
sys/dev/audio/audio.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diffs (58 lines):
diff -r df06701d7f5a -r 9a0a4e7691f6 sys/dev/audio/audio.c
--- a/sys/dev/audio/audio.c Mon May 13 02:03:07 2019 +0000
+++ b/sys/dev/audio/audio.c Mon May 13 04:09:35 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.3 2019/05/11 03:26:43 maya Exp $ */
+/* $NetBSD: audio.c,v 1.4 2019/05/13 04:09:35 nakayama Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -149,7 +149,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.3 2019/05/11 03:26:43 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.4 2019/05/13 04:09:35 nakayama Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -928,12 +928,16 @@
memset(&pfil, 0, sizeof(pfil));
memset(&rfil, 0, sizeof(rfil));
mutex_enter(sc->sc_lock);
- if (audio_hw_probe(sc, is_indep, &mode, &phwfmt, &rhwfmt) != 0) {
+ error = audio_hw_probe(sc, is_indep, &mode, &phwfmt, &rhwfmt);
+ if (error) {
mutex_exit(sc->sc_lock);
+ aprint_error_dev(self, "audio_hw_probe failed, "
+ "error = %d\n", error);
goto bad;
}
if (mode == 0) {
mutex_exit(sc->sc_lock);
+ aprint_error_dev(self, "audio_hw_probe failed, no mode\n");
goto bad;
}
/* Init hardware. */
@@ -941,6 +945,8 @@
error = audio_hw_set_format(sc, mode, &phwfmt, &rhwfmt, &pfil, &rfil);
if (error) {
mutex_exit(sc->sc_lock);
+ aprint_error_dev(self, "audio_hw_set_format failed, "
+ "error = %d\n", error);
goto bad;
}
@@ -950,8 +956,11 @@
*/
error = audio_mixers_init(sc, mode, &phwfmt, &rhwfmt, &pfil, &rfil);
mutex_exit(sc->sc_lock);
- if (sc->sc_pmixer == NULL && sc->sc_rmixer == NULL)
+ if (sc->sc_pmixer == NULL && sc->sc_rmixer == NULL) {
+ aprint_error_dev(self, "audio_mixers_init failed, "
+ "error = %d\n", error);
goto bad;
+ }
selinit(&sc->sc_wsel);
selinit(&sc->sc_rsel);
Home |
Main Index |
Thread Index |
Old Index