audioresample assertion failed: (out_len >= out_processed)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

audioresample assertion failed: (out_len >= out_processed)

Maik Scholz
Hi,

i have a issue with an assert in audioresample (1.8.1).
ERROR:gstaudioresample.c:1125:gst_audio_resample_process: assertion failed: (out_len >= out_processed)

In my pipeline i implemented a BUFFER PadProbe on the audioresample sink and source pad.
Within that callback, i like to change the caps rate (norminal 48kHz +- 50Hz).
Unfortunately after some frames, my application stops with the assert.
I attached a pdf file with the debugger backtrace and the local variables.

Do you have any hint?

Maik

GSTREAMER LOG:
0:00:00.669343121  8327 0x7fffc8005410 INFO           audioresample gstaudioresample.c:1560:_benchmark_integer_resampling: Using float resampler for everything: 37934.857143 <= 103510.000000
0:00:00.669558622  8327 0x7fffc8005410 DEBUG          audioresample gstaudioresample.c:1371:gst_audio_resample_set_property:<audioresample0> new quality 4
0:00:00.669596502  8327 0x7fffc8005410 DEBUG          audioresample gstaudioresample.c:1371:gst_audio_resample_set_property:<SD.I0.ASRC> new quality 4
0:00:01.797124611  8327 0x7fffa8003210 DEBUG          audioresample gstaudioresample.c:1327:gst_audio_resample_query:<SD.I0.ASRC> Peer latency: min 0:00:00.640000000 max 0:00:00.640000000
0:00:01.797287924  8327 0x7fffa8003210 DEBUG          audioresample gstaudioresample.c:1337:gst_audio_resample_query:<SD.I0.ASRC> Our latency: 0:00:00.000000000
0:00:01.797304918  8327 0x7fffa8003210 DEBUG          audioresample gstaudioresample.c:1345:gst_audio_resample_query:<SD.I0.ASRC> Calculated total latency : min 0:00:00.640000000 max 0:00:00.640000000
0:00:02.695035506  8327      0x260b000 DEBUG          audioresample gstaudioresample.c:1327:gst_audio_resample_query:<SD.I0.ASRC> Peer latency: min 0:00:00.640000000 max 0:00:00.640000000
0:00:02.695135963  8327      0x260b000 DEBUG          audioresample gstaudioresample.c:1337:gst_audio_resample_query:<SD.I0.ASRC> Our latency: 0:00:00.000000000
0:00:02.695160457  8327      0x260b000 DEBUG          audioresample gstaudioresample.c:1345:gst_audio_resample_query:<SD.I0.ASRC> Calculated total latency : min 0:00:00.640000000 max 0:00:00.640000000
0:00:21.757223834  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:566:gst_audio_resample_set_caps: incaps audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003, outcaps audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
0:00:21.759576179  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:566:gst_audio_resample_set_caps: incaps audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)47950, channels=(int)2, channel-mask=(bitmask)0x0000000000000003, outcaps audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
0:00:21.760605707  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:515:gst_audio_resample_transform_size:<SD.I0.ASRC> asked to transform size 192000 in direction SINK
0:00:21.760657670  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:550:gst_audio_resample_transform_size:<SD.I0.ASRC> transformed size 192000 to 192204
0:00:21.782168406  8327 0x7fffb4007990 INFO           audioresample gstaudioresample.c:412:gst_audio_resample_init_state:<SD.I0.ASRC> Using the full sinc filter table
0:00:21.782448828  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1198:gst_audio_resample_transform:<SD.I0.ASRC> transforming buffer of 192000 bytes, ts 0:00:06.000000000, duration 0:00:01.000000000, offset 288000, offset_end 336000
0:00:21.782524545  8327 0x7fffb4007990 DEBUG          audioresample gstaudioresample.c:1216:gst_audio_resample_transform:<SD.I0.ASRC> found discontinuity; resyncing
0:00:21.782558772  8327 0x7fffb4007990 DEBUG          audioresample gstaudioresample.c:1235:gst_audio_resample_transform:<SD.I0.ASRC> marking this buffer with the DISCONT flag
0:00:21.782604775  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:915:gst_audio_resample_push_drain:<SD.I0.ASRC> Pushing drain buffer of 132 bytes with timestamp 0:00:06.000000000 duration 0:00:00.000687500 offset 288300 offset_end 288333
0:00:21.783005217  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1169:gst_audio_resample_process:<SD.I0.ASRC> Converted to buffer of 47986 samples (191944 bytes) with timestamp 0:00:06.000687500, duration 0:00:00.999708333, offset 288333, offset_end 336319
0:00:21.783052679  8327 0x7fffb4007990 DEBUG          audioresample gstaudioresample.c:1252:gst_audio_resample_transform:<SD.I0.ASRC> input = samples [288000, 336000) = [6000000000, 7000000000) ns;  output = samples [288333, 336319) = [6000687500, 7000395833) ns
0:00:21.783167516  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:515:gst_audio_resample_transform_size:<SD.I0.ASRC> asked to transform size 192000 in direction SINK
0:00:21.783229081  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:550:gst_audio_resample_transform_size:<SD.I0.ASRC> transformed size 192000 to 192204
0:00:21.783272723  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1198:gst_audio_resample_transform:<SD.I0.ASRC> transforming buffer of 192000 bytes, ts 0:00:07.000000000, duration 0:00:01.000000000, offset 336000, offset_end 384000
0:00:21.783480621  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1169:gst_audio_resample_process:<SD.I0.ASRC> Converted to buffer of 48050 samples (192200 bytes) with timestamp 0:00:07.000395833, duration 0:00:01.001041667, offset 336319, offset_end 384369
0:00:21.783659450  8327 0x7fffb4007990 DEBUG          audioresample gstaudioresample.c:1252:gst_audio_resample_transform:<SD.I0.ASRC> input = samples [336000, 384000) = [7000000000, 8000000000) ns;  output = samples [336319, 384369) = [7000395833, 8001437500) ns
0:00:21.783763373  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:515:gst_audio_resample_transform_size:<SD.I0.ASRC> asked to transform size 192000 in direction SINK
0:00:21.783808491  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:550:gst_audio_resample_transform_size:<SD.I0.ASRC> transformed size 192000 to 192204
0:00:21.783838451  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1198:gst_audio_resample_transform:<SD.I0.ASRC> transforming buffer of 192000 bytes, ts 0:00:08.000000000, duration 0:00:01.000000000, offset 384000, offset_end 432000
0:00:21.783939703  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1169:gst_audio_resample_process:<SD.I0.ASRC> Converted to buffer of 48050 samples (192200 bytes) with timestamp 0:00:08.001437500, duration 0:00:01.001041667, offset 384369, offset_end 432419
0:00:21.783978906  8327 0x7fffb4007990 DEBUG          audioresample gstaudioresample.c:1252:gst_audio_resample_transform:<SD.I0.ASRC> input = samples [384000, 432000) = [8000000000, 9000000000) ns;  output = samples [384369, 432419) = [8001437500, 9002479167) ns
0:00:21.785681767  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:566:gst_audio_resample_set_caps: incaps audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48050, channels=(int)2, channel-mask=(bitmask)0x0000000000000003, outcaps audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
0:00:21.804097471  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:515:gst_audio_resample_transform_size:<SD.I0.ASRC> asked to transform size 192000 in direction SINK
0:00:21.805081440  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:550:gst_audio_resample_transform_size:<SD.I0.ASRC> transformed size 192000 to 191804
0:00:21.805148415  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1198:gst_audio_resample_transform:<SD.I0.ASRC> transforming buffer of 192000 bytes, ts 0:00:09.000000000, duration 0:00:01.000000000, offset 432000, offset_end 480000
0:00:21.805287936  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1169:gst_audio_resample_process:<SD.I0.ASRC> Converted to buffer of 47650 samples (190600 bytes) with timestamp 0:00:09.002479167, duration 0:00:00.992708333, offset 432419, offset_end 480069
0:00:21.805342067  8327 0x7fffb4007990 DEBUG          audioresample gstaudioresample.c:1252:gst_audio_resample_transform:<SD.I0.ASRC> input = samples [432000, 480000) = [9000000000, 10000000000) ns;  output = samples [432419, 480069) = [9002479167, 9995187500) ns
0:00:21.805626761  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:515:gst_audio_resample_transform_size:<SD.I0.ASRC> asked to transform size 192000 in direction SINK
0:00:21.805691542  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:550:gst_audio_resample_transform_size:<SD.I0.ASRC> transformed size 192000 to 191804
0:00:21.805749741  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1198:gst_audio_resample_transform:<SD.I0.ASRC> transforming buffer of 192000 bytes, ts 0:00:10.000000000, duration 0:00:01.000000000, offset 480000, offset_end 528000
0:00:21.806042414  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1169:gst_audio_resample_process:<SD.I0.ASRC> Converted to buffer of 47950 samples (191800 bytes) with timestamp 0:00:09.995187500, duration 0:00:00.998958333, offset 480069, offset_end 528019
0:00:21.806104929  8327 0x7fffb4007990 DEBUG          audioresample gstaudioresample.c:1252:gst_audio_resample_transform:<SD.I0.ASRC> input = samples [480000, 528000) = [10000000000, 11000000000) ns;  output = samples [480069, 528019) = [9995187500, 10994145833) ns
0:00:21.806738267  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:515:gst_audio_resample_transform_size:<SD.I0.ASRC> asked to transform size 192000 in direction SINK
0:00:21.806808814  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:550:gst_audio_resample_transform_size:<SD.I0.ASRC> transformed size 192000 to 191804
0:00:21.806857863  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1198:gst_audio_resample_transform:<SD.I0.ASRC> transforming buffer of 192000 bytes, ts 0:00:11.000000000, duration 0:00:01.000000000, offset 528000, offset_end 576000
0:00:21.807368262  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1169:gst_audio_resample_process:<SD.I0.ASRC> Converted to buffer of 47950 samples (191800 bytes) with timestamp 0:00:10.994145833, duration 0:00:00.998958334, offset 528019, offset_end 575969
0:00:21.807474435  8327 0x7fffb4007990 DEBUG          audioresample gstaudioresample.c:1252:gst_audio_resample_transform:<SD.I0.ASRC> input = samples [528000, 576000) = [11000000000, 12000000000) ns;  output = samples [528019, 575969) = [10994145833, 11993104167) ns
0:00:21.807682876  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:515:gst_audio_resample_transform_size:<SD.I0.ASRC> asked to transform size 192000 in direction SINK
0:00:21.807733133  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:550:gst_audio_resample_transform_size:<SD.I0.ASRC> transformed size 192000 to 191804
0:00:21.807789286  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1198:gst_audio_resample_transform:<SD.I0.ASRC> transforming buffer of 192000 bytes, ts 0:00:12.000000000, duration 0:00:01.000000000, offset 576000, offset_end 624000
0:00:21.807878589  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1169:gst_audio_resample_process:<SD.I0.ASRC> Converted to buffer of 47950 samples (191800 bytes) with timestamp 0:00:11.993104167, duration 0:00:00.998958333, offset 575969, offset_end 623919
0:00:21.807966183  8327 0x7fffb4007990 DEBUG          audioresample gstaudioresample.c:1252:gst_audio_resample_transform:<SD.I0.ASRC> input = samples [576000, 624000) = [12000000000, 13000000000) ns;  output = samples [575969, 623919) = [11993104167, 12992062500) ns
0:00:21.808780856  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:566:gst_audio_resample_set_caps: incaps audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)47950, channels=(int)2, channel-mask=(bitmask)0x0000000000000003, outcaps audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
0:00:21.833686358  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:515:gst_audio_resample_transform_size:<SD.I0.ASRC> asked to transform size 192000 in direction SINK
0:00:21.834135608  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:550:gst_audio_resample_transform_size:<SD.I0.ASRC> transformed size 192000 to 192204
0:00:21.834195379  8327 0x7fffb4007990 LOG            audioresample gstaudioresample.c:1198:gst_audio_resample_transform:<SD.I0.ASRC> transforming buffer of 192000 bytes, ts 0:00:13.000000000, duration 0:00:01.000000000, offset 624000, offset_end 672000
**
ERROR:gstaudioresample.c:1125:gst_audio_resample_process: assertion failed: (out_len >= out_processed)
Reply | Threaded
Open this post in threaded view
|

