Float not supported by alsasink

vijaypalaniswamy vijay.palaniswamy at in.bosch.com
Tue May 16 10:41:46 UTC 2017

Hi All,

I tried playing ogg file, using vorbis decoder which gives PCM in float.
Even the alsa device supports FLOAT pcm, the pipeline is not working without
audioconvert [Required for format conversion from float to int]

gst-launch-1.0 filesrc location=xxxx.ogg ! decodebin ! audioconvert ! 
alsasink device=xxx

By debugging I found in gst-plugins-base-1.8.3/ext/alsa/gstalsa.c function
the float format is not added.

So I compiled base plugin by adding below code 

static snd_pcm_format_t
gst_alsa_get_pcm_format (GstAudioFormat fmt)
  switch (fmt) {
      case GST_AUDIO_FORMAT_U32BE:
         return SND_PCM_FORMAT_U32_BE;
+      return SND_PCM_FORMAT_FLOAT_LE;

With above change I am able to play float PCM.
Any reason why FLOAT was not considered in base alsa? Is it expected not to
have float support.
Please let me know any method to avoid using audioconvert.

Thank you

View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Float-not-supported-by-alsasink-tp4683011.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.

More information about the gstreamer-devel mailing list