Nat,

@@ -5788,6 +5790,9 @@ audio_sysctl_frequency(SYSCTLFN_ARGS)
        sc->sc_iffreq = t;
        error = audio_set_vchan_defaults(sc, AUMODE_PLAY | AUMODE_PLAY_ALL
            | AUMODE_RECORD, &sc->sc_format[0], 0);
+       if (error)
+               aprint_error("Invalid channel format, please check hardware "
+                            "capabilities\n");
        mutex_exit(sc->sc_lock);

        return error;
@@ -5837,6 +5842,9 @@ audio_sysctl_precision(SYSCTLFN_ARGS)

        error = audio_set_vchan_defaults(sc, AUMODE_PLAY | AUMODE_PLAY_ALL
            | AUMODE_RECORD, &sc->sc_format[0], 0);
+       if (error)
+               aprint_error("Invalid channel format, please check hardware "
+                            "capabilities\n");
        mutex_exit(sc->sc_lock);

        return error;
@@ -5875,10 +5883,63 @@ audio_sysctl_channels(SYSCTLFN_ARGS)
        sc->sc_channels = t;
        error = audio_set_vchan_defaults(sc, AUMODE_PLAY | AUMODE_PLAY_ALL
            | AUMODE_RECORD, &sc->sc_format[0], 0);
-
+       if (error)
+               aprint_error("Invalid channel format, please check hardware "
+                            "capabilities\n");
        mutex_exit(sc->sc_lock);

        return error;
 }


Perhaps it might be more helpful if you used different error messages for these, to help identify which one occurs? Perhaps you could also report the specific audio device, using aprint_error_dev()?





On Sat, 21 Jan 2017, Nathanial Sloss wrote:

Module Name:    src
Committed By:   nat
Date:           Sat Jan 21 22:22:41 UTC 2017

Modified Files:
        src/sys/dev: audio.c

Log Message:
Add auto config for channel/hw format.

Addresses PR kern/51703.
Addresses PR kern/51760.
Addresses PR kern/51879.


To generate a diff of this commit:
cvs rdiff -u -r1.291 -r1.292 src/sys/dev/audio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


!DSPAM:5883df5326278963216815!



+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+

Reply via email to