Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No sound playback in Impulse Tracker with Sound Blaster 16 #248

Open
Vort opened this issue Jan 29, 2024 · 2 comments
Open

No sound playback in Impulse Tracker with Sound Blaster 16 #248

Vort opened this issue Jan 29, 2024 · 2 comments

Comments

@Vort
Copy link
Contributor

Vort commented Jan 29, 2024

After loading test music file (elysium.mod) into Impulse Tracker and starting playback, nothing happens.

To reproduce this problem, load test configuration attached below and press Enter, Enter, F5.

bochs_impulse_hang.mp4

This is how program should work (video should be played with sound turned on):

dosbox_impulse.mp4

Impulse Tracker is open source software. Its code can be useful for debugging:
https://github.com/herrnst/impulsetracker

Test files: impulse.zip.
Version: b373890.

@Vort
Copy link
Contributor Author

Vort commented Feb 6, 2024

Impulse Tracker is able to produce sound with it /S4 (Sound Blaster Pro) driver.
So problem with Sound Blaster 16 is related to differences between Pro and 16.

@Vort
Copy link
Contributor Author

Vort commented Feb 6, 2024

Here are the differences:
/S4 (Sound Blaster Pro) driver makes DSP Reset only once, when program is started.
/S5 (Sound Blaster 16) driver makes DSP Reset several times.

Important thing is that ITSB16 driver makes such reset during active DMA transfer:

00608654538 (4) DMA transfer done, triggering IRQ
00608654538 (4) auto-DMA reinitializing to length 2047
00608654741 (4) read from mixer register 82 returns 42
00608654827 (4) 16-bit DMA IRQ acknowledged
00608767178 (5) Received 8-bit DMA: 0x00, 2047 remaining 
00608806995 (4) DSP Reset port write value 1
00608807082 (3) Read access to 0x0226: unsupported port!
00608807163 (3) Read access to 0x0226: unsupported port!
00608807244 (3) Read access to 0x0226: unsupported port!
00608807325 (3) Read access to 0x0226: unsupported port!
00608807406 (4) DSP Reset port write value 0
00608807406 (4) DSP resetting...
00608807406 (4) DSP reset: DMA aborted
00608807406 (4) DMA transfer done, triggering IRQ
00608807610 (4) read from mixer register 82 returns 42
00608807696 (3) 16-bit DMA IRQ acknowledged but not active!

And looks like Bochs reacts to such situation incorrectly.
16-bit DMA IRQ acknowledged but not active! message is sign of a problem.

I think something is wrong in this place:

if (DSP.dma.mode != 0)
{
writelog(WAVELOG(4), "DSP reset: DMA aborted");
DSP.dma.mode = 1; // no auto init anymore
dsp_dmadone();
}
DSP.resetport = 0;
DSP.speaker = 0;
DSP.irqpending = 0;

bx_sb16_c::dsp_dmadone sets DSP.irqpending = 1; and then bx_sb16_c::dsp_reset just sets it back to 0.

If I remove DSP.irqpending = 0; line from dsp_reset, Impulse Tracker with Sound Blaster 16 starts to produce sound.
But, most likely, something smarter should be done with it instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant