BASS for iOS (iPhone/iPad)

Started by Ian @ un4seen, 16 Feb '10 - 16:32

Chris


promusicbisceglie

[DCC Error] E2597 ld: library not found for -lstdc++
 :'(

Chris

which sdk have you in your SETUP?
Tools|Options, Deployment > SDK Manager ?

promusicbisceglie

already sayd 14.5. The previous sdk (13.6) worked great,
don't tell me use 13.6 becouse apple now need 14.5 to publish an app... :'( :'( :'(

Ian @ un4seen

Does RAD Studio have a "Deployment Target" option? If so, what is that set to, and does lowering it help? Can you try other iOS 14 SDK versions (eg. 14.0) or is 14.5 the only version available?

The BASS_APE and TAGS add-ons also require the standard C++ library, so I guess you get the same errors if you try removing BASS_FX from your code and using either of them?

promusicbisceglie

yes i use developement target... A.Store only when i must publish..
Never used BASS_APE , can you tell me some function in .pas like this below??
eg .. function BASS_Encode_Start(handle:HSTREAM; cmdline:PChar; flags:DWORD; proc:ENCODEPROC; user:Pointer): HENCODE;cdecl; external 'libbassenc.a' name 'BASS_Encode_Start';
Actually cannot downgrade less of 14.5 (need this version of xcode)

Ian @ un4seen

Quote from: promusicbisceglie on 25 May '21 - 17:47yes i use developement target... A.Store only when i must publish..

No, I meant the "Deployment Target" setting, which sets the minimum iOS version that's required by the app. Here's what it looks like in Xcode:

   https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/WorkingwithTargets.html

Does RAD Studio have that option?

Quote from: promusicbisceglie on 25 May '21 - 17:47Never used BASS_APE , can you tell me some function in .pas like this below??

BASS_APE only has 2 functions: BASS_APE_StreamCreateFile and BASS_APE_StreamCreateFileUser. You can get the BASS_APE.PAS file from the Win32 BASS_APE package (on the BASS webpage).

promusicbisceglie

i found my self...
BASS_APE is OK!! , bass_FX not :-\

promusicbisceglie

i've
in compiler -> linking options
Minimum iOS version supported = 11.0

Ian @ un4seen

Quote from: promusicbisceglie on 26 May '21 - 15:39i found my self...
BASS_APE is OK!! , bass_FX not :-\

That's strange. Did you add a BASS_APE function call to your code? If not, please try that, because the linker probably won't include the BASS_APE library in the app if it isn't actually used.

promusicbisceglie

#1435
Yes , if you see the attachement you can see your self..
i added
function BASS_APE_StreamCreateFile(mem: BOOL; f: Pointer; offset, length: QWORD; flags: DWORD): HSTREAM; cdecl; external 'libbass_ape.a' name 'BASS_APE_StreamCreateFile';
and libbass_ape.a in the project root (where is bass, bassmidi etc..)... and it work
edit : In the example i send you i don't call BASS_FX and dont call BASS_APE..just declare bass_fx and crash

EDIT2.... While bassfx fails also if it is not call, bass_ape fails when i call in the code
now i added   : tests:=BASS_APE_StreamCreateFile(false,nil,128,0,0);  and compiler fails with same errors...
_ZdlPv etc.... 
Any solutions?? i need use bass_fx..

promusicbisceglie

#1436
I found a solution!!
I 've copied libc++.dylib from ...SDKs\iPhoneOS13.6.sdk\usr\lib  to ...SDKs\iPhoneOS14.5.sdk\usr\lib
with old libc++.dylib compilation has been success !

Remember to add dependency 'c++' in BASS_FX declare funcion for iOS

Ian @ un4seen

Good to see that you've found a solution! If anyone else encounters the same problem, they'll know what to do now.

Ian @ un4seen

The iOS version of the BASS 2.4.16 release is up in the 1st post. The BASS and add-on libraries are also now in XCFramework form and include arm64 simulator support.

Ian @ un4seen

The iOS version of the BASSOPUS 2.4.2 release is up in the 1st post.

teq

I use BASS with Unity. I recently noticed that another 3rd-party project that also uses BASS has subfolder called "Headers" in the iOS folder.
In my experience the app can be compiled without these headers, but may be i did it wrong...So could you please clarify if you need to use headers for iOS builds?

Ian @ un4seen

What are the files in that "Headers" folder? If it's the C/C++ headers (eg. BASS.H) then I don't think they would be needed when using Unity/C#.

Anthony Y

I have linked libbass.xcframework and bass.h files but getting
Undefined symbol: _vDSP_fft_zip
Undefined symbol: _vDSP_create_ffsetup
error messages.

Does it mean I have done something wrong?

The error occurs when calling BASS_Init as below,
if ((BASS_Init(-1, 44100, DWORD(BASS_DEVICE_AUDIOTRACK), nil, nil) == 0)) {
   ...
   ...
}

jnyang

Hi Ian, is there any plan to support XCFramework format for the BASS_FX plugin? It seems that that plugin is not converted to the XCFramework format yet.

jnyang

Also, it seems that configuring BASS_CONFIG_IOS_SESSION with the BASS_SetConfig function does not work on the latest version (BASS_GetVersion() = 33820675).

Ian @ un4seen

Quote from: Anthony Y on 25 Jul '21 - 12:30I have linked libbass.xcframework and bass.h files but getting
Undefined symbol: _vDSP_fft_zip
Undefined symbol: _vDSP_create_ffsetup
error messages.

Does it mean I have done something wrong?

The error occurs when calling BASS_Init as below,
if ((BASS_Init(-1, 44100, DWORD(BASS_DEVICE_AUDIOTRACK), nil, nil) == 0)) {
   ...
   ...
}

Adding the Accelerate framework to your project should fix that.

It won't cause a problem, but you can also remove the BASS_DEVICE_AUDIOTRACK flag from the BASS_Init call, as that only has effect on Android.

Quote from: jnyang on 26 Jul '21 - 06:48Hi Ian, is there any plan to support XCFramework format for the BASS_FX plugin? It seems that that plugin is not converted to the XCFramework format yet.

The BASS_FX link in the first post has now been updated with an XCFramework version.

Quote from: jnyang on 26 Jul '21 - 10:36Also, it seems that configuring BASS_CONFIG_IOS_SESSION with the BASS_SetConfig function does not work on the latest version (BASS_GetVersion() = 33820675).

That's strange. What setting are you trying to use in the BASS_SetConfig call? And are you doing that before or after the BASS_Init call? If after, please try before and see if that makes any difference.

jnyang

Quote from: Ian @ un4seen on 26 Jul '21 - 12:58The BASS_FX link in the first post has now been updated with an XCFramework version.
Thanks for your quick update!

Quote from: Ian @ un4seen on 26 Jul '21 - 12:58
Quote from: jnyang on 26 Jul '21 - 10:36Also, it seems that configuring BASS_CONFIG_IOS_SESSION with the BASS_SetConfig function does not work on the latest version (BASS_GetVersion() = 33820675).

That's strange. What setting are you trying to use in the BASS_SetConfig call? And are you doing that before or after the BASS_Init call? If after, please try before and see if that makes any difference.

My original code called BASS_SetConfig before calling BASS_Init. Adjusting BASS_CONFIG_IOS_SESSION before calling BASS_Init worked on the previous version.

It seems that adjusting that config just right after calling BASS_Init works well. I also tried to create a new project to test its behavior without any bias, both in Objective-C and Swift, and the same issue happens. Maybe this behaviour needs to be mentioned in the documentation :)

Also, when I created the new project, I found that "AVFoundation.framework" is required to use BASS, which is not mentioned in the 1st post. Thanks!

Ian @ un4seen

The AVFoundation framework is indeed required with the latest BASS version. I've added it to the framework list in the 1st post now.

Regarding the BASS_CONFIG_IOS_SESSION issue, please also confirm what value you're using in the BASS_SetConfig call (in case it's making a difference).