Re: audioresample assertion failed: (out_len >= out_processed)

Sebastian Dröge-3
On Fr, 2016-07-08 at 02:51 -0700, Maik Scholz wrote:

> Hi,
>
> i have a issue with an assert in audioresample (1.8.1).
> ERROR:gstaudioresample.c:1125:gst_audio_resample_process: assertion failed:
> (out_len >= out_processed)
>
> In my pipeline i implemented a BUFFER PadProbe on the audioresample sink and
> source pad.
> Within that callback, i like to change the caps rate (norminal 48kHz +-
> 50Hz).
> Unfortunately after some frames, my application stops with the assert.
> I attached a pdf file with the debugger backtrace and the local variables.
Please try to create a (as simple as possible) testcase for reproducing
this problem. Just a pipeline with an audiotestsrc, capsfilters and
audioresample, plus your logic to change the sample rate, should be
enough.

--

Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: audioresample assertion failed: (out_len >= out_processed)

Maik Scholz
Hi,

i am allready trying to build such a test application.
Unfortunately, the error didn't ocure there.
I will continue that.

I have a debugger screenshot attached.
audioresample_out_len_error.pdf
Reply | Threaded
Open this post in threaded view
|

Re: audioresample assertion failed: (out_len >= out_processed)

Maik Scholz
In reply to this post by Sebastian Dröge-3
Hi Sebastian,
>Please try to create a (as simple as possible) testcase for reproducing this problem.
the attached code shows the same problem compiled with gstreamer 1.8.1.

