Webrtcsrc : gst_parse_no_more_pads

I’ve got these errors with on a computer with a USB sound card, that I don’t have with another computer and its internal sound card. I don’t get the grammar.y:915:gst_parse_no_more_pads

> 0:00:12.158220006   893 0x7efdec05e100 WARN                    alsa conf.c:5668:snd_config_expand: alsalib error: Unknown parameters {AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
> 0:00:12.158237960   893 0x7efdec05e100 WARN                    alsa pcm.c:2664:snd_pcm_open_noupdate: alsalib error: Unknown PCM lowlatencysink:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
> 0:00:12.158371399   893 0x7efdec05e100 WARN                 default subprojects/gstreamer/gst/parse/grammar.y:915:gst_parse_no_more_pads:<webrtcsrc0> warning: Delayed linking failed.
> 0:00:12.158384140   893 0x7efdec05e100 WARN                 default subprojects/gstreamer/gst/parse/grammar.y:915:gst_parse_no_more_pads:<webrtcsrc0> warning: failed delayed linking some pad of GstWebRTCSrc named webrtcsrc0 to some pad of GstAudioConvert named audioconvert0
> 0:00:12.401176698   893 0x7efdec05e100 WARN    webrtctransportsendbin transportsendbin.c:457:gst_transport_send_bin_element_query:<transportsendbin1> did not really configure latency of 0:00:00.000000000
> 0:00:12.401211203   893 0x7efe10001a70 WARN                GST_PADS gstpad.c:4361:gst_pad_peer_query:<nicesrc0:src> could not send sticky events
> 0:00:12.401212043   893 0x7efe10001cf0 WARN                GST_PADS gstpad.c:4361:gst_pad_peer_query:<nicesrc1:src> could not send sticky events
> 0:00:12.428511614   893 0x55c7e1cfe0a0 WARN              webrtcsink net/webrtc/src/webrtcsink/imp.rs:2256:gstrswebrtc::webrtcsink:👿:BaseWebRTCSink::start_session::{{closure}}::{{closure}}: rtprtxsend doesn't have a `stuffing-kbps` property, stuffing disabled
> 0:00:12.429404310   893 0x7efdec05e100 WARN    webrtctransportsendbin transportsendbin.c:457:gst_transport_send_bin_element_query:<transportsendbin1> did not really configure latency of 0:00:00.000000000
> 0:00:12.429936587   893 0x7efdec05e100 WARN    webrtctransportsendbin transportsendbin.c:457:gst_transport_send_bin_element_query:<transportsendbin1> did not really configure latency of 0:00:00.000000000
> 0:00:12.430376983   893 0x7efdec05e100 WARN    webrtctransportsendbin transportsendbin.c:457:gst_transport_send_bin_element_query:<transportsendbin1> did not really configure latency of 0:00:00.000000000
> 0:00:12.654317477   893 0x7efe10001a70 WARN                 basesrc gstbasesrc.c:3153:gst_base_src_loop:<nicesrc0> error: Internal data stream error.
> 0:00:12.654335931   893 0x7efe10001a70 WARN                 basesrc gstbasesrc.c:3153:gst_base_src_loop:<nicesrc0> error: streaming stopped, reason not-linked (-1)
> 0:00:12.654368966   893 0x7efe10001a70 WARN                   queue gstqueue.c:1035:gst_queue_handle_sink_event:<queue3> error: Internal data stream error.
> 0:00:12.654375095   893 0x7efe10001a70 WARN                   queue gstqueue.c:1035:gst_queue_handle_sink_event:<queue3> error: streaming stopped, reason not-linked (-1)
> 0:00:13.067809227   893 0x7efe0c039bb0 WARN              rtpsession rtpsession.c:4071:session_nack: Removing 1 expired NACKS

using this pipeline

 pipeline = Gst.parse_launch(f"webrtcsink name=ws meta=\"meta,name=stream\" \
                                appsrc name=src0 ! queue ! h264parse ! ws. \
                                appsrc name=src1 ! queue ! h264parse ! ws. \
                                alsasrc ! queue ! opusenc ! audio/x-opus, rate=48000, channels=2 ! ws. \
                                webrtcsrc signaller::uri=\"ws://{args.signaling_host}:{args.signaling_port}\" signaller::producer-peer-id={id} ! queue ! audioconvert ! alsasink")

If I use a fakesink instead of queue ! audioconvert ! alsasink, it is ok. I guess I have a problem with the audio playback.

Any idea? Thanks

You probably need an audioresample brefore alsasink (and possibly before opusenc).

I would try iterating on simpler pipelines to help with the investigation. You could start with:

GST_DEBUG=*:2,alsa:5 gst-launch-1.0 audiotestsrc ! audio/x-raw,format=S16LE,rate=48000,channels=2,layout=interleaved ! alsasink

Then add audioresample before alsasink if it fails due to an unsupported audio rate, etc.

Ok I’ll try that thanks.
One difference between the working setup and the other, is that the working setup can play 16bit wav files (with aplay), although the other one requires a 24bit wav file (S24_LE). That’s why I’ve added an audioconvert. Does audioconvert knows what alsasink needs? (I’ve tried to set a caps in between but it was not working).

I’m suspecting a wrong conversion somewhere indeed.

With the alsa:5 log level, you will see that alsasink detects the capabilities of the system. On my laptop this leads to the generation of the following (partial) CAPS:

INFO alsa gstalsasink.c:332:gst_alsasink_getcaps:<alsasink0> returning caps
audio/x-raw,
  format=(string){ F32LE, S32LE, S24_32LE, S24LE, S16LE, U8 },
  layout=(string)interleaved,
  rate=(int)[ 4000, 384000 ],
  channels=(int)2,
  channel-mask=(bitmask)0x0000000000000003;
[...]

audioconvert will take care of adapting the sample format and nb of channels, but not the sampling rate for which you’d need to add audioresample if the system is not capable of handling samples @ 48kHz.

You can try it with the following pipeline which abstracts the relevant components from your use case:

gst-launch-1.0 audiotestsrc \
  ! audio/x-raw,format=S16LE,rate=48000,channels=2 \
  ! opusenc ! decodebin3 \
  ! audioconvert \
  ! audioresample \
  ! audio/x-raw,format=U8,rate=8000,channels=1 \
  ! fakesink

If you remove audioresample, negotiation will fail because the requested 8kHz output sampling rate doesn’t match the 48kHz of the opus encoded stream.

audioconvert and audioresample solved the issue. Thanks!