[linux-audio-dev] Multithreaded programming for a poll model?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] Multithreaded programming for a poll model?
From: Mario Lang (mlang_AT_delysid.org)
Date: Thu Jun 17 2004 - 13:50:06 EEST


Hi.

I am currently trying to figure out how to restructure the code
of my little yatm tool to be flexible and extensible in the future.
Basically, I'd like to be able to become a JACK client at
some point in the future. Since JACK uses a poll model, I have
to majorly restructure my code. I think what I need is the following:
Three threads, one for the UI, one for the MPEG/Vorbis/Speex decoder,
and one for audio output (to either libao or JACK).
I'll also need a buffer between the decoder and the audio thread, and some
way to signal the decoder thread that more audio data is needed.
Additionally, I'd like to have the ability to make the buffer
in between remember the last n seconds of audio data and make
it possible to jump back in time <=n seconds during playback.

I've looked at the lock-free ringbuffer of JACK, but I am not
sure if this is really what I need here. I am very new to
linux audio programming, and especially to pthreads (wrote
my first thread using program two days ago).
I'd be very happy if some of you experts here could give me
a hand here and point me into the right direction.
Maybe there is already code out there which does roughly that
which I can look at?
Or maybe you can suggest which mechanisms of pthreads I should
be using for this kind of scenario.

-- 
CYa,
  Mario | Debian Developer <URL:http://debian.org/>
        | Get my public key via finger mlang_AT_db.debian.org
        | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Jun 17 2004 - 13:43:14 EEST