Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/hdaudio Make sure we have at least one of playback o...



details:   https://anonhg.NetBSD.org/src/rev/2eb3f14feb3d
branches:  trunk
changeset: 467250:2eb3f14feb3d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jan 18 12:00:33 2020 +0000

description:
Make sure we have at least one of playback or capture streams setup before
attaching the audio layer.

diffstat:

 sys/dev/hdaudio/hdafg.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r e9e7510550c2 -r 2eb3f14feb3d sys/dev/hdaudio/hdafg.c
--- a/sys/dev/hdaudio/hdafg.c   Sat Jan 18 11:26:11 2020 +0000
+++ b/sys/dev/hdaudio/hdafg.c   Sat Jan 18 12:00:33 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.18 2019/06/08 08:02:38 isaki Exp $ */
+/* $NetBSD: hdafg.c,v 1.19 2020/01/18 12:00:33 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.18 2019/06/08 08:02:38 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.19 2020/01/18 12:00:33 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3781,6 +3781,12 @@
        sc->sc_audiodev.ad_playback = hdaudio_stream_establish(sc->sc_host,
            HDAUDIO_STREAM_OSS, hdafg_stream_intr, &sc->sc_audiodev);
 
+       if (sc->sc_audiodev.ad_capture == NULL &&
+           sc->sc_audiodev.ad_playback == NULL) {
+               hda_error(sc, "couldn't find any input or output streams\n");
+               return;
+       }
+
        hda_debug(sc, "connecting streams\n");
        defparams.channels = 2;
        defparams.sample_rate = sc->sc_fixed_rate ? sc->sc_fixed_rate : 48000;



Home | Main Index | Thread Index | Old Index