[alsa-devel] Can module snd-aloop (virtual looback device) be made clock slave of a real audio device ?

James Warden warjamy at yahoo.com
Mon Aug 20 11:51:55 CEST 2012


Hello alsa-devel's,

A while back, I had written a rather hackish method to hook up the ALSA virtual loopback device to jack (jackaudio.org) via Jack clients alsa_in / alsa_out so that non jack-aware applications that can however use ALSA devices "directly" (via alsa-lib) can have their audio stream redirected to jack (see my rather lengthy prose at http://alsa.opensrc.org/Jack_and_Loopback_device_as_Alsa-to-Jack_bridge).

There are a few advantages in this method (depends on your use-cases of course). But it could be improved (or so I think) by removing the following drawbacks:

The alsa_in/out jack clients are resampling the audio stream to synchronize with the device that jack is using. The resampling, done by libsamplerate, takes some CPU power. Since many users are using my recipe on laptops, this is not always welcome. 

Because snd-aloop is a virtual device, couldn't it be made a clock slave of the h/w device that jack is operating on ? This would in principle remove the need for resampling. I could imagine that the module could be passed an option at loading time (e.g. modprobe snd-aloop clock-master=<real h/w device index> or something like that)


Since I have no clue as to the kernel code required to implement / extend snd-aloop, I would like some opinions about this.


Thanks for any hints.

J.



More information about the Alsa-devel mailing list