VOGONS


Emulating MT-32 on an RPi2

Topic actions

Reply 60 of 292, by ElBrunzy

User metadata
Rank Oldbie
Rank
Oldbie

haha I had so many segfault on linux with players that crashed or whatever ... I use OSS, do you have any idea how to fix that ? to kill the process seem to be of no help, might as well reboot the computer, any idea how to reset the device ?

Reply 61 of 292, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++

If you can build a release version with debug symbols, I'll test it on my end.

ElBrunzy wrote:

haha I had so many segfault on linux with players that crashed or whatever ... I use OSS, do you have any idea how to fix that ? to kill the process seem to be of no help, might as well reboot the computer, any idea how to reset the device ?

OSS (even OSS4) is deprecated and not maintained anymore.

All hail the Great Capacitor Brand Finder

Reply 62 of 292, by stamasd

User metadata
Rank l33t
Rank
l33t

Try this one.

Attachments

  • Filename
    mt32d-dbg.7z
    File size
    175.58 KiB
    Downloads
    98 downloads
    File license
    Fair use/fair dealing exception

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 63 of 292, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++

Here's the result from the debugger:

Program received signal SIGSEGV, Segmentation fault.
MT32Emu::BReverbModel::isMT32Compatible (this=0x0, mode=mode@entry=MT32Emu::REVERB_MODE_ROOM) at /home/silviu/munt/munt/mt32emu/src/BReverbModel.cpp:433

I'm guessing you're using the latest git release. Please try the git ball attached here and we can confirm if your build environment is working properly. If it is, we can bisect the code for the cause of the segfault.

Attachments

  • Filename
    munt_master.zip
    File size
    514.84 KiB
    Downloads
    97 downloads
    File comment
    Munt git from master branch
    File license
    Fair use/fair dealing exception

All hail the Great Capacitor Brand Finder

Reply 64 of 292, by stamasd

User metadata
Rank l33t
Rank
l33t

Yup, with the tarball from you it builds and runs correctly.

silviu@orangepipc:~/munt/test1/munt-master/mt32emu_alsadrv$ ./mt32d
MT-32 emulator ALSA address is 128:0
Buffer resize: Requested 40 msec got 40 msec / 60 periods
Starting MT-32 core
MT-32 emulator ready

I checked out my copy of munt that I've been working with on this board on March 25th, but on other boards I had checked it even earlier and had the same problem (around 3/12 I think).
I see the last change to relevant code in the repository was was to Synth.cpp on 3/6. https://github.com/munt/munt/commit/961ec3ce7 … 01728118fa797f1

However I see your repo has been checked out on Jan 10th, and there have been quite a few changes since then.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 65 of 292, by stamasd

User metadata
Rank l33t
Rank
l33t

checkout f79541a (1/9) ->mt32d runs correctly

(edit) grr, I wanted to walk back commits and locate the problem, but the board crashed during a build and now I seem to have SD card corruption. I may have to reimage it. The revision I was testing was 4019c35 from 1/10.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 66 of 292, by stamasd

User metadata
Rank l33t
Rank
l33t

So I've been very busy at work for the rest of the day and didn't make any progress (and it's likely that I won't be able to do anything for the next few days). But now that we know the git code is at fault, I think that there's a good chance - when I have time again - that I can compile working versions for the Raspberry Pi One and the Odroid as well. And probably also for the Orange Pi One, of which I should have one delivered in the next few days.

I'm thinking that the OPiOne might be in the sweet spot for performance/price for munt, at $10 for a quad-core at 1200MHz. If it works.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 67 of 292, by stamasd

User metadata
Rank l33t
Rank
l33t

FWIW I had a little time this evening to start anew on the Odroid C2; there has been for a few days now a port of Armbian to it, and I've had the best of luck with this distribution on the OPi, the developers are very active and helpful so I thought I'd give it a try. I installed the distro, recompiled the kernel to add the sequencer modules, installed dependencies, checked out munt (at commit 4019c35) and built munt. It works. That's 64-bit too.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 68 of 292, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++

