Author Topic: Playback for Icecast2 64 bit does not work  (Read 263 times)

Marcio

  • Guest
Playback for Icecast2 64 bit does not work
« on: 27 Sep '22 - 11:19 »
In "Embarcadero® Delphi 11.0 Professional" I cannot play the stream from Icecast2 (https://sluchaj.link:5443/plonsk). For Android 32-bit it works fine but for Android 64-bit it does not work. I tried the libraries from the home page (2.4.16.7) and the BETA version (2.4.16.26).
Kind Regards.

Chris

  • Posts: 2092
Re: Playback for Icecast2 64 bit does not work
« Reply #1 on: 27 Sep '22 - 12:52 »
Hi, you must use the 64Bit Libs. (In the Folder x64)

Marcio

  • Guest

Marcio

  • Guest
That's what I have :)
https://www.marmedia.net.pl/tmp/lib.jpg
I would like to add that ShoutCAST works perfectly in both 32 bit and 64 bit versions.

Ian @ un4seen

  • Administrator
  • Posts: 24726
Re: Playback for Icecast2 64 bit does not work
« Reply #4 on: 27 Sep '22 - 14:27 »
After BASS_StreamCreateURL fails (returns 0), please check the error code with BASS_ErrorGetCode. I suspect that may be BASS_ERROR_SSL. In which case, adding the BASS_SSL libraries to your app should fix the problem. BASS will otherwise try to use Android's OpenSSL library by default but that isn't possible if you target Android 7 or above. You can also provide your own OpenSSL library - see the BASS_CONFIG_LIBSSL documentation for details.

Marcio

  • Guest
Re: Playback for Icecast2 64 bit does not work
« Reply #5 on: 27 Sep '22 - 15:28 »
Thanks a lot for your quick reply.
BASS_ErrorGetCode shows error number 2 (BASS_ERROR_FILEOPEN).
I am using openssl in the same application for sending e-mail via SSL/TLS and I have this library (libssl.so) in the same directory where is (libbass.so).
Why does it work fine on 32-bit and not on 64-bit?

Marcio

  • Guest
Re: Playback for Icecast2 64 bit does not work
« Reply #6 on: 27 Sep '22 - 15:53 »
I would like to add that I do not use the latest delphi\bass.pas because it shows an error when compiling:
[DCC Error] E2597 C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidNDK-21-22.0.42600.6491\android-ndk-r21\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\aarch64-linux-android\bin\ld.exe: cannot find -lbass
[DCC Fatal Error] F2588 Linker error code: 1 ($00000001)
Failed

Marcio

  • Guest
Re: Playback for Icecast2 64 bit does not work
« Reply #7 on: 27 Sep '22 - 16:07 »
Please tell me where I can download BASS_SSL libraries for Android.

Ian @ un4seen

  • Administrator
  • Posts: 24726
Re: Playback for Icecast2 64 bit does not work
« Reply #8 on: 27 Sep '22 - 16:22 »
BASS_ErrorGetCode shows error number 2 (BASS_ERROR_FILEOPEN).
I am using openssl in the same application for sending e-mail via SSL/TLS and I have this library (libssl.so) in the same directory where is (libbass.so).
Why does it work fine on 32-bit and not on 64-bit?

Did you tell BASS to use your OpenSSL library via the BASS_CONFIG_LIBSSL option? If not, please try that:

Code: [Select]
BASS_SetConfigPtr(BASS_CONFIG_LIBSSL, yourlibssl);

Regarding why 32-bit might work and not 64-bit, check that your app includes 64-bit versions of all used libraries, ie. the APK's "lib/armeabi-v7a" and "lib/arm64-v8a" folders contain identical filenames.

I would like to add that I do not use the latest delphi\bass.pas because it shows an error when compiling:
[DCC Error] E2597 C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidNDK-21-22.0.42600.6491\android-ndk-r21\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\aarch64-linux-android\bin\ld.exe: cannot find -lbass
[DCC Fatal Error] F2588 Linker error code: 1 ($00000001)
Failed

That's a linking error, so it seems strange that it would be related to the BASS.PAS file. What BASS.PAS file you are currently using instead to prevent the error?

Please tell me where I can download BASS_SSL libraries for Android.

BASS_SSL is available from the "Add-ons" section of the BASS webpage.

Marcio

  • Guest
Re: Playback for Icecast2 64 bit does not work
« Reply #9 on: 27 Sep '22 - 17:29 »
I am currently using this file:
https://www.marmedia.net.pl/tmp/FMX.Radio.Bass.pas
How do I replace this with this one:
https://www.marmedia.net.pl/tmp/bass.pas
I have the error I wrote about.

Marcio

  • Guest
Re: Playback for Icecast2 64 bit does not work
« Reply #10 on: 27 Sep '22 - 17:41 »
Regarding why 32-bit might work and not 64-bit, check that your app includes 64-bit versions of all used libraries, ie. the APK's "lib/armeabi-v7a" and "lib/arm64-v8a" folders contain identical filenames.
Yes, the names of all files are identical and each in the correct directory:
library\lib\arm64-v8a\libssl.so
library\lib\armeabi-v7a\libssl.so
I added libbass_ssl.so and everything works perfect!
Thank you very much for such quick and professional help :)
Only see if you can spare a bit more time why the latest bass.pas file doesn't work for me.

Marcio

  • Guest
Re: Playback for Icecast2 64 bit does not work
« Reply #11 on: 27 Sep '22 - 17:52 »
I am currently using this file:
https://www.marmedia.net.pl/tmp/FMX.Radio.Bass.pas
How do I replace this with this one:
https://www.marmedia.net.pl/tmp/bass.pas
I have the error I wrote about.
For Windows it compiles correctly, only for Android shows this error.

Ian @ un4seen

  • Administrator
  • Posts: 24726
Re: Playback for Icecast2 64 bit does not work
« Reply #12 on: 28 Sep '22 - 14:02 »
I am currently using this file:
https://www.marmedia.net.pl/tmp/FMX.Radio.Bass.pas
How do I replace this with this one:
https://www.marmedia.net.pl/tmp/bass.pas
I have the error I wrote about.

Oh right, you're using the dynamic loading BASS.PAS version, which dynamically loads the BASS library at runtime rather than linking with it.

It looks like the issue when using the standard BASS.PAS is that the linker can't find the BASS libraries to link into your app. I'm not a Delphi user myself, so I'm afraid I'm unfamiliar with how to set that up, but I guess there's either an option to tell it where to look for native libraries (like BASS) or a standard location for them?

Chris

  • Posts: 2092

Ian @ un4seen

  • Administrator
  • Posts: 24726
Re: Playback for Icecast2 64 bit does not work
« Reply #14 on: 30 Sep '22 - 15:09 »
It looks like that one is dynamically loading the BASS library at runtime too, and is actually based on an older BASS.PAS file (so missing some stuff). I guess there must be some way to have Delphi find and link the libraries instead?