MT-32: ALSA buffer underrun only happening with LucasArts games

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
vanfanel
Posts: 73
Joined: Sat Dec 15, 2012 11:14 am

MT-32: ALSA buffer underrun only happening with LucasArts games

Post by vanfanel »

Hi there, Scummvm audiophiles

I have noticed something strange: when using the included MT-32 emulation, I see this when the game is started:

Code: Select all

Starting 'Loom'
ALSA lib pcm.c:8306:(snd_pcm_recover) underrun occurred
-That is the only time it happens. It never happens during the game, no matter how many MT-32 channels are playing simultaneously. (My guess is that for some reason ALSA starts consuming samples before the MT-32 has started filling a buffer?)

-It ONLY happens with LucasArts games (Loom, Monkey Island EGA) and not with any Sierra games that I have like Space Quest I or IV (so that is puzzling).

-It happens on X86_64 i5 systems and it happens on Raspberry Pi 3, so its not a CPU performance problem.

-There is NO Pulseaudio on any on my systems, so dirty PulseAudio is not to blame. There is only direct ALSA here.

-No Xorg server involved. I run Scummvm directly on SDL2 with KMSDRM backend, no other process accessing sound hardware at the same time.

So, just out of curiosity, what could be causing this?
ZvikaZ
Posts: 76
Joined: Thu Mar 05, 2020 7:04 pm

Re: MT-32: ALSA buffer underrun only happening with LucasArts games

Post by ZvikaZ »

Have you tried with other audio devices, other than MT-32?
It would narrow down the problem.
vanfanel
Posts: 73
Joined: Sat Dec 15, 2012 11:14 am

Re: MT-32: ALSA buffer underrun only happening with LucasArts games

Post by vanfanel »

ZvikaZ wrote: Mon Apr 27, 2020 10:57 am Have you tried with other audio devices, other than MT-32?
It would narrow down the problem.
Yes, that is why I am reporting: it ONLY happens with MT-32 emulation.
ZvikaZ
Posts: 76
Joined: Thu Mar 05, 2020 7:04 pm

Re: MT-32: ALSA buffer underrun only happening with LucasArts games

Post by ZvikaZ »

You can try run `scummvm --dump-midi`.
That's will create a 'dump.mid' on your local directory, when you'll quit the game.

Then try to play the file with Munt.

BTW,
Besides that warning, do you hear any problem? Or is it just that warning?
vanfanel
Posts: 73
Joined: Sat Dec 15, 2012 11:14 am

Re: MT-32: ALSA buffer underrun only happening with LucasArts games

Post by vanfanel »

ZvikaZ wrote: Mon Apr 27, 2020 2:47 pm You can try run `scummvm --dump-midi`.
That's will create a 'dump.mid' on your local directory, when you'll quit the game.

Then try to play the file with Munt.

BTW,
Besides that warning, do you hear any problem? Or is it just that warning?
Sorry for taking so long to answer!
I have done what you said, and the resulting MIDI plays perfectly fine with MUNT, but in Scummvm the Loom intro with MT32 emulation has small audio dropouts, apart from the warning.
Thing is, other non-Lucas games DO NOT show the warning and DO NOT show these dropouts even with a lot of MT32 channels playing at the same time in Scummvm.

So, I have been searching in the scumm engine code but I couldnt find an answer so I have to ask: Do scumm engine (Lucas) games set an smaller MT32 audio buffer in Scummvm somehow than lets say Sierra games when they use MT32?
Post Reply