jnyang

Quote from: Ian @ un4seen on 26 Jul '21 - 16:56The AVFoundation framework is indeed required with the latest BASS version. I've added it to the framework list in the 1st post now.

Regarding the BASS_CONFIG_IOS_SESSION issue, please also confirm what value you're using in the BASS_SetConfig call (in case it's making a difference).

I initially tried to set BASS_CONFIG_IOS_SESSION to 0 for configuring audio session category to AVAudioSessionCategoryPlayback, and it didn't worked. Then I tried to set it to different values (e.g., BASS_IOS_SESSION_MIX, BASS_IOS_SESSION_DISABLE, etc.), but none of them worked.

For your information, I tried to make a new project, configured all required frameworks (Accelerate, AudioToolbox, AVFoundation, CFNetwork, SystemConfiguration), added libbass.xcframework (with setting "Embed & Sign" on the project setting panel), and added some codes in AppDelegate.swift (or AppDelegate.m for Objective-C) like this:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  print(BASS_GetVersion())
  BASS_SetConfig(DWORD(BASS_CONFIG_IOS_SESSION), DWORD(BASS_IOS_SESSION_DISABLE))
 
  return true
}

BASS_GetVersion() worked well (i.e., the BASS library is loaded), but calling BASS_SetConfig throws an error "EXC_BAD_ACCESS (code=1, address=0x0)". The test was proceeded on the iPhone with the latest iOS (iOS 14.7) and Simulator. The latest Xcode (12.5.1) was used. Please let me know if I can provide any further information. Thanks.

Anthony Y

Hi Ian,

Is there bass_midi.h file like bass.h?

I am trying to call BASS_MIDI_FontInit(...) to start with.