>A solution could be alter libasound to support non-kernel drivers. Or use >a loopback device in the kernel.
libasound *does* support non-kernel drivers. when you access snd_{pcm,rawmidi}_foo (handle, ...) what you're actually doing is: 1) check the device type of handle 2) use snd_pcm_TYPE_foo (handle, ...) this is not done for every call - instead, when you open the handle, the relevant function pointers are set up. for example: snd_pcm_open (&handle, "hw:0,0", ...) sets up the set of function pointers to use: snd_pcm_hw_read snd_pcm_hw_write snd_pcm_hw_prepare snd_pcm_hw_status etc. you can define a new device type in ~/.asoundrc that names specific functions to be used for each part of the API. then you just add the .so that contains the functions, and you're all set. --p