Draft: little-endian support
This MR attempts to add support for powerpc64, a little-endian architecture.
These changes are based on work by Manuel Virgilio, here, which I am attempting to rebase:
https://gitlab.com/power-progress-community/oshw-powerpc-notebook/software/freedesktop-sdk-dep/webrtc-audio-processing/-/compare/9def8cf10d3c97640d32f1328535e881288f700f...337fce6ec1dfe3e4877ddc4b42fecd0d8ed7d7fb
The above changes are based on v0.3.1
and are included as patches in the proposed powerpc64 port of freedesktop-sdk: https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/merge_requests/4738
This MR attempts to rebase the changes on latest webrtc-audio-processing
and submit them upstream of freedesktop-sdk
.
In rebasing the changes I found:
-
wav_header.cc
has changed and no longer uses functions likeWriteLE32
. So I removed those functions, and the rebased commit "Added wav_header be-to-le conversion functions" is smaller than the original one. I am unsure if there are other places now where conversion is needed instead. - In
wav_file.cc
, WavWriter now can handle floats. I am not sure the correct way to do the byte swapping in this case. I have added my best guess, but could use some review of this.
Other issues:
- How to test this package and these changes, other than compilation? I only have remote access (no sound) to a powerpc64 system. I do have physical access to a powerpc32 machine - though I suspect a lot more changes will be needed for that.
- I get the below linker error.
/home/cel/.local/lib/libabsl_strings.a(string_view.cc.o): in function `absl::lts_20210324::string_view::find_first_of(char, unsigned long) const':
string_view.cc:(.text._ZNK4absl12lts_2021032411string_view13find_first_ofEcm[_ZNK4absl12lts_2021032411string_view13find_first_ofEcm]+0x34): call to `absl::lts_20210324::string_view::find(char, unsigned long) const' lacks nop, can't restore toc; (plt call stub)
This is with abseil-cpp 20210324.0.
$ uname -a
Linux gcc203 5.10.0-1-powerpc64 #1 SMP Debian 5.10.4-1 (2020-12-31) ppc64 GNU/Linux