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 453650 - [audiobasesrc] two alsasrcs do not work in one pipeline
[audiobasesrc] two alsasrcs do not work in one pipeline
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.13
Other All
: Normal normal
: 0.10.15
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 464142 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-07-04 11:01 UTC by Vitaly Mayatskih
Modified: 2007-10-16 11:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vitaly Mayatskih 2007-07-04 11:01:34 UTC
Please describe the problem:
I need to join streams from two soundcards and mux it with some video. I have built a sample pipeline with one soundcard and it works fine:

gst-launch -v videotestsrc num-buffers=100 ! ffmpegcolorspace ! ffdeinterlace ! tee name="tee0" ! fakesink \                                                
    tee0. ! queue ! ffenc_h263p ! tee name="tee1" ! fakesink \                                                                                              
    tee1. ! queue ! matroskamux name="mux" ! filesink location="/tmp/1.mkv" \                                                                               
    alsasrc device="hw:0" ! "audio/x-raw-int,width=16,rate=48000,channels=2" ! adder name="mix" \                                                           
    ! tee name="tee2" ! ffenc_ac3 ! tee name="tee3" ! "audio/x-ac3,width=16,rate=48000,channels=2" ! mux. \                                                 
    tee3. ! queue ! fakesink

When I add a second card (even without linking to the 'adder' element) then pipeline stops

    alsasrc device="hw:1" ! "audio/x-raw-int,width=16,rate=48000,channels=2" ! fakesink

The error is:

Setting pipeline to PLAYING ...
0:00:00.231934000 15579 0x804f050 WARN              pipeline gstpipeline.c:568:gst_pipeline_change_state:<pipeline0> error: Selected clock cannot be used in pipeline.
0:00:00.232189000 15579 0x804f050 WARN              pipeline gstpipeline.c:568:gst_pipeline_change_state:<pipeline0> error: Pipeline cannot operate with selected clock
ERROR: pipeline doesn't want to play

In my C-program with only one alsasrc I have to manually set pipeline's clock (got it from alsasrc) and it works, but I didn't find the way how two alsasrc can work together.

Steps to reproduce:
Run pipeline with two alsasrc


Actual results:
Got error: Pipeline cannot operate with selected clock

Expected results:
Two alsasrc should work both together

Does this happen every time?
yes

Other information:
Comment 1 Tim-Philipp Müller 2007-09-23 10:20:22 UTC
I can reproduce this with the gutsy packages (core/base 0.10.14) with:

 gst-launch-0.10 alsasrc device=null ! queue ! fakesink   alsasrc device=null ! queue ! fakesink

but can't reproduce this with CVS.  Not sure which commit fixed it though.
Comment 2 Tim-Philipp Müller 2007-09-23 10:21:56 UTC
*** Bug 464142 has been marked as a duplicate of this bug. ***
Comment 3 Tim-Philipp Müller 2007-10-16 11:38:34 UTC
This is fixed in CVS:

2007-10-08  Wim Taymans  <wim.taymans@gmail.com>

        * gst-libs/gst/audio/gstbaseaudiosrc.c:
        (gst_base_audio_src_create):
        Also handle the case where there is no clock set on the audio source,
        like in the unit tests.

2007-09-10  Wim Taymans  <wim.taymans@gmail.com>

        * gst-libs/gst/audio/gstbaseaudiosrc.c:
        (gst_base_audio_src_class_init), (gst_base_audio_src_init),
        (gst_base_audio_src_provide_clock),
        (gst_base_audio_src_set_property),
        (gst_base_audio_src_get_property), (gst_base_audio_src_create):
        * gst-libs/gst/audio/gstbaseaudiosrc.h:
        Allow othe clocks than the internal clock to be used for the pipeline.
        Add property to disable clock provide.
        API: GstBaseAudioSrc::provide-clock


(the pipeline above won't work right though because of the null device thing - but it should work with real audio devices).