From the ALSA wiki
You will have to find out the right options for the module snd-mpu401 to get your external midi working.
You can type
modinfo snd-mpu401 to see the possible options for the module.
To try different options, use
insmod snd-mpu401 <my-options>. If insmod doesn't work, type
dmesg to get an error message which is more meaningful. (It should be at the end of the output of dmesg.)
For my onboard "Silicon Integrated Systems" soundcard, it works using
insmod snd-mpu401 port=0x300 irq=-1 (0x300 and 0x330 are good guesses for the port option).
When it works, you should be able to see your soundcard with
aconnect -i and
There are some notes about the
snd-mpu401 module in the explanation about 'How to get the MIDI-Port of the VIA8233 working', take a look at via8233-Via chipset.