I've bisected the commits and think I've found the problematic one:
Re: Munt Reloaded - Development

Edit: Confirmed, using the git tree at commit 9939950 works safely.

Update: Apr. 4, 2016
Fixed in the latest git.

All hail the Great Capacitor Brand Finder

Reply 69 of 292, by ElBrunzy

User metadata
Rank Oldbie
Rank
Oldbie
gdjacobs wrote:

If you can build a release version with debug symbols, I'll test it on my end.

ElBrunzy wrote:

haha I had so many segfault on linux with players that crashed or whatever ... I use OSS, do you have any idea how to fix that ? to kill the process seem to be of no help, might as well reboot the computer, any idea how to reset the device ?

OSS (even OSS4) is deprecated and not maintained anymore.

yeah sorry for using old computer and soundcard, I know vogons is about mainstream stuff, my error talking about old stuff, Sarge!

Reply 70 of 292, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++

I just meant for new kernels. If you're using a pre-ALSA kernel, knock yourself out!

You're making me nostalgic for my days using Slackware.

All hail the Great Capacitor Brand Finder

Reply 71 of 292, by FesterBlatz

User metadata
Rank Member
Rank
Member

So I've got this working nicely on a Pi3 using pmidi to stream MT-32 .mid files to Munt and it sounds fantastic, but I'm curious about what's involved with adding a USB MIDI interface into the mix so I can use my Pi as an MT-32 emulator for DOS games. I already have a sound card MIDI breakout cable, and a USB interface is en route.

Has anyone managed to do this yet, similar to what forum member PhilsComputerLab accomplished with a Windows box running Munt?

Thanks!

Reply 72 of 292, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++

I've been working on getting the on board UART to work via TTYMIDI. I should have more news in a day or two. Also, please fire any feedback to me and I'll update the thread with information for the Pi 3.

USB MIDI will work identically to a Linux desktop computer. In fact, the required kernel module (snd-usb-audio.ko) will likely auto load.

Here's some device specific notes.
http://alsa.opensrc.org/USBMidiDevices

All hail the Great Capacitor Brand Finder

Reply 73 of 292, by FesterBlatz

User metadata
Rank Member
Rank
Member

That's great news! So that means the USB MIDI UART could be eliminated in favor of connecting the sound card MIDI port directly to the Pi? I'd probably only be comfortable doing this though some form of galvanic isolation to protect both my sound card and Pi3's GPIO pins from being damaged by potential ground loops... I've learned my lesson to be careful with floating power supplies and non-bonded grounds when interfacing expensive FPGA devices to external equipment. 🤣

The image I used for my Pi3 was the one upgraded by jaffa225man. Only two things I needed to do to get it working was add dtparam=audio=on to /boot/configuration.txt, and amixer cset numid=3 1 to force the audio output to the Pi3's headphone jack. Otherwise everything seems to work just fine. The simple DAC audio output wouldn't sound half bad if it weren't for such a high noise floor. I'll be using a USB sound card once I get everything else working but for now the built in audio is fine.

So being completely unfamiliar with MIDI in Linux, when my USB to MIDI cable arrives in a few days, all I need to do is plug it in? I assume I'll need to map that device to the input of the MIDI sequencer somehow?

Cheers!

Reply 74 of 292, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++
FesterBlatz wrote:

That's great news! So that means the USB MIDI UART could be eliminated in favor of connecting the sound card MIDI port directly to the Pi? I'd probably only be comfortable doing this though some form of galvanic isolation to protect both my sound card and Pi3's GPIO pins from being damaged by potential ground loops... I've learned my lesson to be careful with floating power supplies and non-bonded grounds when interfacing expensive FPGA devices to external equipment. 🤣

As per normal with MIDI equipment, optocouplers are used.

FesterBlatz wrote:

