DF-3999 / fix.diff
--- a/sys/dev/sound/pci/envy24ht.c +++ b/sys/dev/sound/pci/envy24ht.c @@ -1430,7 +1430,8 @@ envy24ht_r32sl(struct sc_chinfo *ch) src = dst / 2 + ch->offset; dsize = ch->size / 4; ssize = ch->size / 8; - slot = (ch->num - ENVY24HT_CHAN_REC_ADC1) * 2; + /* clamp: rec hw channels are mis-mapped (see chanmap) and can carry * play-channel numbers; keep the slot inside the 2-entry frame */ + slot = ((ch->num - ENVY24HT_CHAN_REC_ADC1) * 2) % ENVY24HT_REC_CHNUM; for (i = 0; i < length; i++) { data[dst] = dmabuf[src * ENVY24HT_REC_CHNUM + slot].buffer; @@ -1460,7 +1461,8 @@ envy24ht_r16sl(struct sc_chinfo *ch) src = dst / 2 + ch->offset; dsize = ch->size / 2; ssize = ch->size / 8; - slot = (ch->num - ENVY24HT_CHAN_REC_ADC1) * 2; + /* clamp: rec hw channels are mis-mapped (see chanmap) and can carry * play-channel numbers; keep the slot inside the 2-entry frame */ + slot = ((ch->num - ENVY24HT_CHAN_REC_ADC1) * 2) % ENVY24HT_REC_CHNUM; for (i = 0; i < length; i++) { data[dst] = dmabuf[src * ENVY24HT_REC_CHNUM + slot].buffer; |