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 775369 - Audio distortion since commit 010b954 (regression)
Audio distortion since commit 010b954 (regression)
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal blocker
: 1.11.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-29 22:07 UTC by Hains van den Bosch
Modified: 2016-11-30 09:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Music file for test. (3.08 MB, audio/x-wav)
2016-11-29 23:42 UTC, Hains van den Bosch
Details
Output wave file. (8.12 KB, text/plain)
2016-11-30 08:26 UTC, Hains van den Bosch
Details
debug log wave file. (15.52 KB, text/plain)
2016-11-30 08:40 UTC, Hains van den Bosch
Details

Description Hains van den Bosch 2016-11-29 22:07:00 UTC
Audio has a hugh distortion since commit

https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=010b9547d3832a5c3d71f73726f149b3b023882d

It's affected to MP3's, WAV files and physicial audio CD.

With previous commit of gstreamer-plugins-base all audio is playing flawless.

Settopbox dm8000, OpenPLi. Enigma2 log has no errors related to this problem(log is also equal before and after that commit).

201.109> action ->  InfobarActions showMovies
<   203.370> action ->  OkCancelActions ok
<   203.373> playing 4097:0:0:0:0:0:0:0:0:0:/hdd/music/02 No Promises.wav
<   203.376> [eServiceMP3] construct!
<   203.378> [eServiceMP3] playbin uri=file:///hdd/music/02%20No%20Promises.wav
<   203.509> [eServiceMP3] starting pipeline
<   203.710> [eServiceMP3] state transition NULL -> READY
<   203.763> [eDVBDB] getBouquet failed.. no path given!
<   203.776> [eDVBDB] getBouquet failed.. no path given!
<   205.113> [eServiceMP3] state transition READY -> PAUSED
<   205.115> [eServiceMP3] dont apply ac3 delay when no video is running!
<   205.116> [eServiceMP3] dont apply pcm delay when no video is running!
<   205.116> [eServiceMP3] loading cuesheet
<   205.117> [eServiceMP3] cutfile not found!
<   205.179> [eServiceMP3] async-done - 0 video, 1 audio, 0 subtitle
<   205.180> [eServiceMP3] AUDIO STRUCT=audio/x-raw
<   205.185> [eServiceMP3] audio stream=0 codec=Uncompressed 16-bit PCM audio language=und
<   205.212> [eServiceMP3] state transition PAUSED -> PLAYING


I've had this problem before, last year(december 2015).
With this commit:

https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=08734e7598ced4feae55529cb21609c1654a1dc0

It was solved then with this commit:

https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=7bbfa39ada905b44743170f6c29d13e5fefb5888

Just for info, perhaps it's helpfull.

GStreamer,GStreamer-base,bad,good and ugly up to date against GIT master HEAD.
Comment 1 Petr Kulhavy 2016-11-29 23:25:12 UTC
It would be very helpful if you could attach a record of the distorted audio and/or the gstreamer command/pipeline to reproduce.
Comment 2 Petr Kulhavy 2016-11-29 23:35:39 UTC
I don't see any common denominator between the commit 7bbfa39a and my changes. So I'm trying to find what could be different in Hains' case to my tests where the endian conversion was working like a charm...

I'm wondering what would happen if width != depth. The convert functions sort of assume there are no "holes" between samples, which might be a wrong assumption.

Hains, what is your output format?
Comment 3 Hains van den Bosch 2016-11-29 23:42:06 UTC
Created attachment 341004 [details]
Music file for test.

Music file wich as high distortion when playing with latest gstreamer-plugins-base.
Comment 4 Hains van den Bosch 2016-11-29 23:48:26 UTC
Normally i never use the commandline, start start the music via GUI.

But commandline in log, does the job also..With same result.

It occurs with wave files and physical CD..MP'3 are playing flawless. sorry for that.

100% tested that it occurs with that commit.

It's sounds like a CD player connected to phone-in.

I have attatched a WAV file for test.
Comment 5 Sebastian Dröge (slomo) 2016-11-30 08:17:59 UTC
No distortions in that file for me, probably because different conversion is triggered depending on how you output the audio.

Can you run with
  gst-launch-1.0 -v playbin uri=file:///path/to/file
and attach the output here?
Comment 6 Hains van den Bosch 2016-11-30 08:26:45 UTC
Created attachment 341030 [details]
Output wave file.
Comment 7 Sebastian Dröge (slomo) 2016-11-30 08:34:43 UTC
There is no conversion at all happening here, it's all passthrough.

Please run with

> GST_DEBUG=3,audioconvert:6,audio-converter:6 gst-launch-1.0 -v playbin uri=file:///path/to/file

and give the output
Comment 8 Hains van den Bosch 2016-11-30 08:40:50 UTC
Created attachment 341032 [details]
debug log wave file.
Comment 9 Sebastian Dröge (slomo) 2016-11-30 08:51:00 UTC
This probably fixes it:

commit 1e648002782755d6ff3de7b948d89e6195924c44
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Nov 30 10:48:40 2016 +0200

    audioconvert: Don't map the input buffer in in-place mode
    
    Input and output buffer are the same, let's not do unnecessary work.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775369

commit 71e819ae7dafb0077179ae7fa7a014c464811687
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Nov 30 10:43:50 2016 +0200

    audio-converter: In passthrough, also don't copy if in and out block are the same
    
    In and out array are usually different, they are stack allocated arrays.
    However the blocks inside them still can be the same.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775369

commit 1631a3864024a4a8b137b24906e2d76b94f2f47d
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Nov 30 10:36:14 2016 +0200

    audioconvert: Don't call transform_ip() in passthrough mode
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775369


But nonetheless there is a problem here. There should be no distortion, there should be no effect at all on the audio even if we run it through the transform. That it is distorted suggests that the converter_passthrough() function is wrong, however here it is called with in==out and does absolutely nothing then. It just calls a memcpy(), which suggests that something is wrong with your libc or your hardware.
Comment 10 Tim-Philipp Müller 2016-11-30 08:57:17 UTC
> here it is called with in==out and does absolutely nothing then.
> It just calls a memcpy(), which suggests that something is wrong
> with your libc or your hardware.

Just to be sure - does it call memcpy with src=dest pointers? memcpy semantics do not allow for the src and dest regions to overlap.
Comment 11 Hains van den Bosch 2016-11-30 09:12:55 UTC
Now ok. Thanks.
Comment 12 Sebastian Dröge (slomo) 2016-11-30 09:14:58 UTC
(In reply to Tim-Philipp Müller from comment #10)
> > here it is called with in==out and does absolutely nothing then.
> > It just calls a memcpy(), which suggests that something is wrong
> > with your libc or your hardware.
> 
> Just to be sure - does it call memcpy with src=dest pointers? memcpy
> semantics do not allow for the src and dest regions to overlap.

Indeed