BASS for ARM64 Windows

Started by Ian @ un4seen,

Ian @ un4seen

Some more ARM64X builds are now available:

    www.un4seen.com/stuff/bass-arm64x.zip

The current plan is for ARM64X builds to eventually replace the plain ARM64 builds (in the 1st post), probably at the next BASS release. Note this BASS build is the latest beta rather than the current release version. BASS_VST is also the latest beta (there isn't currently any ARM64 release), but the others do match the release versions.

BASSASIO isn't currently available for ARM64. It needs some ARM64-specific code added (and probably some ARM64EC-specific code now too) for multi-device support. If your app is ARM64EC, you can use the x64 build for now.

Let me know if you encounter any problems with this stuff.

3delite

Thank you very much for the new DLLs!

Copied all to the program folder, so only BASSASIO.dll is Win64.
Double-clicking on the .exe the mouse pointer starts to circle and flickers every 3 seconds for 15 seconds and then the app. appears.
Initializing a WASAPI output device takes 3 seconds.
Exiting the app., the same 15 seconds delay happens, with the same mouse pointer flickering.
Narrowed the issue to bassenc_flac.dll. If I copy the last official Win64 version of bassenc_flac.dll into the folder, it seems completely fine: app. appears instantly, WASAPI init is instant and also the exit.

Please let me know if I can help with this!

Ian @ un4seen

That's strange. BASSenc_FLAC doesn't really have any initialization code, so I'm now sure how/why it would be delaying the app's start. Does the delay still happen if you use the x64 version of all other DLLs (not only BASSASIO)?

If you run your app in the debugger with a breakpoint on the first line, is the delay before or after that?

3delite

Tried all BASS DLLs Win64 only, bassenc_flac.dll WinARM64: same issue.

I'll try the breakpoint test (it is a bit more work, setting up a Delphi PAServer and connecting to it on the ARM notebook), and I create a simple test app. to just check this issue (maybe my other DLLs cause this!? Not sure.).

3delite

Tried a simple test app.: if using the WinARM64 bassenc_flac.dll startup is like 3 seconds. I had to add bassenc.dll and bass.dll for this. Also tried adding all the BASS DLLs, just for sure (and loading them all).
When I remove the reference in the app. and also delete bassenc_flac.dll (and keep all the references to other BASS DLLs) the test app. starts instantly.

Started the breakpoint test and immediatelly got an error, this was the first try to run in debug mode: "Illegal instruction" BASS_Encode_Flac_NewStream() Not sure why this is called, did a search in the folder this string does not exists in my code.
The test app. gives the same error.
Attached 2 snapshots.

Ian @ un4seen

When you say "WinARM64 bassenc_flac.dll", do you mean the ARM64X build or the plain ARM64 build in the first post?

To perhaps narrow down what/where the problem is, here are ARM64 and ARM64EC builds of the BASSenc SERVER example for you to try. Please try both with the ARM64X DLLs, and see if either of them are delayed like your test app. You could also try running them under the debugger and see if it catches an illegal instruction again. If you do get the delay with the ARM64 version, please also try it with the ARM64 DLLs in the first post.

3delite

#27
Ok! Sorry, I mean the "X" builds.

A quick test: the DLLs are all the "X" versions, "server-arm64.exe" starts instantly, "server-arm64ec.exe" the same 3 seconds delay on startup.
I'll try with debugger attached.

EDIT: Managed to start "server-arm64ec.exe" with debugger, sorry to say but the same error.
If you could provide a "bassenc_flac.pdb" debug file, maybe Delphi would report the error in more details.

Ian @ un4seen

I will email you for further info/tests.

milano88_

Hi Ian, regarding AAC on ARM64 Windows: I'm building a native ARM64 .NET app (Snapdragon X, Windows 11) with the ARM64 BASS DLLs. Live AAC (ADTS) internet streams either don't play or take 1–2 minutes to start without BASS_AAC, e.g. https://play.global.audio/nrj.aac and https://listener3.aach.tb-group.fm/tb-high.aac. The same URLs play instantly in an x86 build with bass_aac.dll. So the built-in Media Foundation path doesn't seem to handle these streams well. Could you either provide an ARM64 bass_aac.dll, or look into the Media Foundation path for ADTS streams? I can provide timings and BASS_ErrorGetCode results if useful.

Ian @ un4seen

I think that may be an issue that's already fixed in the updated BASS builds. The ARM64X package includes the latest BASS.DLL version, so please try that:

    www.un4seen.com/stuff/bass-arm64x.zip

There's also an updated (but slightly older) plain ARM64 build here:

    www.un4seen.com/stuff/bass-arm64.zip

Let me know if you still see the problem happening.

milano88_

#31
Quote from: Ian @ un4seenI think that may be an issue that's already fixed in the updated BASS builds. The ARM64X package includes the latest BASS.DLL version, so please try that:

    www.un4seen.com/stuff/bass-arm64x.zip

There's also an updated (but slightly older) plain ARM64 build here:

    www.un4seen.com/stuff/bass-arm64.zip

Let me know if you still see the problem happening.



Hi Ian,
Thanks a lot for the quick reply and for the builds!
I tested both packages on a Snapdragon X (Windows 11 ARM64) with my native ARM64 .NET app, using the same AAC (ADTS) internet streams as before (e.g. https://play.global.audio/nrj.aac and https://listener3.aach.tb-group.fm/tb-high.aac).
The original problem is fixed: both builds now open the streams instantly and start playing, with no more 1-2 minute delay. Thank you!
However, I see a new problem with both builds:
- bass-arm64x.zip (the more stable one): it connects and starts instantly, but during playback a short piece of audio (about 2-3 seconds) gets repeated: e.g. a word is spoken and then immediately repeated, and this keeps going while it plays.
- bass-arm64.zip: it connects instantly, but right after the stream starts the connection seems to drop (my app receives the end/stall sync and the channel is reported as stopped), so my reconnect logic kicks in. After reconnecting it plays, but then shows the same repeating 2-3 second behaviour.
In my app I use BASS_STREAM_AUTOFREE, BASS_CONFIG_NET_PREBUF = 1, and END and STALL syncs. I don't think the wrapper is involved (plain P/Invoke), but I'm now running a minimal test with default settings and no extra config/syncs to confirm, and will report the result. Does this behaviour ring a bell, or is there a setting you'd suggest trying?

Thanks again!



https://play.global.audio/nrj.aac
Audio: AAC 44100Hz stereo 47kbps [A: aac he-aac, 44100 Hz, stereo, 47 kb/s] - It works perfectly


https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1793653362/ei/Eaboaue7O5qbx_APvrTBsQQ/ip/2a00%3A1d34%3A568f%3A2c00%3A80e1%3Affac%3Aa4ba%3A9d1c/id/3MOrgUjiigE.3/source/yt_live_broadcast/requiressl/yes/xpc/EgVo2aDSNQ%3D%3D/hfr/1/playlist_duration/30/manifest_duration/30/maudio/1/bui/AZFAFb9-cJTh38KBmYhNh_O6ZQVrNEjsX5evGPEa73kT1abi3KKdMadBdtnebJzPE_eK_3np5KDp5-Ky/spc/mpRQ_yxdPCb9z6-s9B7kGzO6ZrzAjvhi89fiXe3n2eyE6H16mv9kF168RQ53yibS/vprv/1/go/1/rqh/5/reg/0/pacing/0/epbp/1/nvgoi/1/ncsapi/1/keepalive/yes/fexp/51565116%2C52184236%2C52271470/dover/11/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Cxpc%2Chfr%2Cplaylist_duration%2Cmanifest_duration%2Cmaudio%2Cbui%2Cspc%2Cvprv%2Cgo%2Crqh%2Creg%2Citag%2Cplaylist_type/sig/AE0s2JYwRQIgaLGe8yuFSqQ-BxTfE-vcOkAIctV7gmbut1zQDZHODuECIQDdum23TgKDT_3GvMJ8AqOn8vVos2zUFk4ZFGSHHoOo2A%3D%3D/file/index.m3u8
Audio: AAC 44100Hz stereo [A: aac lc, 44100 Hz, stereo] - The issues I mentioned ( I think the problem here is basshls.dll arm64 version)

Ian @ un4seen

Good to hear the AAC/ADTS issue is resolved.

I am able to reproduce the repeated sound issue at the start of that HLS stream here. I'll look into it and hopefully come back with an update for you to try.

milano88_

#33
Quote from: Ian @ un4seenGood to hear the AAC/ADTS issue is resolved.

I am able to reproduce the repeated sound issue at the start of that HLS stream here. I'll look into it and hopefully come back with an update for you to try.


Thanks, Ian! To narrow it down for you: the repeated audio only happens with the HLS stream (the YouTube live broadcast), and it comes from the ARM64 basshls.dll. The same bass.dll plays plain ADTS/ICY AAC streams perfectly, so the core is fine.

Ian @ un4seen

The HLS stream URL seems to be dead today - I guess it expired. Do you have another affected URL for testing? I did try another YouTube live stream myself but the problem didn't seem to happen with that one.

Ian @ un4seen

Thanks. I think it's fixed now. Here's a BASS.DLL update for you to try:

    www.un4seen.com/stuff/bass-arm64x.zip

For anyone that had trouble with BASSenc_FLAC in ARM64EC apps, a fix for that is also in this package. A BASSASIO build has also been added.

milano88_

Quote from: Ian @ un4seenThanks. I think it's fixed now. Here's a BASS.DLL update for you to try:

    www.un4seen.com/stuff/bass-arm64x.zip

For anyone that had trouble with BASSenc_FLAC in ARM64EC apps, a fix for that is also in this package. A BASSASIO build has also been added.

Yes, the issue has been completely resolved. Thank you very much for your efforts Ian.