The image I used for my Pi3 was the one upgraded by jaffa225man. Only two things I needed to do to get it working was add dtparam=audio=on to /boot/configuration.txt, and amixer cset numid=3 1 to force the audio output to the Pi3's headphone jack. Otherwise everything seems to work just fine. The simple DAC audio output wouldn't sound half bad if it weren't for such a high noise floor. I'll be using a USB sound card once I get everything else working but for now the built in audio is fine.

Yeah, the built in audio is poor on dynamic range as well. Any build notes for Munt?

FesterBlatz wrote:

So being completely unfamiliar with MIDI in Linux, when my USB to MIDI cable arrives in a few days, all I need to do is plug it in? I assume I'll need to map that device to the input of the MIDI sequencer somehow?

Cheers!

Yes, you'll need to map MIDI, but this is pretty straight forward using either aconnect via CLI or a graphical tool like patchage.

All hail the Great Capacitor Brand Finder

Reply 75 of 292, by FesterBlatz

User metadata
Rank Member
Rank
Member
gdjacobs wrote:

As per normal with MIDI equipment, optocouplers are used.

Awesome. Will this be in the form of a "shield" PCB? If so I'd be interested in your gerbers so I could get a batch made at Oshpark. Otherwise, I'd be tempted to whip up my own PCB based on whatever schematic you come up with.

Yeah, the built in audio is poor on dynamic range as well. Any build notes for Munt?

I've been listening to it for over an hour this afternoon and you're absolutely right. Loud sequences sound really compressed and pretty bad! No notes, his image has everything already built and ready to go. I assumed he simply took an image you provided and upgraded for the Pi3 platform...

Yes, you'll need to map MIDI, but this is pretty straight forward using either aconnect via CLI or a graphical tool like patchage.

Ok thanks for pointing me in the right direction!! This is all very exciting. I'm even considering designing an MT-32 themed case I could 3D print to neatly house the RPi, LCD screen, USB sound card, etc. That may be beyond my limited skill in Fusion 360 though...so we'll see.

Reply 76 of 292, by PhilsComputerLab

User metadata
Rank l33t++
Rank
l33t++

Does the built in audio maybe have a flag or setting for dynamic range? Similar to what to get in Windows?

YouTube, Facebook, Website

Reply 77 of 292, by FesterBlatz

User metadata
Rank Member
Rank
Member

I don't think so, I believe it's a hardware limitation. The RPI foundation obviously gave priority to audio over HDMI rather than the analog audio out port... Plugging in a cheap $5 USB sound card is a very easy solution though, so I'm not too worried about it. In fact, a 192KHz/24-bit sound card would likely produce cleaner sound than a real MT-32.

PhilsComputerLab wrote:

Does the built in audio maybe have a flag or setting for dynamic range? Similar to what to get in Windows?

Reply 79 of 292, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++
FesterBlatz wrote:

Awesome. Will this be in the form of a "shield" PCB? If so I'd be interested in your gerbers so I could get a batch made at Oshpark. Otherwise, I'd be tempted to whip up my own PCB based on whatever schematic you come up with.

Eventually. I'm just testing for the moment. Once I'm happy with a circuit design I'll look into learning KiCAD.

FesterBlatz wrote:

I've been listening to it for over an hour this afternoon and you're absolutely right. Loud sequences sound really compressed and pretty bad! No notes, his image has everything already built and ready to go. I assumed he simply took an image you provided and upgraded for the Pi3 platform...

Not sure. My image doesn't have MT32 ROM files included. If you can point out the thread where he has his link, I can check it out.

FesterBlatz wrote:

Ok thanks for pointing me in the right direction!! This is all very exciting. I'm even considering designing an MT-32 themed case I could 3D print to neatly house the RPi, LCD screen, USB sound card, etc. That may be beyond my limited skill in Fusion 360 though...so we'll see.

If you have any ideas, I'd be really interested! Serge at Serdashop might be able to help with some of the production details.

All hail the Great Capacitor Brand Finder