-
-
Notifications
You must be signed in to change notification settings - Fork 80
Troubleshooting
On this page we'll provide some troubleshooting tips to help you try and find the cause of any problems when using mt32-pi
. This helps us if it can prevent the need to open an issue unnecessarily, or it might help us understand your issue better if you have tried some of the procedures here.
One of the most basic tests is to ensure that all of your hardware is working properly outside of mt32-pi
by testing it under Linux. If similar unexpected behaviour is experienced under Linux, then the issue is most likely not with mt32-pi
, and you will need to correct any hardware problems or replace faulty components.
We'll prepare a Linux environment on the Raspberry Pi running Munt that we can use to check behaviour against mt32-pi
.
- Begin by preparing an SD card with a desktop-enabled edition of Raspberry Pi OS (formerly known as Raspbian). Ensure that you can reach the desktop and that you have internet connectivity.
- Update your OS packages and reboot the Raspberry Pi by issuing the following commands in a terminal:
$ sudo apt-get update $ sudo apt-get upgrade $ sudo reboot
- We need to install some prerequisites for compiling Munt from source. Issue the following command in the terminal:
$ sudo apt-get install git cmake libasound2-dev libglib2.0-dev libpulse-dev portaudio19-dev qt5-default qtbase5-dev qtmultimedia5-dev
- Check out the latest Munt source code and compile it:
$ git clone https://github.com/munt/munt.git $ cd munt $ mkdir build && cd build $ cmake .. -DCMAKE_BUILD_TYPE=Release $ cmake --build . $ sudo make install
- If compilation was successful, you can now start Munt by running
./mt32emu_qt/mt32emu-qt
from inside thebuild
directory, or double-clicking it from a file explorer. - Copy your
MT32_CONTROL.ROM
andMT32_PCM.ROM
files somewhere convenient, and use the Options -> ROM Configuration menu to locate and enable them.
If you are trying to troubleshoot a GPIO MIDI interface, some further steps are required. N.B. USB MIDI interfaces should not require any further setup.
- Edit the
config.txt
file on your Pi's SD card/boot
partition and add the following lines to the end of it. This moves the Bluetooth UART onto the less capable mini UART, freeing up UART0 for MIDI, and also tweaks some clocks to allow the UART to communicate at the proper MIDI baud rate.enable_uart=1 dtoverlay=miniuart-bt dtoverlay=midi-uart0
- Edit the
cmdline.txt
file (again on the SD card/boot
partition) and deleteconsole=serial0,115200
from it. This prevents the Linux console from using the serial port. - Reboot the Pi, and compile a modified version of
ttymidi
that supports SysEx messages:$ git clone https://github.com/ElBartoME/ttymidi.git $ cd ttymidi $ make
- Now you can start
ttymidi
with the following command - it needs to stay running throughout the session:$ ./ttymidi -b 38400 -s /dev/ttyAMA0 -v
- Connect a MIDI source such as a keyboard to the GPIO MIDI input and play some notes, or play a song using a connected computer and MIDI player. Verify that the events appear correctly in the terminal. You could use a Windows PC with USB MIDI interface and Pocket MIDI to send MIDI notes by playing an on-screen keyboard. This way you can ensure that all key presses result in a corresponding Note On and Note Off pair. Try playing keys rapidly - if any Note Offs are missing, you probably have a hardware issue and missing/hanging notes will occur.
If you want to test an I2S DAC, follow its documentation to get it working under Linux. However, you should only troubleshoot one thing at a time - i.e. if you're having MIDI issues, just use the Pi's headphone jack until you have resolved it.
With a MIDI interface connected and set up, and Munt running, you can test it with Munt as follows:
- Run
aconnect -l
. The output should be similar to the following:client 0: 'System' [type=kernel] 0 'Timer ' 1 'Announce ' client 14: 'Midi Through' [type=kernel] 0 'Midi Through Port-0' client 128: 'ttymidi' [type=user,pid=2557] 0 'MIDI out ' 1 'MIDI in ' client 129: 'Munt MT-32' [type=user,pid=2302] 0 'Standard '
- We want to connect the MIDI out port of our interface into the input of Munt. In the example above,
ttymidi
is our MIDI interface, so we run the following to connect it:Adapt this command as necessary if you're using a USB interface.$ aconnect 128:0 129:0
- Munt should detect the connection and the interface should change to show the synthesizer.
- Click Stop, then change the audio output device to ALSA: System default.
- Click Properties, and set the chunk length to 64, and the audio latency to 1024.
Note: You will probably experience clicks/pops and very high latency with this far-from-ideal setup - this is not a Linux low-latency audio guide. We just want to get something fairly listenable for testing purposes. If you can assist with documenting a better JACK-based configuration, feel free to edit this wiki page. Also feel free to try other values if these ones give you problems - for me, it worked with some occasional clicks/pops on a Pi 3 B+. Your mileage may vary.
- If you're using the headphone jack, right-click the speaker at the top-right of the screen and set the output to AV Jack.
- Click Start and start your MIDI source. You should hear Munt making sound.
Β© Dale Whinham 2020-2022. Released under the GNU General Public License v3.0.