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 678021 - The IEC 61937 payloader only supports bigendian output
The IEC 61937 payloader only supports bigendian output
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.x
Other All
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-06-13 14:08 UTC by Josep Torra Valles
Modified: 2015-02-15 15:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
audio: Explicitly specify endianness for IEC 61937 payloading (3.81 KB, patch)
2012-09-19 03:45 UTC, Arun Raghavan
committed Details | Review
pulsesink: Specify endianness in IEC 61937 payloading (1006 bytes, patch)
2012-09-19 03:48 UTC, Arun Raghavan
committed Details | Review
directsoundsink: Specify endianness in IEC 61937 payloading (1.06 KB, patch)
2012-09-19 03:49 UTC, Arun Raghavan
committed Details | Review
osxaudiosink: Specify endianness in IEC 61937 payloading (1.21 KB, patch)
2012-09-19 03:49 UTC, Arun Raghavan
committed Details | Review

Description Josep Torra Valles 2012-06-13 14:08:11 UTC
In order to add support for SPDIF output with directsoundsink and osxaudiosink it is required to use the IEC 61937 payloader in -base.

That payloader is only able to generate a bigendian version of the payloaded data and it doesn't match with the requirements for directsound and CoreAudio.

For directsound is exepcted to provide data in the native endianess.
For CoreAudio it could be big or little endian depending on the hardware and the api has to queried on that.

The current workaround is to swap bytes again after payloading.

As an example the VLC payloader support both S16LE and S16BE formats for payloading.

That means we should have a way to instruct the payloader in which format should the payloaded data be provided.

As we discussed at #gstreamer the less intrussive (not breaking API or behaviour) would be change the payloader to honour the bigend flag in the spec.

Also change the caps parser to set spec->bigend = TRUE for the compressed formats and keep the current default behaviour.

Having this change in place would allow osxaudiosink and directsoundsink to specify in which endianess data has to be payloaded.
Comment 1 Sebastian Dröge (slomo) 2012-06-14 07:52:50 UTC
Actually the behaviour of the payloader is even more weird. On big endian systems it keeps the endianness, and on little endian systems it swaps the endianness. So you always get inverse-endianness on little endian systems (not necessarily big endian as I understand it as the stream itself can have any endianness) and stream-endianness on big endian systems.

This should be looked at too, it looks weird.
Comment 2 Arun Raghavan 2012-09-19 03:45:21 UTC
Created attachment 224690 [details] [review]
audio: Explicitly specify endianness for IEC 61937 payloading

This is required since some systems (DirectSound and OS X) manage the
final byte order themselves.
Comment 3 Arun Raghavan 2012-09-19 03:48:45 UTC
Created attachment 224691 [details] [review]
pulsesink: Specify endianness in IEC 61937 payloading

Corresponds to an API change in gst-plugins-base.
Comment 4 Arun Raghavan 2012-09-19 03:49:00 UTC
Created attachment 224692 [details] [review]
directsoundsink: Specify endianness in IEC 61937 payloading

DirectSound expects native endian byte order.
Comment 5 Arun Raghavan 2012-09-19 03:49:04 UTC
Created attachment 224693 [details] [review]
osxaudiosink: Specify endianness in IEC 61937 payloading

Corresponds to an API change in gst-plugins-base. This needs to be fixed
to query the expected byte order using appropriate API.
Comment 6 Sebastian Dröge (slomo) 2012-09-19 07:20:12 UTC
Looks good to me :)
Comment 7 Tim-Philipp Müller 2012-09-19 13:19:39 UTC
Comment on attachment 224690 [details] [review]
audio: Explicitly specify endianness for IEC 61937 payloading

Please push these
Comment 8 Arun Raghavan 2012-09-19 13:51:05 UTC
Comment on attachment 224690 [details] [review]
audio: Explicitly specify endianness for IEC 61937 payloading

Attachment 224690 [details] pushed as 9f97187 - audio: Explicitly specify endianness for IEC 61937 payloading
Comment 9 Arun Raghavan 2012-09-19 13:51:47 UTC
Attachment 224691 [details] pushed as f46475e - pulsesink: Specify endianness in IEC 61937 payloading
Attachment 224692 [details] pushed as 333d568 - directsoundsink: Specify endianness in IEC 61937 payloading
Attachment 224693 [details] pushed as c9821d3 - osxaudiosink: Specify endianness in IEC 61937 payloading
Comment 10 Arun Raghavan 2012-09-19 13:55:16 UTC
Reopening, since I'd like to fix this in 0.10 as well.