NetBSD-Bugs archive

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

kern/52582: audio: init_input is not called under certain situation



>Number:         52582
>Category:       kern
>Synopsis:       audio: init_input is not called under certain situation
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 30 06:45:00 +0000 2017
>Originator:     Tetsuya Isaki
>Release:        NetBSD 8.99.3
>Organization:
>Environment:
NetBSD 8.99.3 i386
>Description:
hw->init_input() is not called under following situation.

Step1. Start playback.
   % audioplay longmusic.wav &
   hw->init_output
   hw->init_output
   hw->init_output

Step2. Start recording before the playback ends.
   % audiorecord rec.wav

Here, hw->init_input() is not called.
>How-To-Repeat:
See above.
Even if your device does not use init_input/output method,
the problem can be easily seen with this patch.

--- sys/dev/audio.c
+++ sys/dev/audio.c
@@ -2028,6 +2028,7 @@ audio_initbufs(struct audio_softc *sc, struct virtual_channel *vc)
 		audio_init_ringbuffer(sc, &vc->sc_mrr,
 		    AUMODE_RECORD);
 		if (sc->sc_opens == 0 && (vc->sc_mode & AUMODE_RECORD)) {
+printf("hw->init_input\n");
 			if (hw->init_input) {
 				error = hw->init_input(sc->hw_hdl,
 				    vc->sc_mrr.s.start,
@@ -2044,6 +2045,7 @@ audio_initbufs(struct audio_softc *sc, struct virtual_channel *vc)
 		    AUMODE_PLAY);
 		vc->sc_sil_count = 0;
 		if (sc->sc_opens == 0 && (vc->sc_mode & AUMODE_PLAY)) {
+printf("hw->init_output\n");
 			if (hw->init_output) {
 				error = hw->init_output(sc->hw_hdl,
 				    vc->sc_mpr.s.start,

>Fix:
N/A



Home | Main Index | Thread Index | Old Index