Failure Trying to Support APE at JRiver

Started by Matt Ashland,

Matt Ashland

Hi there. I'm the author of Monkey's Audio. I work at JRiver where we wanted to add APE support to iOS using libbass. Unfortunately it just didn't work for us. The plugin doesn't support StreamCreateURL() function. I'm wondering if you can help in any way? You can reach me directly at mail at monkeysaudio.com if you prefer. Thanks.

Ian @ un4seen

Hi Matt. I did a quick test with the BASSAPE add-on here and it seemed to be working fine, using either BASS_APE_StreamCreateURL or the plugin system (BASS_PluginLoad("bassape") and BASS_StreamCreateURL). To narrow down what's going wrong there, please check the error code with BASS_ErrorGetCode. If you're having the problem with a particular file, please provide that too. It can be uploaded here:

    ftp://ftp.un4seen.com/incoming/

Also confirm that you're using the latest versions of BASS and BASSAPE, and if not, try upgrading to see if that helps (my test was with the latest versions).

Matt Ashland

Thanks for replying!

Craig is the person working on it at JRiver. He said this:

"Tell him we are using it from .NET (Xamarin iOS).  BASS_APE_StreamCreateURL() does not exist in the .NET wrapper (Bass.Net 2.4.18) and BASS_PluginLoad("bassape") fails."

radio42

#3
I just double checked and the 'funny' thing is, that Bass.Net still has support for the MaresWeb version of the APE add-on, i.e. the "bass_ape.dll" (which never had support for StreamCreateURL) !
Note the underscore in the fiename!

I now see, that Ian natively supports APE thru "bassape.dll" (I somehow must have missed this change and nobody seems to have really used it, or also still use the 'bass_ape' version instead of 'bassape')...

So there are two different add-ons?! @Ian when was this change?

Regardless, I will now change Bass.Net to support bassape instead of bass_ape and provide a new bass version... (funny, that my bass_ape.dll file is even newer than Ian's version)?

However, when using BASS_PluginLoad() it should anyhow work, as this loads an add-on independent from what Bass.Net uses for the native APE functions...but you should provide the correct filename i.e. including a file extension.

Can you check, what error code you get? Do you maybe also still use the bass_ape version?

radio42

#4
I updated Bass.Net 2.4.18.2!
The new version now uses bassape (instead of bass_ape) as the add-on module reference. And also supports StreamCreateURL natively in the API.

Full Install:
www.un4seen.com/filez/4/Bass24.Net.zip

NuGet Package (.Net core only):
https://www.nuget.org/packages/Un4seen.Bass/

Ian @ un4seen

Quote from: Matt AshlandBASS_PluginLoad("bassape") fails

Please confirm that you're including the bassape.xcframework in your app, and if BASS_PluginLoad is still failing, check the error code with BASS_ErrorGetCode.

Quote from: radio42I just double checked and the 'funny' thing is, that Bass.Net still has support for the MaresWeb version of the APE add-on, i.e. the "bass_ape.dll" (which never had support for StreamCreateURL) !
Note the underscore in the fiename!

I now see, that Ian natively supports APE thru "bassape.dll" (I somehow must have missed this change and nobody seems to have really used it, or also still use the 'bass_ape' version instead of 'bassape')...

So there are two different add-ons?! @Ian when was this change?

Yeah, the old BASS_APE add-on didn't include a BASS_APE_StreamCreateURL function. It was replaced in 2022 by a new BASSAPE add-on, based on a newer version of the Monkey's Audio SDK, which also added a BASS_APE_StreamCreateURL function. I would think most people use it via the plugin system, so they wouldn't be affected if BASS.Net was still referring to the old add-on for the direct functions. Good to have the new one supported now anyway :)

Quote from: radio42However, when using BASS_PluginLoad() it should anyhow work, as this loads an add-on independent from what Bass.Net uses for the native APE functions...but you should provide the correct filename i.e. including a file extension.

It is actually possible now (since BASS 2.4.17) to just use the add-on name (eg. "bassape") in BASS_PluginLoad calls, allowing the same call to be used on all platforms.

Craig

We are actually using the old static library version of libbass, so that is why the BASS_PluginLoad is failing with BASS_ERROR_FILEOPEN.

The Bass.Net Nuget package is not compatible with our Xamarin iOS project.  Is there any way to get this to work with the static libs and old Bass.Net.iOS.dll wrapper?

Thanks.

Ian @ un4seen

For consistency with the other platforms, the iOS BASS and add-on libraries are no longer in static form (as Apple stopped requiring them to be). Old static libraries can actually still be loaded with BASS_PluginLoad's BASS_PLUGIN_PROC option, but I'm not sure how usable that option is in .Net, and you may as well update to the latest dynamic versions instead. You can get them from the BASS page.

I'm not a .Net user myself, so not very familiar with Nuget, but what (if any) error messages do you see when trying to use the BASS.Net package? Perhaps you can use the files in the ZIP package (posted above) instead?

Craig

Only the BASS_PluginLoad() with filename is available from the .NET wrapper so I don't think there is any way to load it with the other mechanism, BASS_PLUGIN_PROC.

Unfortunately, updating to the dynamic libraries would require updating the entire app (currently uses Xamarin iOS v1.0) which would be a big job that we don't necessarily want to take on at this point.

Ian @ un4seen

Does Xamarin iOS v1.0 only support static libraries, and that's why you can't upgrade the BASS libraries? If so, here's the last BASSAPE release that was a static library:

    www.un4seen.com/stuff/bassape24-ios-static.zip

Craig

That's right.  Is there any way that the old Bass.Net.iOS.dll wrapper can be updated to use the BASSAPE plugin with the StreamCreateURL() function or is that not feasible?  Thanks.

Craig

I meant updating the wrapper to use the BASSAPE static library you posted above if that is not clear.

Ian @ un4seen

#12
Are you currently loading any other add-ons via BASS_PluginLoad? If so, perhaps you can do the same with BASSAPE? If that doesn't work then I think you can import the BASS_APE_StreamCreateURL function (without needing a BASS.Net update) something like this:

[DllImport("__Internal")]
public static extern int BASS_APE_StreamCreateURL(string url, int offset, BASSFlag flags, DOWNLOADPROC proc, IntPtr user);

Here's an old post where another user describes doing similar for another add-on:

   www.un4seen.com/forum/?msg=121187

Craig

I am getting build errors when trying to use the BASSAPE static library that you shared.

Undefined symbols:
APE::CAPECharacterHelper::GetUTF8FromUTF16(wchar_t const*), referenced from:
l067 in libbassape.a[x86_64][2](libbassape.a-x86_64-master.o)

Is there an older release that might not have this problem?

Matt Ashland

The name of GetUTF8FromUTF16 changed to GetUTF8FromUTFN because Linux sometimes uses UTF32 instead of UTF16 and I wanted to be clean. Sorry to make more work for anybody!

Ian @ un4seen

#15
Here's a rebuild of the current BASSAPE release as a static library for you to try:

    www.un4seen.com/stuff/bassape-ios-static.zip

I haven't tried using it myself, but I did check that GetUTF8FromUTF16 isn't referenced at least :)

edit: I've tried it now and it seems to be working fine.

radio42

I guess updating to the latest dynamic libraries (i.e. updating your app) is more future prove. As it is almost impossible to support all different versions. Unfortunately I can not support the old Bass.Net.iOS.dll version any longer (it was build years ago), as my IDE doesn't support those older SDK models anymore.

Craig

Quote from: Ian @ un4seenHere's a rebuild of the current BASSAPE release as a static library for you to try:

Success!  Thanks so much to both of you for your help.