It implements a pipeline with a test noise source, a switched (5 seconds on + 5 seconds off) appsrc sine noise,
combined with a audiomixer.

If i run that code, then i see the exception after 10 seconds.
If I disable the "#if 1", the the code runs without exception.

My current understanding is, that the "(out_len >= out_processed)" exception happens
when i change the caps/samplerate within a gap.

Maik

#include <stdio.h>
#include <math.h>

#include <gst/gst.h>
#include <gst/app/gstappsrc.h>
#include <gst/gstcaps.h>

#define TESTCAPS "audio/x-raw,format=S16LE,channels=2,rate=48000,layout=interleaved"

GstPad* eB3_sink_pad;
GstClockTime eB3_sink_time = 0;

GstPad* eB3_src_pad;
GstClockTime eB3_src_time = 0;
GstClockTime eB3_next_src_time = 0;

typedef struct
{
    GstElement* e;
    guint       frequency;
    guint       samplerate;
    guint       period;
    GstClockTime src_timestamp;
    gboolean    gap;
} AudioSrcDataType;

gboolean appsrc_feed_function (AudioSrcDataType* me);

GstPadProbeReturn audioresample_pad_probe (GstPad          *pad,
                                           GstPadProbeInfo *info,
                                           gpointer         user_data);
/* Main */
int main(void)
{
    gst_init(NULL, NULL);
    GstElement* p = gst_pipeline_new("pipeline");

    GstElement* eA1 = gst_element_factory_make("audiotestsrc",NULL);
    g_object_set(eA1, "volume", 0.01, NULL);
    g_object_set(eA1, "wave", 5, NULL);
    g_object_set(eA1, "samplesperbuffer", 48000*32/1000, NULL);
    GstElement* eA2 = gst_element_factory_make("audioconvert",NULL);

    AudioSrcDataType live_audio_B = {NULL,300,48000,120,0,TRUE};
    live_audio_B.e = gst_element_factory_make("appsrc",NULL);
    gst_app_src_set_caps(GST_APP_SRC(live_audio_B.e),gst_caps_from_string(TESTCAPS));
    gst_base_src_set_live(GST_BASE_SRC(live_audio_B.e),TRUE);
    g_object_set (G_OBJECT(GST_APP_SRC(live_audio_B.e)), "format", GST_FORMAT_TIME, NULL);
    g_object_set (G_OBJECT(GST_APP_SRC(live_audio_B.e)), "block", FALSE, NULL);
    gst_app_src_set_stream_type(GST_APP_SRC(live_audio_B.e),GST_APP_STREAM_TYPE_STREAM);
    gst_app_src_set_latency(GST_APP_SRC(live_audio_B.e),1*live_audio_B.period*GST_MSECOND,1*live_audio_B.period*GST_MSECOND);
    g_timeout_add (live_audio_B.period/2,appsrc_feed_function,&live_audio_B);

    GstElement* eB2 = gst_element_factory_make("audiorate",NULL);
    g_object_set(eB2, "tolerance", (120+10)*GST_MSECOND, NULL);

    GstElement* eB3 = gst_element_factory_make("audioresample",NULL);
    g_object_set(eB3, "quality", 4, NULL);
    g_object_set(eB3, "sinc-filter-mode", 2, NULL);

    GstElement* e_mixer = gst_element_factory_make("audiomixer",NULL);
    g_object_set(e_mixer, "latency", 512*GST_MSECOND, NULL);

    GstElement* e_sink = gst_element_factory_make("autoaudiosink",NULL);

    /* add ... */
    gst_bin_add_many(GST_BIN(p),eA1,eA2,NULL);
    gst_bin_add_many(GST_BIN(p),live_audio_B.e,eB2,/*eB3,*/eB3,NULL);
    gst_bin_add_many(GST_BIN(p),e_mixer,e_sink,NULL);

    /* link ... */
    gst_element_link_filtered(eA1, eA2, gst_caps_from_string(TESTCAPS));
    gst_element_link_many(live_audio_B.e, eB2, eB3, NULL);
    gst_pad_link (gst_element_get_static_pad (eA2,"src"),
                  gst_element_request_pad (e_mixer,gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS(e_mixer),"sink_%u"),
                                           NULL, NULL));
    gst_pad_link (gst_element_get_static_pad (eB3,"src"),
                  gst_element_request_pad (e_mixer,gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS(e_mixer),"sink_%u"),
                                           NULL, NULL));
    gst_element_link_many(e_mixer, e_sink, NULL);

