Current-Users archive

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

Current page fault trap when plugging in a USB DAC



Hi,

I'm seeing the following crash when plugging in a Benchmark DAC1 USB into a 
NetBSD 5.99.52 am64 system:

page fault trap , code 0
Soppted in pid 0.50 (system) at netbsd:audio_calcwater+0x1c ...
db{1}> bt
audio_calcwater
audiosetinfo
...

The page fault is caused by a null sc->sc_pustream pointer in audio.c on line 
1372:

(gdb) list *0xffffffff801cf09d
0xffffffff801cf09d is in audio_calcwater (/usr/src/sys/dev/audio.c:1372).
1367    audio_calcwater(struct audio_softc *sc)
1368    {
1369    
1370            /* set high at 100% */
1371            if (audio_can_playback(sc)) {
1372                    sc->sc_pr.usedhigh =
1373                        sc->sc_pustream->end - sc->sc_pustream->start;
1374                    /* set low at 75% of usedhigh */
1375                    sc->sc_pr.usedlow = sc->sc_pr.usedhigh * 3 / 4;
1376                    if (sc->sc_pr.usedlow == sc->sc_pr.usedhigh)

Looking over the code, I'm not sure this is even supposed to work. For 
instance, usb/uaudio.c contains

uaudio_get_props(void *addr)
{       
        return AUDIO_PROP_FULLDUPLEX | AUDIO_PROP_INDEPENDENT;
}       

and audio.c contains

audio_get_props(struct audio_softc *sc)
{       
        const struct audio_hw_if *hw;
        int props;

        hw = sc->hw_if;
        props = hw->get_props(sc->hw_hdl);
        
        /*      
         * if neither playback nor capture properties are reported,
         * assume both are supported by the device driver
         */     
        if ((props & (AUDIO_PROP_PLAYBACK|AUDIO_PROP_CAPTURE)) == 0)
                props |= (AUDIO_PROP_PLAYBACK | AUDIO_PROP_CAPTURE);
        
        return props;
}       

which causes both audio_can_playback(sc) and audio_can_capture(sc) to return 
true.


Home | Main Index | Thread Index | Old Index