Opened 16 years ago
Closed 16 years ago
Last modified 4 years ago
#2877 closed defect (fixed)
AGOS: No Adlib music in Elvira 2
|Reported by:||SF/bellut||Owned by:||eriktorbjorn|
Somewhere between svn 24373 and svn 24408 there was a change which leads to scummvm reporting
WARNING: Could not open audio device: Audio device is already opened!
There's still some sound, but not all of it. In Elvira 2 there's the heartbeat, but no background music.
Ticket imported from: #1582389. Ticket imported from: bugs/2877.
Change History (13)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
comment:3 by , 16 years ago
What version of Elvira 2 are you using ? AtariST, Amiga or DOS ?
The music is currently only supported in the DOS version.
comment:4 by , 16 years ago
I'm using the DOS version. With 24373 there was music in Elvira 2.
comment:5 by , 16 years ago
I now found out the change from 24405 to 24406 made the music disappear. If I reverse the changes (effectly ignoring MIDI commands 0xA and 0xB) the music's back. I don't know if this is the _right_ way to do it (in fact, I'm pretty sure it's the wrong way), but it works for me.
comment:6 by , 16 years ago
comment:7 by , 16 years ago
Torbjorn, since you made that change, may you take a look at it?
comment:8 by , 16 years ago
Well, I know for certain that reverting the change isn't the right fix. The patch prevents a crash in Elvira 1 where the MIDI parser would get out of sync (because it had the wrong length for some opcodes) and miss the "end of track marker", causing it to keep reading outside of the allocated buffer.
Out of curiosity, which music driver are we talking about here? I don't have any problems with the ALSA driver (Linux), but I don't get any music with the Adlib driver unless I revert the change. It would be interesting to know if any other drivers have the same problem.
comment:9 by , 16 years ago
Yes, it's Adlib here, too. For some reasons (mainly the age, I suspect) I don't get any sound with the ALSA driver.
comment:10 by , 16 years ago
|Status:||new → closed|
|Summary:||AGOS: audio device already opened → AGOS: No Adlib music in Elvira 2|
comment:11 by , 16 years ago
I have a theory on what's happening. It seems that with the patch, Elvira 2 plays music without ever selecting any instruments. With a real MIDI driver (e.g. ALSA), these channels are played with a piano instrument. The "Acoustic Piano" is the first instrument in the General MIDI instrument set.
However, in the Adlib driver the channels start out with no instrument at all (or possibly an undefined instrument). I have changed this so that Adlib also uses the first instrument by default.
The sound you heard in Elvira 2 was probably the percussion channel. Before the patch, some of the messages were probably mis-translated as "program change" messages, i.e. it was probably pure coincidence that it worked at all.
By the way, I don't know why the ALSA driver doesn't work for you. Maybe your sound card doesn't support MIDI. Or maybe it's like mine (Soundblaster Live!) and requires you to load a sound font first. (This has absolutely nothing to do with ScummVM's "SoundFont" setting. I have to use "asfxload".)
comment:12 by , 16 years ago
This restores sound in Elvira 2 (and plays the opening sound in Elvira 1 for the first time) with the Adlib driver, thanks.
Regarding the ALSA Driver your right, of course. I was somehow under the impression I set up soundfont loading at boot time, it seems, I didn't. How emberassing.
comment:13 by , 4 years ago
|Component:||→ Engine: AGOS|
|Game:||→ Elvira 2|
With svn 24464 (and since 24445 I believe) the warning message is gone, still not all sounds, though.