Click here to Skip to main content
11,796,393 members (69,975 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ Linux audio

We have a client SW that receive from a server OPUS packets that client should play.
The client is designed in Linux and use GStreamer playbin2 pipeline for this:
pipeline = gst_parse_launch ("playbin2 uri=appsrc:// ", NULL);
where the appsrc we fill with OPUS packets into a callback function that is called anytime player need data to play.
g_signal_connect (pipeline, "source-setup", G_CALLBACK (need_data_cb), NULL);
static void need_data_cb(GstElement *appsrc, guint unused_size, gpointer user_data)
 GstBuffer *buffer = gst_buffer_new_and_alloc(NETPKT_DATASIZE);
 GstFlowReturn ret;
  //the OPUS packets that come from server are stored into a fifo buffer  from where we extract it and add in buffer
 av_fifo_generic_read(netpkt_stream, buffer, NETPKT_TTLSIZE, av_fifo_cb);
//give to player the OPUS pack to play
 g_signal_emit_by_name(appsrc, "push-buffer", buffer, &ret);
 gst_buffer_unref (buffer);
 if(ret != GST_FLOW_OK) {
The problem is that after exact 64 second the Sound stop (after playing certain number of OPUS packets).
Each OPUS packets have a duration of 177ms and is coded as OPUS bit rate 48000.

In Log I get this when it stop playing:
GStreamer-WARNING **: failed to create thread: Error creating thread: Resource temporarily unavailable
(client:17452): GStreamer-WARNING **: adding flushing pad 'src0' to running element 'multiqueue3612', you need to use gst_pad_set_active(pad,TRUE) before adding it.
I observed also the memory used it increase by every packet played.

Can you help me with some hints what can I do or which is the cause of this behavior?

The client code is designed like here[^]

Thanks in advance
Posted 9-Jul-13 4:33am
Edited 9-Jul-13 5:00am
(no name)90.6K

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 530
1 Abhinav S 392
2 OriginalGriff 340
3 CPallini 269
4 KrunalRohit 249
0 OriginalGriff 2,012
1 Maciej Los 1,725
2 KrunalRohit 1,310
3 CPallini 1,055
4 ppolymorphe 858

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 9 Jul 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100