From: Arne Welzel Date: Thu, 15 Nov 2012 11:05:51 +0000 (+0100) Subject: libaudiodriver: handle interrupt only once X-Git-Tag: v3.3.0~832 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=842c4ed;p=minix.git libaudiodriver: handle interrupt only once Apparently, qemu's sb16 doesn't reset the interrupt register of the mixer and the driver ends up in an endless loop when playing a "multi-fragment" sample. Change-Id: I47633b99a0d79ba201aec785da69fb3950e026bf --- diff --git a/lib/libaudiodriver/audio_fw.c b/lib/libaudiodriver/audio_fw.c index 58ce03a4f..34ae2f5e8 100644 --- a/lib/libaudiodriver/audio_fw.c +++ b/lib/libaudiodriver/audio_fw.c @@ -607,16 +607,13 @@ static void msg_hardware(void) { u32_t i; - /* while we have an interrupt */ - while ( drv_int_sum()) { - /* loop over all sub devices */ - for ( i = 0; i < drv.NrOfSubDevices; i++) { - /* if interrupt from sub device and Dma transfer - was actually busy, take care of business */ - if( drv_int(i) && sub_dev[i].DmaBusy ) { - if (sub_dev[i].DmaMode == DEV_WRITE_S) handle_int_write(i); - if (sub_dev[i].DmaMode == DEV_READ_S) handle_int_read(i); - } + /* loop over all sub devices */ + for ( i = 0; i < drv.NrOfSubDevices; i++) { + /* if interrupt from sub device and Dma transfer + was actually busy, take care of business */ + if( drv_int(i) && sub_dev[i].DmaBusy ) { + if (sub_dev[i].DmaMode == DEV_WRITE_S) handle_int_write(i); + if (sub_dev[i].DmaMode == DEV_READ_S) handle_int_read(i); } }