I try to use raspberry together with USB MIDI keyboard and qsynth.
I use the following script at autostart that starts qsynth and connects MIDI keyboard to qsynth.
#!/bin/sh
qsynth -a=alsa &
sleep 5
aconnect 20:0 128:0
echo "Done"
The autostart procedure is taken from [http://www.raspberrypi-spy.co.uk/2014/05/how-to-autostart-apps-in-rasbian-lxde-desktop]
It doesn't work. Manual run of the script works correctly. After reboot when I connect with VNC I see that qsynth is working but connection to MIDI keyboard is not established.
Is seems like there is a problem with USB initialization at the startup, may be I use wrong order of startup.