A tutorial on a capture client

View: New views
10 Messages — Rating Filter:   Alert me  

A tutorial on a capture client

by Ferran Orriols :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi jack devel,

I'm a new audio linux developer and I have the following problem. In the jack audio documentation web there is a tutorial called "A tutorial on a capture client", but its link is broken. I need this tutorial because I want to learn how to work with lock-free and ring-buffers. I think that it's a pdf file called capture.pdf. If somebody have this file or tutorial please send me an email. I will be very grateful.

Thanks for all.

--
Ferran Orriols

_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: A tutorial on a capture client

by Gabriel M. Beddingfield :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Ferran,

Download the source code for jack and look at the file simple_client.c (in
the example-clients directory).  If I recall correctly, I think the
tutorial was just a verbose walk-through of this program -- but the code
is very well documented.

Be sure to check out the other examples in that directory, too.  They will
help you get a grip on the JACK API.

HTH,
Gabriel

On Thu, July 24, 2008 9:46 am, Ferran Orriols wrote:

> Hi jack devel,
>
> I'm a new audio linux developer and I have the following problem. In the
> jack audio documentation web there is a tutorial called "A tutorial on a
> capture client", but its link is broken. I need this tutorial because I
> want
> to learn how to work with lock-free and ring-buffers. I think that it's a
> pdf file called capture.pdf. If somebody have this file or tutorial please
> send me an email. I will be very grateful.
>
> Thanks for all.
>
> --
> Ferran Orriols
> _______________________________________________
> Jack-Devel mailing list
> Jack-Devel@...
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
>


--
               G a b r i e l   M   B e d d i n g f i e l d

_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: A tutorial on a capture client

by Schmidt András :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I am a new audio linux developer too. I have just done some work with Jack.

I think the API documentation of Jack is fine. See reference on page:
http://jackaudio.org/files/docs/html/index.html

I know that besides the documentation a simple example is great.

One of the simplest though functional example I have found (for capture)
is the tuneit application:  http://delysid.org/tuneit.html

Its source is a well structured single .c file.

I am planning to integrate Jack plugins through a Dbus interface and
delegate their control through network so that sound processing can be
done on a sound server that handles no GUI. My project's page is:
http://www.yamamap.org/jackdbus/index.html

