version 1.72, 2004/07/07 20:21:06 |
version 1.73, 2004/07/07 22:04:28 |
Line 2376 uaudio_set_params(void *addr, int setmod |
|
Line 2376 uaudio_set_params(void *addr, int setmod |
|
if (sc->sc_dying) |
if (sc->sc_dying) |
return (EIO); |
return (EIO); |
|
|
if ((usemode == AUMODE_RECORD && sc->sc_recchan.pipe != NULL) |
if (((usemode & AUMODE_PLAY) && sc->sc_playchan.pipe != NULL) || |
|| (usemode == AUMODE_PLAY && sc->sc_playchan.pipe != NULL)) |
((usemode & AUMODE_RECORD) && sc->sc_recchan.pipe != NULL)) |
return (EBUSY); |
return (EBUSY); |
|
|
if ((usemode & AUMODE_PLAY) && sc->sc_playchan.altidx != -1) |
if ((usemode & AUMODE_PLAY) && sc->sc_playchan.altidx != -1) |
Line 2387 uaudio_set_params(void *addr, int setmod |
|
Line 2387 uaudio_set_params(void *addr, int setmod |
|
|
|
for (mode = AUMODE_RECORD; mode != -1; |
for (mode = AUMODE_RECORD; mode != -1; |
mode = mode == AUMODE_RECORD ? AUMODE_PLAY : -1) { |
mode = mode == AUMODE_RECORD ? AUMODE_PLAY : -1) { |
if (usemode & mode) { |
|
if (mode == AUMODE_PLAY) { |
|
paltidx = i; |
|
sc->sc_alts[i].sc_busy = 1; |
|
} else { |
|
raltidx = i; |
|
sc->sc_alts[i].sc_busy = 1; |
|
} |
|
} |
|
|
|
if ((setmode & mode) == 0) |
if ((setmode & mode) == 0) |
continue; |
continue; |
|
|
if ((sc->sc_mode & mode) == 0) |
|
continue; |
|
|
|
p = (mode == AUMODE_PLAY) ? play : rec; |
p = (mode == AUMODE_PLAY) ? play : rec; |
|
|
factor = 1; |
factor = 1; |
Line 2524 uaudio_set_params(void *addr, int setmod |
|
Line 2511 uaudio_set_params(void *addr, int setmod |
|
|
|
p->sw_code = swcode; |
p->sw_code = swcode; |
p->factor = factor; |
p->factor = factor; |
|
|
|
if (mode == AUMODE_PLAY) |
|
paltidx = i; |
|
else |
|
raltidx = i; |
} |
} |
|
|
if ((usemode & AUMODE_PLAY) /*&& paltidx != sc->sc_playchan.altidx*/) { |
if ((setmode & AUMODE_PLAY)) { |
/* XXX abort transfer if currently happening? */ |
/* XXX abort transfer if currently happening? */ |
uaudio_chan_init(&sc->sc_playchan, paltidx, play, 0); |
uaudio_chan_init(&sc->sc_playchan, paltidx, play, 0); |
} |
} |
if ((usemode & AUMODE_RECORD) /*&& raltidx != sc->sc_recchan.altidx*/) { |
if ((setmode & AUMODE_RECORD)) { |
/* XXX abort transfer if currently happening? */ |
/* XXX abort transfer if currently happening? */ |
uaudio_chan_init(&sc->sc_recchan, raltidx, rec, |
uaudio_chan_init(&sc->sc_recchan, raltidx, rec, |
UGETW(sc->sc_alts[raltidx].edesc->wMaxPacketSize)); |
UGETW(sc->sc_alts[raltidx].edesc->wMaxPacketSize)); |
} |
} |
|
|
|
if ((usemode & AUMODE_PLAY) && sc->sc_playchan.altidx != -1) |
|
sc->sc_alts[sc->sc_playchan.altidx].sc_busy = 1; |
|
if ((usemode & AUMODE_RECORD) && sc->sc_recchan.altidx != -1) |
|
sc->sc_alts[sc->sc_recchan.altidx].sc_busy = 1; |
|
|
DPRINTF(("uaudio_set_params: use altidx=p%d/r%d, altno=p%d/r%d\n", |
DPRINTF(("uaudio_set_params: use altidx=p%d/r%d, altno=p%d/r%d\n", |
sc->sc_playchan.altidx, sc->sc_recchan.altidx, |
sc->sc_playchan.altidx, sc->sc_recchan.altidx, |
(sc->sc_playchan.altidx >= 0) |
(sc->sc_playchan.altidx >= 0) |