Hi friend: in windows install asio4all in linux install a kernel with low latency.Assign in the audio device... Best Regards
Chile
Jose'
If you are using a newer Ubuntu, Intrepid or Jaunty, you don't need the low latency kernel, you just need to enable realtime permissions for audio programs like jack or pd. I use the stock kernel on both my Core 2 2.5Ghz laptop and P3 500Mhz wearable and get 8-20 ms audio latency with fast midi as well.
Note: I still get kind midi stutters using seq24 but that might be seq24 and not alsa midi since the hardware midi in and out works fine.
Here's the settings I use for realtime permissions (from an old Ubutnu Studio wiki)