iOS: AURemoteIO at 0x31ab420: IOThread exiting with error 0x10004006

Elio Francesconi elio.francesconi at gmail.com
Sun Nov 10 00:07:00 PST 2013


Hi Sebastian,
IMHO I think the issue is due to  osxsrc->deviceChannels  returns -1 (I don’t know why) so a default one caps is returned.
In that case the conversion S32LE -> S16LE is not needed so that’s why the audio is distorted.
What do you think?

static GstCaps *
gst_osx_audio_src_get_caps (GstBaseSrc * src, GstCaps * filter)
{
  GstElementClass *gstelement_class;
  GstOsxAudioSrc *osxsrc;
  GstPadTemplate *pad_template;
  GstCaps *caps;
  gint min, max;

  gstelement_class = GST_ELEMENT_GET_CLASS (src);
  osxsrc = GST_OSX_AUDIO_SRC (src);

  if (osxsrc->deviceChannels == -1) {
    /* -1 means we don't know the number of channels yet.  for now, return
     * template caps.
     */
    return NULL;
  }
  max = osxsrc->deviceChannels;
  if (max < 1)
    max = 1;                    /* 0 channels means 1 channel? */

  min = MIN (1, max);

  pad_template = gst_element_class_get_pad_template (gstelement_class, "src");
  g_return_val_if_fail (pad_template != NULL, NULL);

  caps = gst_caps_copy (gst_pad_template_get_caps (pad_template));

  if (min == max) {
    gst_caps_set_simple (caps, "channels", G_TYPE_INT, max, NULL);
  } else {
    gst_caps_set_simple (caps, "channels", GST_TYPE_INT_RANGE, min, max, NULL);
  }

  return caps;
}
On 10 Nov 2013, at 08:18, Elio Francesconi <elio.francesconi at gmail.com> wrote:

