Ticket #13769 (closed defect: fixed)
Problem with SoundBlaster 16 Interrupt Flags (fix included)
Reported by: | SpyderTL | Owned by: | |
---|---|---|---|
Component: | audio | Version: | VirtualBox 4.3.20 |
Keywords: | SB16 Sound Blaster 16 | Cc: | |
Guest type: | other | Host type: | all |
Description
I stumbled across this issue while working on a SoundBlaster 16 driver for my personal OS.
I noticed that the Interrupt Flags, located at Mixer Register 0x82 (bits 0 and 1) are never cleared, even after an interrupt has been acknowledged.
I scanned through the devsb16.cpp file, and found this:
1164 case 0x0e: /* data available status | irq 8 ack */ 1165 retval = (!s->out_data_len || s->highspeed) ? 0 : 0x80; 1166 if (s->mixer_regs[0x82] & 1) { 1167 ack = 1; 1168 s->mixer_regs[0x82] &= 1; // PROBLEM! 1169#ifndef VBOX 1170 qemu_irq_lower (s->pic[s->irq]); 1171#else 1172 PDMDevHlpISASetIrq(s->pDevIns, s->irq, 0); 1173#endif 1174 } 1175 break; 1176 1177 case 0x0f: /* irq 16 ack */ 1178 retval = 0xff; 1179 if (s->mixer_regs[0x82] & 2) { 1180 ack = 1; 1181 s->mixer_regs[0x82] &= 2; // PROBLEM!! 1182#ifndef VBOX 1183 qemu_irq_lower (s->pic[s->irq]); 1184#else 1185 PDMDevHlpISASetIrq(s->pDevIns, s->irq, 0); 1186#endif 1187 } 1188 break;
The problem appears to be on line 1168 and 1181. Those flags should be inverted before they are ANDed with the current value:
1168 s->mixer_regs[0x82] &= ~1; // FIXED! 1181 s->mixer_regs[0x82] &= ~2; // FIXED!
I would submit this patched code myself, but I am not set up on this machine to download and compile VBOX.
Thanks for your help, guys. Great product.
Change History
comment:2 Changed 8 years ago by frank
If you have a test case we would even consider applying the patch if the original Qemu author would not respond.
That certainly looks sensible, but none of us have looked at that code for a long time (if at all). Perhaps you could run your patch past the original Qemu author, Vasily Karpov<1>? Thanks.
<1> http://git.qemu.org/?p=qemu.git;a=commit;h=cf4dc461a4cfc3e056ee24edb26154f4d34a6278