#if 1 /* Enable audioresample control loop, if disabled, the error does not ocure  */
    {
        eB3_sink_pad = gst_element_get_static_pad (eB3, "sink");
        gst_pad_add_probe (eB3_sink_pad,GST_PAD_PROBE_TYPE_BUFFER,(GstPadProbeCallback) audioresample_pad_probe,NULL,NULL);

        eB3_src_pad = gst_element_get_static_pad (eB3, "src");
        gst_pad_add_probe (eB3_src_pad,GST_PAD_PROBE_TYPE_BUFFER,(GstPadProbeCallback) audioresample_pad_probe,NULL,NULL);
    }
#endif

    /* run ... */
    {
        static GMainLoop *loop;
        loop = g_main_loop_new(NULL, FALSE);
        gst_element_set_state(GST_ELEMENT(p), GST_STATE_PLAYING);
        g_main_loop_run(loop);
    }
    return 0;
}

/* timer based appsrc feed function.
 * 5 seconds sine + 5 seconds gap
 */
gboolean appsrc_feed_function (AudioSrcDataType* me)
{
    if( GST_BASE_SRC_IS_STARTED(me->e) )
    {
        GstClockTime t_now;
        while( ( t_now = gst_clock_get_time(gst_element_get_clock(GST_ELEMENT(me->e)))-gst_element_get_base_time(GST_ELEMENT(me->e))) > me->src_timestamp )
        {
            GstMapInfo buffer_info; guint i;
            guint buffer_size = 2*sizeof(gint16)*me->samplerate*me->period/1000;
            GstBuffer* buffer = gst_buffer_new_and_alloc(buffer_size);
            if( gst_buffer_map(buffer,&buffer_info,GST_MAP_WRITE) )
            {
                gst_buffer_ref(buffer);
                for(i=0;i<(buffer_size/sizeof(gint16));)
                {
                    static glong t=0;
                    gint16 v = (gint16)(1000.0*sin(me->frequency*(t++)*2*3.14/me->samplerate));
                    ((gint16*)(buffer_info.data))[i++] = v;
                    ((gint16*)(buffer_info.data))[i++] = v;
                }
                GST_BUFFER_PTS(buffer) = t_now;
                GST_BUFFER_DURATION (buffer) = GST_CLOCK_TIME_NONE;
                //GST_BUFFER_DURATION (buffer) = me->period * GST_MSECOND;
                me->src_timestamp += me->period*GST_MSECOND;
                gst_buffer_unmap(buffer,&buffer_info);
            }

            if( (GST_TIME_AS_SECONDS(t_now)%10 ) < 5 )
            {
                /* 5 seconds push audio to pipeline */
                if(me->gap)
                {
                    me->gap = FALSE;
                    GST_BUFFER_FLAG_SET(buffer,GST_BUFFER_FLAG_RESYNC);
                }
                if( gst_app_src_push_buffer(GST_APP_SRC(me->e),buffer) != GST_FLOW_OK )
                {
                    gst_buffer_unref (buffer);
                }
            }
            else
            {
                /* 5 seconds GAP */
                gst_buffer_unref (buffer);

                if(!me->gap)
                {
                    me->gap = TRUE;
                }
                gst_pad_push_event(GST_BASE_SRC_PAD(me->e),gst_event_new_gap(t_now,GST_CLOCK_TIME_NONE));
            }
        }
    }
    return TRUE;
}

