[alsa-devel] Source of timing for MIDI and/or audio synchronization

Takashi Iwai tiwai at suse.de
Tue Jun 12 14:29:52 CEST 2007


At Tue, 12 Jun 2007 01:17:57 -0500,
Mark Rivera wrote:
> 
> 
> Hello (new to list), and thank you for the work you have been doing. As 
> an end-user of the ALSA project's development, I am very grateful for 
> being able to use softwares which provide audio functionality to Linux.
> 
> I have been reading up on the docs and list archives, but I still have 
> an open question for which I hope you can lead me to an answer.
> 
> I designed and built a MIDI sequencer based around a Microchip PIC18 
> MCU, and used the built-in hardware timers and interrupt levels to drive 
> the 'scheduler' for initiating MIDI output (EUSART) routines. In this 
> same vein, I would like to write a software sequencer with as 'tight' 
> timing as possible. So, in a similar concept for Linux - from where does 
> the timing of audio and MIDI events come from?
> 
> It occurred to me that it would be nice to have a loadable kernel module 
> (LKM) to which userland programs could subscribe for receiving 'soft 
> interrupts' based on some timer (cpu ticks?) so that various software 
> could all reference the same notion of the "current time" - a sort of 
> "master clock" with start/stop/continue as well.
> 
> Does ALSA provide this functionality? Can someone point me in the right 
> direction for learning more about this?

ALSA sequencer queues may have different timer sources.  But, there
are no real synchronization between different timer sources.  It was
my former interest, and you can find some pieces of codes (e.g. queue
time skew setting).  It worked somehow but not deployed to the real
apps since then.


Takashi


More information about the Alsa-devel mailing list