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 739446 - audiosink, audiosrc: fix silence for unsigned pcm formats
audiosink, audiosrc: fix silence for unsigned pcm formats
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-31 11:30 UTC by Thomas Roos
Modified: 2015-01-21 11:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstreamer silence fix (3.79 KB, patch)
2014-10-31 11:31 UTC, Thomas Roos
needs-work Details | Review
fills in correct silence when ring buffer is acquired AND allows to use 8Bit samples with ALSA devices (1.27 KB, patch)
2014-11-06 13:23 UTC, Thomas Roos
needs-work Details | Review
allow to use 8Bit samples with ALSA devices (836 bytes, patch)
2015-01-21 07:50 UTC, Thomas Roos
committed Details | Review
fills in correct silence when ring buffer is acquired (1.06 KB, patch)
2015-01-21 07:51 UTC, Thomas Roos
committed Details | Review

Description Thomas Roos 2014-10-31 11:30:47 UTC
silence allocation patch - current Implementation is wrong
-> there are audio devices where 0 doesn't mean silence...
Comment 1 Thomas Roos 2014-10-31 11:31:37 UTC
Created attachment 289723 [details] [review]
gstreamer silence fix
Comment 2 Sebastian Dröge (slomo) 2014-11-06 10:56:20 UTC
For raw U8 samples, silence is 0x80. For S8 it is 0x00. That's independent of the actual audio device and just a property of those sample formats.

What hardware are you running on and with which caps, and what's the actual problem?
Comment 3 Thomas Roos 2014-11-06 13:23:25 UTC
Created attachment 290101 [details] [review]
fills in correct silence when ring buffer is acquired AND allows to use 8Bit samples with ALSA devices

sorry for the first version - there were to much hardware specific patches
Comment 4 Sebastian Dröge (slomo) 2014-11-06 13:35:38 UTC
Review of attachment 290101 [details] [review]:

Please attach the patch(es) in "git format-patch" format :)

::: ext/alsa/gstalsa.c
@@ +150,3 @@
   finfo = gst_audio_format_get_info (format);
 
+  if ((GST_AUDIO_FORMAT_INFO_ENDIANNESS (finfo) != endianness) && (GST_AUDIO_FORMAT_INFO_ENDIANNESS (finfo) != 0))

Why? Also please split the alsa specific part into a separate patch :)

::: gst-libs/gst/audio/gstaudiosink.c
@@ +416,2 @@
   buf->size = spec->segtotal * spec->segsize;
+#if 0

This part makes sense, but please just remove the old code instead of commenting it out
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2015-01-20 10:40:28 UTC
Thomas, can you please update the patch?
Comment 6 Thomas Roos 2015-01-21 07:50:04 UTC
Created attachment 295071 [details] [review]
allow to use 8Bit samples with ALSA devices
Comment 7 Thomas Roos 2015-01-21 07:51:18 UTC
Created attachment 295073 [details] [review]
fills in correct silence when ring buffer is acquired
Comment 8 Sebastian Dröge (slomo) 2015-01-21 08:38:02 UTC
commit e63ad51dabc0404da2a4dd06e4bc1efddc1dbaf8
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Jan 21 09:37:30 2015 +0100

    audiosrc: Fill in the correct silence
    
    For unsigned raw formats this is not all zeroes, and for non-raw formats
    we just continue to assume all zeroes for now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739446

commit f0f854d501847ce205b85eea0d0cb544875189f2
Author: Thomas Roos <thomas.roos@industronic.de>
Date:   Wed Jan 21 08:47:26 2015 +0100

    audiosink: Fill in the correct silence
    
    For unsigned raw formats this is not all zeroes, and for non-raw formats
    we just continue to assume all zeroes for now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739446
Comment 9 Sebastian Dröge (slomo) 2015-01-21 08:43:20 UTC
commit 485ad66a118c062e3c9ba24bb83d717d38a1f598
Author: Thomas Roos <thomas.roos@industronic.de>
Date:   Wed Jan 21 08:33:57 2015 +0100

    alsa: Allow to use 8 bit samples with ALSA
    
    8 bit samples have no (0) as endianness, not the native endianness.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739446