/* audioresample PAD prob
 */
GstPadProbeReturn audioresample_pad_probe (GstPad          *pad,
                                           GstPadProbeInfo *info,
                                           gpointer         user_data)
{
    (void)user_data;
    if(((info->type&GST_PAD_PROBE_TYPE_BUFFER)!=0)&&(info->data != NULL))
    {
        if( pad == eB3_sink_pad )
        {
            eB3_sink_time = GST_BUFFER_TIMESTAMP(GST_BUFFER(info->data));
        }
        else if( pad == eB3_src_pad )
        {
            eB3_src_time = GST_BUFFER_TIMESTAMP(GST_BUFFER(info->data));
            if(( eB3_next_src_time < eB3_src_time )&&(GST_PAD_STREAM_TRYLOCK(eB3_sink_pad)))
            {
                gint rate;
                GstCaps* caps = gst_pad_get_current_caps(eB3_sink_pad);
                GstStructure* structure;
                caps = gst_caps_make_writable(caps);
                structure = gst_caps_get_structure(caps,0);
                if (gst_structure_get_int (structure, "rate", &rate) )
                {
                    if( eB3_src_time > eB3_sink_time ) {
                        rate = 48000 + 50;
                    } else {
                        rate = 48000 - 50;
                    }
                    printf("src=%dms sink=%dms set audioresample input rate to %d\n",
                           (gint)GST_TIME_AS_MSECONDS(eB3_src_time),
                           (gint)GST_TIME_AS_MSECONDS(eB3_sink_time),
                           rate);
                    gst_caps_set_simple(caps,"rate",G_TYPE_INT,rate,NULL);
                    gst_pad_set_caps(eB3_sink_pad,caps);
                    gst_pad_send_event (eB3_sink_pad, gst_event_new_caps (caps));
                }
                eB3_next_src_time = eB3_src_time + 1000 * GST_MSECOND; /* next adjustment in 5 seconds */
                GST_PAD_STREAM_UNLOCK(eB3_sink_pad);
            }
        }
    }
    return GST_PAD_PROBE_OK;
}
Reply | Threaded
Open this post in threaded view
|

