On 07/20/2010 09:45 AM, Robin Gareus wrote:
On 07/20/2010 01:06 AM, Louigi Verona wrote:

Hey guys!

Some time ago I have asked someone to look into Kluppe and add a couple of
features.
My request was not ignored and Patrick Shirkey was kind enough to volunteer
to try to help.

However, he came upon a difficulty and that is - *how do you set up an
asynchronous timer in C?*
It depends what you need that timer for.


The timer is needed to countdown the period between stopping and restarting the loop. The methods I have tried all halt the playback on a single frame and the ui also becomes unresponsive while the timer is in process.

All I would like to do is pass a zero byte to the audio signal handling code while the timer is in progress. The rest of the interface should stay active.

In gtk there's a g_timeout_add(). easy to use.

Will check that one. Might do the trick.

To writing your own:
`apropos pthread` and more specifically `man pthread_create`.


Otherwise will look into this.

usleep() sleeps at least, and select() sleeps at most a certain period
of time. http://freej.dyne.org/codedoc/fps_8cpp_source.html line 132ff
has examples of both.

Tried both of these options and they cause the app to pause with an annoying buzz while the timer is in effect.

For [more] accurate timing: RTC or HPET. Example code comes
with the kernel:
  linux-2.6/Documentation/rtc.txt
  linux-2.6/Documentation/hpet.txt

There's a couple of other options fi. if you want to sync
hardware-devices using IRQs.. and the jack_process_callback is also very
good timer :)


Not required for this task.



It stopped right there. I was wondering if anyone could help us with that
matter?


Cheers!




--
Patrick Shirkey
Boost Hardware Ltd

_______________________________________________
Linux-audio-dev mailing list
[email protected]
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Reply via email to