GNOME Bugzilla – Bug 130682
[alsasink] fails to negotiate with audio decoders
Last modified: 2004-12-22 21:47:04 UTC
I recently upgraded to GStreamer 0.7.3, and at the same time finally got around to switching my default audio sink from osssink (using ALSA's emulation os OSS) to alsasink, but it didn't work. When trying to use alsasink for audio output it cannot negotaite with whichever audio decoder is used. As an example, if I run "filesrc location=/path/to/music.ogg ! vorbisfile ! alsasink" it fails, reporting "ERROR: /pipeline0/vorbisfile0: negotiation failed on pad vorbisfile0:src". The same error occurs if I try to play a mp3 with mad as the decoder. However some other audio sources seem to work, such as "sinesrc ! alsasink". I haven't had a chance to do anything much with GStreamer yet, but from what I know of the basics it is probably a problem with the sink negotiating the data stream it wants. If anyone wants I can attach the output of gst-inspect for alsasink and osssink, or run more test with various pipelines to try to find what exactly is causing this.
What you describe is the correct behaviour if the soundcard in use doesn't do stereo. So this leads to the question: What's your soundcard? And could you try using alsasink device=plughw:0 and see if that works? Or if that doesn't work audioconvert ! alsasink ?
I've got a Vibra 128 (which uses the ensoniq 1371 drivers), so it does stereo. I just noticed that when retypeing the bug report (the power failed the first time) I forgot one paragraph. The alsa sink works under 0.6.3 and using osssink still works (using ALSAs emulation). Using "alsasink device=plughw:0" gives the same error as before and using "gst-launch-0.7 filesrc location="/path/to/music.mp3" ! mad ! audioconvert ! alsasink" reports "ERROR: /pipeline0/audioconvert0: AudioConvert: could not set caps on pad src".
Urk. Marking high because of the regression.
Updated to 0.7.4 a while back, but this still doesn't work. Going straight to alsasink, with device=plughw:0 and using audioconvert report the following (depending on the codec used) :- ERROR: from element /pipeline0/vorbisfile0: Internal GStreamer error: pad problem. File a bug. Additional debug info: gstpad.c(2260): gst_pad_set_explicit_caps: /pipeline0/vorbisfile0: failed to negotiate (try_set_caps returned REFUSED) or ERROR: from element /pipeline0/mad0: Internal GStreamer error: pad problem. File a bug. Additional debug info: gstpad.c(2260): gst_pad_set_explicit_caps: /pipeline0/mad0: failed to negotiate (try_set_caps returned REFUSED) (process:18284): GStreamer-WARNING **: push on peer of pad filesrc0:src but peer is not active If will probably update to 0.7.5 soon, and will check again then, but if there are any more tests that would help, just let me know.
Hm, someone get me such a soundcard so I can test that :/ Could you run a test again with --gst-debug=alsa*:5 and attach the log it does here?
Created attachment 25551 [details] Output log from gst-launch with alsa debug info
Updated to 0.7.5 and ran 'gst-launch-0.7 filesrc location="/path/to/music.ogg" ! vorbisfile ! audioconvert ! alsasink device=plughw:0 --gst-debug=alsa*:5' Resulting log atatched
Your log crashes galeon, interesting. Can you try with audioscale between alsasink and audioconvert?
Re-ping. I've tested on any crappy soundcard (even those USB ones) that I can think of, and *any* pipeline works as long as audioscale and audioconvert are in between the decoder (or spider) and alsasink. Please update/confirm.
Created attachment 27769 [details] Log from gst-lauch with alsa debug info Upgraded to gstreamer 0.8.1 and this still has issues. Also I upgraded my motherboard recently and the same problem occurs with the onboard Via VT82xx chipset. Log atatched from run of 'gst-launch filesrc location=/path/to/file.ogg ! spider ! audioconvert ! audioscale ! alsasink device=plughw:0 --gst-debug=alsa*:5 &> ~/gst-alsa-log'
WARN ^[[00m alsa^[[00m(^[[333m 4904^[[00m) ^[[00mgstalsa.c(1202):gst_alsa_probe_hw_params:<alsasink0>^[[00m "snd_pcm_hw_params_set_period_size_near (this->handle, hw_params, &period_size, 0)": Invalid argument ERROR: pipeline doesn't want to play. In other words, format detection is doing something wrong. Can you try a few of the following for me? gst-launch filesrc location=$file ! spider ! audioconvert ! audioscale ! $X ! alsasink For $X, fill in a few of the following: audio/x-raw-int,width=16,depth=16 audio/x-raw-int,rate=48000 audio/x-raw-itn,width=16,depth=16,rate=48000 Thanks.
I've gone up to 0.8.5 (plugins 0.8.4) now, and it now works. The original source ! spider ! alsasink plays fine. As I haven't upgraded alsa or anything else related in the mean time, I guess it probably got fixed by someone along the way. Thanks.