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 751144 - audioringbuffer: Fix alaw/mulaw channel positions
audioringbuffer: Fix alaw/mulaw channel positions
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-18 10:03 UTC by Lyon
Modified: 2015-06-22 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mulaw clip for reproducing the issue. (991.81 KB, audio/wav)
2015-06-18 10:03 UTC, Lyon
  Details
patch for fix this alaw/mulaw channel position issue (1.77 KB, patch)
2015-06-18 10:06 UTC, Lyon
committed Details | Review

Description Lyon 2015-06-18 10:03:59 UTC
Created attachment 305524 [details]
mulaw clip for reproducing the issue.

When we played 2 channel mulaw wav clips with pulsesink as below command line:
 gst-launch-1.0 filesrc location=Mulaw_22.05khz_353kbps_2_8bit.wav ! wavparse ! pulsesink

There is only 1 channel output can be heard.  (please see attached file for the mulaw clip)


Checked pulsesink plugin, it will invoke gst_pulse_gst_to_channel_map() to map the gst channel position to pulse channel position.
However, when playing mulaw clips,, the position array's value in audioinfo sturcture is all 0 (not initialized to default value), so that when mapping to pulse channel postion, it will both be considered as FRONT_LEFT channel. hence, only left channel can be heard.

Checked the pulsesink plugin, it will call gst_audio_ring_buffer_parse_caps() in which it will set audioinfo from caps, but in this function only audio/x-raw clips set the audio_info and initialized position array.

Attached a patch for this issue. when in gst_audio_ring_buffer_parse_caps(), need initialize audioinfo channel position array when mime type is audio/x-alaw and audio/x-mulaw
Comment 1 Lyon 2015-06-18 10:06:44 UTC
Created attachment 305525 [details] [review]
patch for fix this alaw/mulaw channel position issue

the patch will initialized the channel position array for audio/x-alaw and audio/x-mulaw clips.
Comment 2 Sebastian Dröge (slomo) 2015-06-22 16:29:26 UTC
commit 829b7298e9d783d612032273775c7048bf83fec6
Author: Lyon Wang <lyon.wang@freescale.com>
Date:   Thu Jun 18 17:38:09 2015 +0800

    audioringbuffer: Fix alaw/mulaw channel positions
    
    For alaw/mulaw we should also try to initialize the channel positions in the
    ringbuffer's audio info. This allow pulsesink to directly use the channel
    positions instead of using the default zero-initialized ones, which doesn't
    work well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751144