If you check out the sources
(http://www.yamamap.org/jackdbus/index.html#sources) you can see a  
playback module. It plays files decoded using libsox
This also uses ringbuffer. It is not so simple though because it is
remote controllable through Dbus. Its source file is:
https://coolrmi.svn.sourceforge.net/svnroot/coolrmi/jackdbus/trunk/jackDbus/modules/soxPlayer/soxjackplayer.c

In case it is not a secret: What is your goal with Linux Audio?

regards
Andrew Schmidt


Ferran Orriols wrote:

> Hi jack devel,
>
> I'm a new audio linux developer and I have the following problem. In
> the jack audio documentation web there is a tutorial called "A
> tutorial on a capture client", but its link is broken. I need this
> tutorial because I want to learn how to work with lock-free and
> ring-buffers. I think that it's a pdf file called capture.pdf. If
> somebody have this file or tutorial please send me an email. I will be
> very grateful.
>
> Thanks for all.
>
> --
> Ferran Orriols
> ------------------------------------------------------------------------
>
> _______________________________________________
> Jack-Devel mailing list
> Jack-Devel@...
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
>  

_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: A tutorial on a capture client

by Stéphane Letz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 24 juil. 08 à 17:11, Schmidt András a écrit :

> Hi!
>
> I am a new audio linux developer too. I have just done some work  
> with Jack.
>
> I think the API documentation of Jack is fine. See reference on  
> page: http://jackaudio.org/files/docs/html/index.html
>
> I know that besides the documentation a simple example is great.
>
> One of the simplest though functional example I have found (for  
> capture) is the tuneit application:  http://delysid.org/tuneit.html
>
> Its source is a well structured single .c file.
>
> I am planning to integrate Jack plugins through a Dbus interface and  
> delegate their control through network so that sound processing can  
> be done on a sound server that handles no GUI. My project's page is: http://www.yamamap.org/jackdbus/index.html
>
> If you check out the sources (http://www.yamamap.org/jackdbus/index.html#sources 
> ) you can see a  playback module. It plays files decoded using libsox
> This also uses ringbuffer. It is not so simple though because it is  
> remote controllable through Dbus. Its source file is:
> https://coolrmi.svn.sourceforge.net/svnroot/coolrmi/jackdbus/trunk/jackDbus/modules/soxPlayer/soxjackplayer.c
>
> In case it is not a secret: What is your goal with Linux Audio?
>
> regards
> Andrew Schmidt
>

Do you know there is already a "jack dbus" thing, a Dbus service  
aiming to control jack server and that is now part of jack2 SVN? http://trac.jackaudio.org/wiki/JackDbusPackaging

Maybe choosing another name would be better to avoid confusion? What  
do you think?

Stephane
_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: A tutorial on a capture client

by Ferran Orriols :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Schmidt!

I will look into this links! I'm sure that it will be useful. Now I'm developing some new processings for CLAM. I have created the SndfileReader and SndfileWriter using libsndfile, but these processings need some modification to work in real-time programs. So now I need to convert the processings using lock free algorithms where there are two threads and only the disk thread can block. That's because I want to check how the capture_client works.

Thanks also for Gabriel.

2008/7/24 Schmidt András <asch@...>:
Hi!

I am a new audio linux developer too. I have just done some work with Jack.

I think the API documentation of Jack is fine. See reference on page: http://jackaudio.org/files/docs/html/index.html

I know that besides the documentation a simple example is great.

One of the simplest though functional example I have found (for capture) is the tuneit application:  http://delysid.org/tuneit.html

Its source is a well structured single .c file.

I am planning to integrate Jack plugins through a Dbus interface and delegate their control through network so that sound processing can be done on a sound server that handles no GUI. My project's page is: http://www.yamamap.org/jackdbus/index.html

If you check out the sources (http://www.yamamap.org/jackdbus/index.html#sources) you can see a  playback module. It plays files decoded using libsox
This also uses ringbuffer. It is not so simple though because it is remote controllable through Dbus. Its source file is:
https://coolrmi.svn.sourceforge.net/svnroot/coolrmi/jackdbus/trunk/jackDbus/modules/soxPlayer/soxjackplayer.c

In case it is not a secret: What is your goal with Linux Audio?

regards
Andrew Schmidt


Ferran Orriols wrote:
Hi jack devel,

I'm a new audio linux developer and I have the following problem. In the jack audio documentation web there is a tutorial called "A tutorial on a capture client", but its link is broken. I need this tutorial because I want to learn how to work with lock-free and ring-buffers. I think that it's a pdf file called capture.pdf. If somebody have this file or tutorial please send me an email. I will be very grateful.

Thanks for all.

--
Ferran Orriols
------------------------------------------------------------------------


_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
 




--
Ferran Orriols

_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: A tutorial on a capture client

by Schmidt András :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have created a wiki page that discusses the theory of real time sound
processing using Jack. You could read it if you are interested:

http://trac.jackaudio.org/wiki/WalkThrough/Dev/LatencyBufferProcess

Everyone: feel free to correct errors!

András Schmidt

Ferran Orriols wrote:

> Thanks Schmidt!
>
> I will look into this links! I'm sure that it will be useful. Now I'm
> developing some new processings for CLAM. I have created the
> SndfileReader and SndfileWriter using libsndfile, but these
> processings need some modification to work in real-time programs. So
> now I need to convert the processings using lock free algorithms where
> there are two threads and only the disk thread can block. That's
> because I want to check how the capture_client works.
>
> Thanks also for Gabriel.
>
> 2008/7/24 Schmidt András <asch@... <mailto:asch@...>>:
>
>     Hi!
>
>     I am a new audio linux developer too. I have just done some work
>     with Jack.
>
>     I think the API documentation of Jack is fine. See reference on
>     page: http://jackaudio.org/files/docs/html/index.html
>
>     I know that besides the documentation a simple example is great.
>
>     One of the simplest though functional example I have found (for
>     capture) is the tuneit application:  http://delysid.org/tuneit.html
>
>     Its source is a well structured single .c file.
>
>     I am planning to integrate Jack plugins through a Dbus interface
>     and delegate their control through network so that sound
>     processing can be done on a sound server that handles no GUI. My
>     project's page is: http://www.yamamap.org/jackdbus/index.html
>
>     If you check out the sources
>     (http://www.yamamap.org/jackdbus/index.html#sources) you can see a
>      playback module. It plays files decoded using libsox
>     This also uses ringbuffer. It is not so simple though because it
>     is remote controllable through Dbus. Its source file is:
>     https://coolrmi.svn.sourceforge.net/svnroot/coolrmi/jackdbus/trunk/jackDbus/modules/soxPlayer/soxjackplayer.c
>
>     In case it is not a secret: What is your goal with Linux Audio?
>
>     regards
>     Andrew Schmidt
>
>
>     Ferran Orriols wrote:
>
>         Hi jack devel,
>
>         I'm a new audio linux developer and I have the following
>         problem. In the jack audio documentation web there is a
>         tutorial called "A tutorial on a capture client", but its link
>         is broken. I need this tutorial because I want to learn how to
>         work with lock-free and ring-buffers. I think that it's a pdf
>         file called capture.pdf. If somebody have this file or
>         tutorial please send me an email. I will be very grateful.
>
>         Thanks for all.
>
>         --
>         Ferran Orriols
>         ------------------------------------------------------------------------
>
>
>
>         _______________________________________________
>         Jack-Devel mailing list
>         Jack-Devel@...
>         <mailto:Jack-Devel@...>
>         http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
>          
>
>
>
>
>
> --
> Ferran Orriols

_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: A tutorial on a capture client

by Stéphane Letz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 24 juil. 08 à 21:24, Schmidt András a écrit :

> I have created a wiki page that discusses the theory of real time  
> sound processing using Jack. You could read it if you are interested:
>
> http://trac.jackaudio.org/wiki/WalkThrough/Dev/LatencyBufferProcess
>
> Everyone: feel free to correct errors!
>
> András Schmidt
>

Thanks for providing this introduction but my feeling is that it is  
not so adequate as a introduction on jack processing model in it's  
current shape. It mixes different concepts, has some inaccuracies...  
((-:

Would some other be ready to help improving this content?

Stephane
_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

Re: A tutorial on a capture client

by Nedko Arnaudov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>> I am planning to integrate Jack plugins through a Dbus interface and
>> delegate their control through network so that sound processing can
>> be done on a sound server that handles no GUI. My project's page is:
>> http://www.yamamap.org/jackdbus/index.html

[snip]

>> In case it is not a secret: What is your goal with Linux Audio?

I'm curious too.

> Do you know there is already a "jack dbus" thing, a Dbus service
> aiming to control jack server and that is now part of jack2 SVN?
> http://trac.jackaudio.org/wiki/JackDbusPackaging

There also unofficial jackdbus patch for jack1:
http://sharesource.org/project/jack/

And this is the home page of the LADI project:
http://nedko.arnaudov.name/wiki/moin.cgi/LADI

--
Nedko Arnaudov <GnuPG KeyID: DE1716B0>


_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

attachment0 (194 bytes) Download Attachment

Re: A tutorial on a capture client

by Nedko Arnaudov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stéphane Letz <letz@...> writes:

> Le 24 juil. 08 à 21:24, Schmidt András a écrit :
>
>> I have created a wiki page that discusses the theory of real time
>> sound processing using Jack. You could read it if you are interested:
>>
>> http://trac.jackaudio.org/wiki/WalkThrough/Dev/LatencyBufferProcess
>>
>> Everyone: feel free to correct errors!
>>
>> András Schmidt
>>
>
> Thanks for providing this introduction but my feeling is that it is
> not so adequate as a introduction on jack processing model in it's
> current shape. It mixes different concepts, has some inaccuracies...
> ((-:
>
> Would some other be ready to help improving this content?
Not really up to improving but let me point at this sentence:
(An example recording module that saves samples in a file)

create a thread that reads the ringbuffer and write all data found to
disc. When it finds the ringbuffer is empty just sleep the process for a
short period. When the thread wakes up the ringbuffer will contain some
samples again :-). This thread will only block the real-time thread
while it copies data from the ringbuffer. The priority of this porcess
should be raised to real-time during the copy. I don't know whether Jack
does it or not automatically.

AFAIK creating thread is fine. I thowever will not block realtime thread
while it copiles data from ringbuffer. If realtime thread needs to run
the other thread will be preempted. Linux does not have separate process
and thread priorities. You have priority per thread. In fact threads in
Linux are processes without separate virtual memory. I.e. they share
virtual memory space of the main thread.

s/porcess/process/

--
Nedko Arnaudov <GnuPG KeyID: DE1716B0>


_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

attachment0 (194 bytes) Download Attachment

Parent Message unknown Re: A tutorial on a capture client

by Schmidt András :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Nedko Arnaudov wrote:

> Schmidt András <asch@...> writes:
>
>  
>> If you raise the priority of the buffer reading thread to realtime for
>> some instructions then it will block the writing thread, won't it?
>>    
>
> You should not rise the priority. JACK implies external threading model
> and user should be able to control it extenraly. AFAIK and IMHO.
>
>  
>> You are right the reading thread should not block the writing thread
>> more than necessary. So data copy should not be done in raised
>> priority. Setting the ringbuffer pointer must be locked though. Am I
>> right?
>>    
>
> point of ringbuffers is that they are lock free. this means no locking.
>
> Is there any real reason for not discussing this on mailing list?
>
>  
Sorry! Real reason is that my mail client did not add the mailing list
automatically :-).

I have read the documentation again and I have to admit you are right.
The Jack ringbuffer is lock free so no synchronization is required.

_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
LightInTheBox - Buy quality products at wholesale price