After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 618409 - jackaudiosrc: improve process callback
jackaudiosrc: improve process callback
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.19
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-05-11 21:53 UTC by Tristan Matthews
Modified: 2010-05-13 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (3.13 KB, patch)
2010-05-11 21:53 UTC, Tristan Matthews
none Details | Review
improves jack process callback (3.47 KB, patch)
2010-05-11 21:57 UTC, Tristan Matthews
committed Details | Review
advance the ringbuffer as we copy samples (1.58 KB, patch)
2010-05-12 14:58 UTC, Tristan Matthews
rejected Details | Review

Description Tristan Matthews 2010-05-11 21:53:57 UTC
Created attachment 160866 [details] [review]
Proposed patch

jackaudiosrc should not use g_alloca in its process_cb as it is only used here to enhance readability. Additionally, the process_cb should interleave samples directly from the jackports into the ringbuffer and not into an intermediate memory buffer.
Comment 1 Tristan Matthews 2010-05-11 21:57:58 UTC
Created attachment 160867 [details] [review]
improves jack process callback
Comment 2 Tristan Matthews 2010-05-12 14:58:47 UTC
Created attachment 160906 [details] [review]
advance the ringbuffer as we copy samples

We should also advance the ringbuffer as segments are copied over, not just once in the process callback but everytime we copy over more than the length parameter given by the gst_ringbuffer_prepare_read call.
Comment 3 Wim Taymans 2010-05-13 10:57:11 UTC
(In reply to comment #2)
> Created an attachment (id=160906) [details] [review]
> advance the ringbuffer as we copy samples
> 
> We should also advance the ringbuffer as segments are copied over, not just
> once in the process callback but everytime we copy over more than the length
> parameter given by the gst_ringbuffer_prepare_read call.

I commited the following patch instead. Just like in the sink case, the number of frames is always exactly equal to the size we get from the prepare_read call or else something else is wrong.

commit d4f6a94b93291d36fd3658d790869f757187df05
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Thu May 13 12:55:29 2010 +0200

    jacksrc: make sure we always read nframes
    
    Error out when we are asked to read a different size that what was configured as
    the jack period size because that would mean something else is wrong.
    
    Fixes #618409
Comment 4 Tim-Philipp Müller 2010-05-13 11:00:38 UTC
Comment on attachment 160867 [details] [review]
improves jack process callback

>From: Tristan Matthews <tristan@sat.qc.ca>
>Subject: [PATCH 1/1] jack: improve process_cb

A more meaningful commit message would've been nice ;-)