Re: audioresample assertion failed: (out_len >= out_processed)

Sebastian Dröge-3
On Mo, 2016-07-11 at 05:23 -0700, Maik Scholz wrote:

> Hi Sebastian,
> > Please try to create a (as simple as possible) testcase for
> > reproducing
> this problem.
> the attached code shows the same problem compiled with gstreamer
> 1.8.1.
>
> It implements a pipeline with a test noise source, a switched (5
> seconds on + 5 seconds off) appsrc sine noise,
> combined with a audiomixer.
>
> If i run that code, then i see the exception after 10 seconds.
> If I disable the "#if 1", the the code runs without exception.
>
> My current understanding is, that the "(out_len >= out_processed)"
> exception happens when i change the caps/samplerate within a gap.
I didn't look closely at your code (or the crash), but I can confirm
that it crashes like that with 1.8 but it doesn't seem to crash at all
here with 1.9.1. It is also using a completely new resampler, so that's
not too surprising.

--

Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: audioresample assertion failed: (out_len >= out_processed)

Maik Scholz
Thank you very much.

With:
gst 1.9.1 => no problem
gst 1.8.2 => audioresample assertion failed: (out_len >= out_processed) => crash
gst 1.6.3 => audioresample GStreamer-CRITICAL **: gst_buffer_resize_range: assertion 'bufmax >= bufoffs + offset + size' failed

Shall I report a "GNOME Bugziller" bug for the 1.8.2 and 1.6.* branches?

Maik