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 614317 - [oss4] should always accept PCM in native endianness even if the hardware doesn't
[oss4] should always accept PCM in native endianness even if the hardware doe...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Solaris
: Normal normal
: 0.10.19
Assigned To: Tim-Philipp Müller
GStreamer Maintainers
Depends on:
Blocks: 614305
 
 
Reported: 2010-03-30 03:59 UTC by Brian Cameron
Modified: 2010-04-08 09:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch fixing problem (967 bytes, patch)
2010-03-30 03:59 UTC, Brian Cameron
none Details | Review
oss4: also accept formats not natively supported (2.61 KB, patch)
2010-03-30 11:16 UTC, Tim-Philipp Müller
committed Details | Review

Description Brian Cameron 2010-03-30 03:59:44 UTC
Created attachment 157442 [details] [review]
patch fixing problem

Jan Schmidt did the following analysis about this bug:

I did some investigating. What I discovered is:

* audiotestsrc and audioresample operate on native-endian samples only -
  ie big-endian on SPARC.
* audioconvert supports both big endian and little endian samples
* oss4sink on this machine supports *only* 16-bit little-endian samples.

This means that the pipeline cannot work, because audioresample and
oss4sink support no common format - one is big endian, and the other is
little. In that case, negotiation (correctly) fails.

The pipeline 'audiotestsrc ! audioconvert ! audioresample !
audioconvert ! oss4sink' does work fine, because the extra audioconvert
provides the big-endian to little-endian sample conversion.

I'm not sure what the best solution is here. Options include:
* Enhance audioresample to also be able to operate on
non-native-endianness sample formats. This probably doesn't help
playbin, because it's also inserting a 'volume' element - which also
only supports native-endianness.
* Extend OSSv4 to support sample format conversion internally.
* Add an extra audioconvert into pipelines like the one playbin builds
to ensure negotiation can happen.

The attached patch fixes the problem by enhancing the OSS plugin to handle endian conversion internally.

More information is here:

http://defect.opensolaris.org/bz/show_bug.cgi?id=9375
Comment 1 Brian Cameron 2010-03-30 04:01:10 UTC
In my review of the OSS code we are using and the latest upstream code, this is the only change we have applied that is not yet upstream.
Comment 2 Tim-Philipp Müller 2010-03-30 11:16:14 UTC
Created attachment 157469 [details] [review]
oss4: also accept formats not natively supported 

I think it's reasonable to expect that an audiosink supports PCM in native endianness, and if playbin doesn't get this stuff right, no other application will, so I agree that oss4sink is the right place to fix this.

However, I actually had to read through the Sun bug report to make sense of this patch, so I propose an alternative patch with a few more comments. It should (hopefully) do the same thing, but I haven't had a chance to test it yet. Would be great if you could test it and confirm it does the right thing.
Comment 3 Jerry Tan 2010-04-08 09:05:24 UTC
Thanks, Tim.
I have verified your patch, it works on my sparc.

with gstreamer 0.10.25.
Comment 4 Tim-Philipp Müller 2010-04-08 09:19:52 UTC
Great, thanks for testing. Committed this then:


commit cd4099db89ff4b2ebbb3329a643a2a8a1ef0db05
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Tue Mar 30 11:43:04 2010 +0100

    oss4: also accept formats not natively supported
    
    Also accept formats that are not natively supported by the
    hardware, OSS4 can convert them internally. List the native
    formats first in the caps though, to express our preference
    for the native formats. We need this in order to support the
    case properly where the audio hardware supports only e.g.
    little endian PCM, but the host is big endian, since many
    audio elements only support native endianness and make the
    reasonable assumption that any audiosink will be able to
    handle audio in native endianness.
    
    Based on patch by Jerry Tan <jerry.tan@sun.com>
    
    Fixes #614317.