RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    [Tutorial] Installing Munt (MT-32 emulation) on RPi 3

    Scheduled Pinned Locked Moved General Discussion and Gaming
    muntmidiraspberry pi 3mt-32dosbox
    34 Posts 17 Posters 19.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • David87D
      David87 @sduensin
      last edited by David87

      @sduensin Regarding performance of Munt on Raspberry Pi 3 - the sound sometimes jams a bit (timing between notes/sounds seems a bit off). The average CPU usage of Munt (shown by top) is around 40% (of a single core). I guess both Munt and Dosbox should be single threaded (or at least all the heavy processing should be done in a single thread), so Raspberry Pi 3 with its 4 core CPU should be able to run both apps in parallel (without affecting each other).
      I assume that jamming of the sound might be caused by very short and time critical CPU usage spikes of Munt (some heavy processing done by Munt that doesn't happen all the time, but when it happens it must complete in a very short amount of time to prevent sound from being crippled).
      Anyway with the described CPU governor tweaks Munt works IMHO quite well.

      And thanks for mentioning ROM file names - I have updated OP!

      S 1 Reply Last reply Reply Quote 0
      • S
        sduensin @David87
        last edited by

        @david87 said in [Tutorial] Installing Munt (MT-32 emulation) on RPi 3:

        Munt works IMHO quite well.

        Heck yeah it does! Played a few titles in DOSBox on the Pi after getting it to work. Just amazing. This needs to be in the official RetroPie distro!

        1 Reply Last reply Reply Quote 1
        • David87D
          David87
          last edited by

          I have updated compiler flags (and added a list of flags that should work on other systems). With updated compiler flags sound seems to jam a bit less on Raspberry Pi 3.

          1 Reply Last reply Reply Quote 0
          • G
            gdjacobs
            last edited by

            Hey, David.

            Just a quick update on compiler flags.

            First, on ARM platforms, march and mtune are overridden by the flags set in -mcpu. Setting -mcpu=cortex-a53 will also select appropriate tune and arch flags.

            Second, -Ofast also enables -ftree-vectorize (auto vectorizing) and -ffast-math (which contains -funsafe-math-optimizations).

            Last, -mfpu and -mfloat are not supported options for GCC targeting ARMv8 (64 bit), so please be conscious of what ABI is being utilized by the underlying operating system.

            Cheers and thanks for helping spread the word about accessible retro sound.

            1 Reply Last reply Reply Quote 1
            • N
              nighthurdles
              last edited by

              Just had a go at this on my pi 3b+ running retropie 4.41... no dice :(

              It doesnt seem to show mt32 when i run the test to check munt has created the midi output port - when i run command: aconnect -o I get the following:

              pi@retropie:~ $ aconnect -o
              client 14: 'Midi Through' [type=kernel]
                  0 'Midi Through Port-0'
              client 128: 'TiMidity' [type=user,pid=577]
                  0 'TiMidity port 0 '
                  1 'TiMidity port 1 '
                  2 'TiMidity port 2 '
                  3 'TiMidity port 3 '
              

              no sign of mt32 :( any ideas? The installation process all seemed to go through fine, no probs.
              If anyone has any helpful advice I'd be very grateful! Thanks

              David87D 1 Reply Last reply Reply Quote -1
              • David87D
                David87 @nighthurdles
                last edited by

                @nighthurdles Try opening another console session (e.g. another SSH session) and run /usr/local/bin/mt32d there.

                1. If this command will output error message and return to console, you will have a clue what needs to be fixed.
                2. If this command will display some messages and continue to run. Please go back to first console session and run aconnect -o again.
                  2.1. If new MIDI port 'MT-32' will be displayed you have issue with starting Munt automatically (step 11. in OP).
                  2.2. If no new MIDI port will be shown, try stopping TiMidity while running Munt.
                1 Reply Last reply Reply Quote 0
                • 3
                  3DMaster
                  last edited by 3DMaster

                  So, I hit a snag at the point where I have to put the MT32 roms in the mt32-rom-data directory; the directory doesn't exist, and trying to create the directory manually gives me that the permission to create the directory is denied. Similarly, I don't have permission to edit rc.local.

                  Any ideas?

                  David87D 1 Reply Last reply Reply Quote 0
                  • David87D
                    David87 @3DMaster
                    last edited by

                    @3DMaster You must create the directory /usr/share/mt32-rom-data (and place files there) and edit /etc/rc.local as root.
                    If you don't know how, you can try using Midnight Commander for these actions.
                    To install Midnight Commander run: sudo apt-get install mc
                    To run Midnight Commander as root run: sudo mc

                    1 Reply Last reply Reply Quote 0
                    • S
                      seren
                      last edited by

                      Considering to build a Munt-Pi (3B+). But I have some questions first:

                      • Can I use the 3B compiler flags for the 3B+
                      • Can I route the audio output via a Hifiberry or USB audio device? If so, how?
                      • Can I input another audio source via a USB audio device (e.g. Sharp X68000 native audio), and mix it with the audio generated with Munt (from X68000 Midi) and have it both routed to the USB audio output?

                      Thanks in advance!

                      David87D 1 Reply Last reply Reply Quote 0
                      • David87D
                        David87 @seren
                        last edited by

                        @seren said in [Tutorial] Installing Munt (MT-32 emulation) on RPi 3:

                        • Can I use the 3B compiler flags for the 3B+
                          Most likely they will do.
                        • Can I route the audio output via a Hifiberry or USB audio device? If so, how?
                          You can either add -d name parameter when starting mt32d (step 11. in OP) to specify ALSA PCM output device. Or you can comment out dtparam=audio=on in /boot/config.txt to disable Raspberry Pi built-in sound card.
                        1 Reply Last reply Reply Quote 1
                        • S
                          seren
                          last edited by seren

                          I would like to try the Qt version on my Raspberry Pi 3B+. Can you explain how to build that (including installing Qt itself, etc.) ? I ran into issues , something with: fatal error: QtWidgets/QAction: No such file or directory
                          #include <QtWidgets/QAction>

                          @David87 said in [Tutorial] Installing Munt (MT-32 emulation) on RPi 3:

                          • Can I route the audio output via a Hifiberry or USB audio device? If so, how?
                            You can either add -d name parameter when starting mt32d (step 11. in OP) to specify ALSA PCM output device. Or you can comment out dtparam=audio=on in /boot/config.txt to disable Raspberry Pi built-in sound card.

                          I have it running (mt32d) with a HifiBerry DAC+ADC. I made sure the latest kernel was installed with Hifiberry support with sudo rpi-update and indeed commented out dtparam=audio=on and put in dtoverlay=hifiberry-dacplusadc in /boot/config.txt. Use the correct name for your hifiberry device: https://www.hifiberry.com/build/documentation/configuring-linux-3-18-x/

                          1 Reply Last reply Reply Quote 0
                          • David87D
                            David87
                            last edited by David87

                            @seren Unfortunately I cannot help with Qt things.
                            And the default audio output device for you is successfully set to HiFiBerry, correct?

                            1 Reply Last reply Reply Quote 0
                            • sirhenrythe5thS
                              sirhenrythe5th
                              last edited by

                              i am very interested to pimp up my DosBox by using this great tutorial.

                              Just two questions in advance:

                              • is this tutorial still up to date concering retropie 4.4.(.15) ?
                              • is munt_2_2_0 still the latest available version of this Emulator?

                              Thx a lot for Support!

                              -- Retro-Achievements Username: SirALX --
                              RetroRatio: 1.88
                              Started Games beaten: 2,47%
                              Site Rank: 4382/93743 ranked users (TOP 4.76%)
                              Last seen in [The Legend of Zelda: Lost in Time (HACK) [N64], exploring Hyrule at Night]

                              David87D 1 Reply Last reply Reply Quote 0
                              • B
                                Barcrest
                                last edited by

                                Is this better than using the munt implementation already built into scummVM or does the retropie version not have munt built in?

                                sirhenrythe5thS 1 Reply Last reply Reply Quote 0
                                • sirhenrythe5thS
                                  sirhenrythe5th @Barcrest
                                  last edited by sirhenrythe5th

                                  @Barcrest AFAIR its meant for usage in DosBOX - not ScummVM.

                                  -- Retro-Achievements Username: SirALX --
                                  RetroRatio: 1.88
                                  Started Games beaten: 2,47%
                                  Site Rank: 4382/93743 ranked users (TOP 4.76%)
                                  Last seen in [The Legend of Zelda: Lost in Time (HACK) [N64], exploring Hyrule at Night]

                                  1 Reply Last reply Reply Quote 1
                                  • David87D
                                    David87 @sirhenrythe5th
                                    last edited by

                                    @sirhenrythe5th

                                    • You can test this tutorial on RetroPie 4.4. And please post here any issues observed if you do so! Most likely everything will work.
                                    • Latest Munt version is 2.3.0 - the 2nd step will be wget https://github.com/munt/munt/archive/munt_2_3_0.tar.gz and first command of 3rd step will be tar -xzf munt_2_3_0.tar.gz
                                    1 Reply Last reply Reply Quote 0
                                    • sirhenrythe5thS
                                      sirhenrythe5th
                                      last edited by

                                      Thank you Dave!

                                      I will make a backup of my Image in the weekend and then start to install Munt following your tutorial.
                                      Feedback will follow ;)

                                      kind regards

                                      -- Retro-Achievements Username: SirALX --
                                      RetroRatio: 1.88
                                      Started Games beaten: 2,47%
                                      Site Rank: 4382/93743 ranked users (TOP 4.76%)
                                      Last seen in [The Legend of Zelda: Lost in Time (HACK) [N64], exploring Hyrule at Night]

                                      1 Reply Last reply Reply Quote 0
                                      • A
                                        atchoodev
                                        last edited by

                                        Hello,

                                        Thanks for writing this. I had a minor problem with CMake not finding Glib2:

                                        CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
                                          Could NOT find GLIB2 (missing: GLIB2_LIBRARY GLIB2_INCLUDE_DIR
                                          GLIB2_CONFIG_INCLUDE_DIR)
                                        

                                        In case anyone else is having that particular problem, this is how I fixed it:

                                        sudo apt-get install libglib2.0-dev
                                        

                                        Best regards,

                                        Andreas


                                        Music Production, Retro computer enthusiast, App Development, Programming & Smart design
                                        1 Reply Last reply Reply Quote 0
                                        • A
                                          atchoodev
                                          last edited by

                                          By the way:

                                          Running mt32d or xmt32 as root user will allow program to use real-time
                                          scheduling which may reduce/remove drop outs as the program can use the 
                                          CPU more aggressively. 
                                          

                                          (from README.txt in the "mt32emu_alsadrv" folder)

                                          1 Reply Last reply Reply Quote 0
                                          • I
                                            Impy
                                            last edited by

                                            Has anyone tried to compile munt for the Pi4?

                                            What would the flags be for that case?

                                            David87D 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.