sjoerdvankreel / xt-audio

Platform independent low-latency audio for C, C++, Java and .NET.
https://sjoerdvankreel.github.io/xt-audio/
Other
64 stars 12 forks source link

Support for ARM / ARM64 #6

Closed profix898 closed 2 years ago

profix898 commented 3 years ago

I have tested xt-audio on both win-x64 and linux-x64 and it works great. Its a pleasure to use, with nice and clean API.

However, I'm looking to move a project with xt-audio to Linux on ARM. Many embedded systems, including mobile platforms (iOS, Android) and the Raspberry Pis (and similar boards) typically run linux-arm or linux-arm64. In my particular case, I'd like to move to the Raspberry Pi 4.

Is it possible to add support for ARM/ARM64 to the library?

sjoerdvankreel commented 3 years ago

Hi, thanks for the nice words. I actually tried an ARM port a couple of years ago, targeting the android ndk with opensl. Abandoned it because i felt at the time that opensl and low-latency or any sort of serious audio beyond playback of prerecorded media where mutually exclusive. I did get a clean compile though. However (correct me if i'm wrong) raspberry runs an actual linux variant, right? If so, it should support at least ALSA, and an ARM port could be as simple as doing a cross-compile with gcc. I'd be more than happy to work with you on this but I can't do it by myself seeing as I don't own any ARM device (apart from my phone probably but then it's opensl again, or another backend that needs to be reimplemented from scratch). So just to be clear, ARM support in itself should be easy (but i'd need your help for testing), but only if the target is "regular" linux with ALSA, not android/ios and the likes.

-Regards, Sjoerd

Op do 19 nov. 2020 om 10:46 schreef Thilo Viereck <notifications@github.com

:

I have tested xt-audio on both win-x64 and linux-x64 and it works great. Its a pleasure to use, with nice and clean API.

However, I'm looking to move a project with xt-audio to Linux on ARM. Many embedded systems, including mobile platforms (iOS, Android) and the Raspberry Pis (and similar boards) typically run linux-arm or linux-arm64. In my particular case, I'd like to move to the Raspberry Pi 4.

Is it possible to add support for ARM/ARM64 to the library?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sjoerdvankreel/xt-audio/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUGL7KPYKHF7OXPBEH44STSQTSOJANCNFSM4T3E7UAQ .

profix898 commented 3 years ago

I actually tried an ARM port a couple of years ago, targeting the android ndk with opensl.

Well, I mentioned Android/iOS, because from my point of view they were key to make ARM popular as a mobile/embedded device platform. I'm by no means looking for a specialized audio/sound library on Android.

However (correct me if i'm wrong) raspberry runs an actual linux variant, right? If so, it should support at least ALSA, and an ARM port could be as simple as doing a cross-compile with gcc.

Absolutely! Rasperry Pi runs a 'full' server/desktop version of Linux, including ALSA support. So yes, I imagine that supporting xt-audio on these platforms would essentially mean cross-compiling the project.

I dont know whether there are any significant differences in the ALSA or JACK implementations for different distributions (say Debian vs Ubuntu), though? But I wrote some prototyp code using PortAudio yesterday which seems to suggest that it can actually work pretty well.

If you could try compiling the existing xt-audio for ARM and ARM64, I could definitely help you to test for success on Raspeberry Pi.

sjoerdvankreel commented 3 years ago

Hey there! This turns out to be more involved than i hoped for. I set up a cross compiling toolchain as described here: https://askubuntu.com/questions/250696/how-to-cross-compile-for-arm using x64 ubuntu as the host and targeting arm64. Although xtaudio itself compiles fine, the linker errors out on asound (ALSA). (Btw i disabled PulseAudio and JACK support just to try to keep it simple). Then i tried getting my hands on any variant of libasound(2)-dev for arm but to no avail. APT keeps complaining it cant find anything i throw at it such as libasound-dev:armhf as described here: https://stackoverflow.com/questions/57037550/alsa-linking-when-cross-compiling-rust-program-for-arm . Do you by any chance have the required packages on your raspberry so you could send them to me? Or even better, point me in the right direction w.r.t. the packages i'd need to install :)

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Op za 21 nov. 2020 om 16:19 schreef Thilo Viereck <notifications@github.com

:

I actually tried an ARM port a couple of years ago, targeting the android ndk with opensl.

Well, I mentioned Android/iOS, because from my point of view they were key to make ARM popular as a mobile/embedded device platform. I'm by no means looking for a specialized audio/sound library on Android.

However (correct me if i'm wrong) raspberry runs an actual linux variant, right? If so, it should support at least ALSA, and an ARM port could be as simple as doing a cross-compile with gcc.

Absolutely! Rasperry Pi runs a 'full' server/desktop version of Linux, including ALSA support. So yes, I imagine that supporting xt-audio on these platforms would essentially mean cross-compiling the project.

I dont know whether there are any significant differences in the ALSA or JACK implementations for different distributions (say Debian vs Ubuntu), though? But I wrote some prototyp code using PortAudio yesterday which seems to suggest that it can actually work pretty well.

If you could try compiling the existing xt-audio for ARM and ARM64, I could definitely help you to test for success on Raspeberry Pi.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sjoerdvankreel/xt-audio/issues/6#issuecomment-731592868, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUGL7KOE7R6LBKAUPIP6FDSQ7K6HANCNFSM4T3E7UAQ .

Gusi commented 3 years ago

I can confirm that it builds and works on a Raspberry Pi 4 (ARM 32 bits DietPi OS) with ALSA. I haven't tested with Pulse or Jack support.

sjoerdvankreel commented 3 years ago

Good to know, thanks! I've been playing around with qemu but no luck so far. Leaving this open as i really want to support arm someday.

sjoerdvankreel commented 2 years ago

Closing, haven't found the time in over a year and i don't expect to anytime soon, either.