> I’ve added logs about negotiated caps for: 
> 	PIPELINE#1: gst_parse_launch("audiotestsrc ! audioconvert ! audioresample ! alawenc ! rtppcmapay ! udpsink host=192.168.1.6 port=5011", &error);
> and for this one:
> 	PIPELINE#2: gst_parse_launch("osxaudiosrc ! audioconvert ! audioresample ! alawenc ! rtppcmapay ! udpsink host=192.168.1.6 port=5011", &error);
> 
> I’ve tried to extract from logs section regarding capability negotiated starting form source ending on alawenc, this is the result:
> 
> PIPELINE#1(WORKING):
> 0:00:00.216090000 [336m 1073[00m  0xe2b8c00 [37mDEBUG  [00m [00;01;34m            GST_CAPS gstutils.c:2769:GstCaps *gst_pad_query_caps(GstPad *, GstCaps *):<audiotestsrc0:src>[00m query returned audio/x-raw, format=(string){ S16LE, S32LE, F32LE, F64LE }, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2 ]
> 
> 0:00:00.218543000 [336m 1073[00m  0xe2b8c00 [37mDEBUG  [00m [00;01;34m            GST_CAPS gstutils.c:2769:GstCaps *gst_pad_query_caps(GstPad *, GstCaps *):<audioconvert0:sink>[00m query returned audio/x-raw, rate=(int)[ 1, 2147483647 ], layout=(string)interleaved, format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, channels=(int)[ 1, 2147483647 ]
> 
> 0:00:00.220093000 [336m 1073[00m  0xe2b8c00 [37mDEBUG  [00m [00;01;34m            GST_CAPS gstutils.c:2815:GstCaps *gst_pad_peer_query_caps(GstPad *, GstCaps *):<audioconvert0:sink>[00m peer query returned audio/x-raw, format=(string){ S16LE, S32LE, F32LE, F64LE }, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2 ]
> 
> 0:00:00.221282000 [336m 1073[00m  0xe2b8c00 [37mDEBUG  [00m [00;01;34m            GST_CAPS gstutils.c:2769:GstCaps *gst_pad_query_caps(GstPad *, GstCaps *):<audioconvert0:src>[00m query returned audio/x-raw, format=(string){ S16LE, S32LE, F32LE, F64LE }, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2 ]; audio/x-raw, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, channels=(int)[ 1, 2147483647 ]
> 
> 
> 0:00:00.221958000 [336m 1073[00m  0xe2b8c00 [37mDEBUG  [00m [00;01;34m            GST_CAPS gstutils.c:2769:GstCaps *gst_pad_query_caps(GstPad *, GstCaps *):<alawenc0:sink>[00m query returned audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)[ 8000, 192000 ], channels=(int)[ 1, 2 ] 
> 
> 
> PIPELINE#2(NOTWORKING): 
> ….
> finding pad in audioconvert0 compatible with osxaudiosrc0:src
> 0:00:00.271008000 [335m 1018[00m  0xe940800 [36mINFO   [00m [00;01;31;41m            GST_PADS gstutils.c:936:gboolean gst_pad_check_link(GstPad *, GstPad *):[00m trying to link osxaudiosrc0:src and audioconvert0:sink
> 0:00:00.271021000 [335m 1018[00m  0xe940800 [37mDEBUG  [00m [00;01;34m            GST_CAPS gstutils.c:2762:GstCaps *gst_pad_query_caps(GstPad *, GstCaps *):<osxaudiosrc0:src>[00m get pad caps with filter (NULL)
> 0:00:00.271039000 [335m 1018[00m  0xe940800 [37mDEBUG  [00m [00m               query gstquery.c:680:GstQuery *gst_query_new_custom(GstQueryType, GstStructure *):[00m creating new query 0xe941a60 caps
> 0:00:00.271212000 [335m 1018[00m  0xe940800 [37mDEBUG  [00m [00;01;31;41m            GST_PADS gstpad.c:3448:gboolean gst_pad_query(GstPad *, GstQuery *):<osxaudiosrc0:src>[00m doing query 0xe941a60 (caps)
> 0:00:00.271263000 [335m 1018[00m  0xe940800 [37mDEBUG  [00m [00m             basesrc gstbasesrc.c:1248:gboolean gst_base_src_default_query(GstBaseSrc *, GstQuery *):<osxaudiosrc0>[00m query caps returns 0
> 0:00:00.271275000 [335m 1018[00m  0xe940800 [37mDEBUG  [00m [00;01;31;41m            GST_PADS gstpad.c:3470:gboolean gst_pad_query(GstPad *, GstQuery *):<osxaudiosrc0:src>[00m sent query 0xe941a60 (caps), result 0
> 0:00:00.271286000 [335m 1018[00m  0xe940800 [37mDEBUG  [00m [00;01;31;41m            GST_PADS gstpad.c:3514:gboolean gst_pad_query(GstPad *, GstQuery *):<osxaudiosrc0:src>[00m query failed
> 0:00:00.271300000 [335m 1018[00m  0xe940800 [37mDEBUG  [00m [00;01;34m            GST_CAPS gstutils.c:2762:GstCaps *gst_pad_query_caps(GstPad *, GstCaps *):<audioconvert0:sink>[00m get pad caps with filter (NULL)
> ….
> 
> 
> 0:00:00.276255000 [335m 1018[00m  0xe940800 [37mDEBUG  [00m [00;01;34m            GST_CAPS gstutils.c:2769:GstCaps *gst_pad_query_caps(GstPad *, GstCaps *):<audioconvert0:sink>[00m query returned audio/x-raw, rate=(int)[ 1, 2147483647 ], layout=(string)interleaved, format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, channels=(int)[ 1, 2147483647 ]
> 
> 0:00:00.279536000 [335m 1018[00m  0xe940800 [37mDEBUG  [00m [00;01;34m            GST_CAPS gstutils.c:2769:GstCaps *gst_pad_query_caps(GstPad *, GstCaps *):<audioconvert0:src>[00m query returned audio/x-raw, rate=(int)[ 1, 2147483647 ], layout=(string)interleaved, format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, channels=(int)[ 1, 2147483647 ]
> 
> 0:00:00.280053000 [335m 1018[00m  0xe940800 [37mDEBUG  [00m [00;01;34m            GST_CAPS gstutils.c:2769:GstCaps *gst_pad_query_caps(GstPad *, GstCaps *):<alawenc0:sink>[00m query returned audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)[ 8000, 192000 ], channels=(int)[ 1, 2 ]
> 
> 
> 
> On 09 Nov 2013, at 19:35, Sebastian Dröge <sebastian at centricular.com> wrote:
> 
>> On Sa, 2013-11-09 at 19:19 +0100, Elio Francesconi wrote:
>>> Sorry Sebastian I did some tests but I’m not able to use properly capsfilter, but I did these tests:
>>> 
>>> this pipeline works very good:
>>> gst_parse_launch("osxaudiosrc ! audioconvert ! audioresample ! autoaudiosink", &error);
>>> this pipeline works too:
>>> gst_parse_launch("audiotestsrc ! audioconvert ! audioresample ! alawenc ! rtppcmapay ! udpsink host=192.168.1.6 port=5011", &error);
>>> 
>>> this one no:
>>> gst_parse_launch("osxaudiosrc ! audioconvert ! audioresample ! alawenc ! rtppcmapay ! udpsink host=192.168.1.6 port=5011", &error);
>>> 
>>> then as you suggested, but I’m not confident have understood your suggestion I converted osxaudiosrc with capsfilter:
>>> gst_parse_launch("osxaudiosrc !  audioconvert ! audio/x-raw,format=S16LE,channels=1,layout=interleaved,rate=8000 ! alawenc ! rtppcmapay ! udpsink host=192.168.1.6 port=5011", &error);
>>> 
>>> But it seems this caps filter doesn’t fix my issue…
>> 
>> Yeah because you let the conversion be done by audioconvert, instead of
>> having osxaudiosrc negotiate to a different format. But from looking at
>> the code it only supports S32LE anyway (currently).
>> 
>> So what you could try is to check if osxaudiosrc negotiates to different
>> caps in the working and non-working case. For that you could for example
>> connect to the notify::caps signal on the srcpad of osxaudiosrc, and
>> from the callback there call gst_pad_get_current_caps() and then print
>> that.
>> 
>> Alternatively it's also printed in the debug logs somewhere :)
>> 
>> If the caps are the same, the problem will be elsewhere (also adding a
>> queue somewhere in the pipeline might be a good idea, like in front of
>> the encoder).
>> 
>> -- 
>> Sebastian Dröge <sebastian at centricular.com>
>> Centricular Ltd - http://www.centricular.com
>> Expertise, Straight from the Source
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131110/f7bf630a/attachment-0001.html>


More information about the gstreamer-devel mailing list