Author Topic: BASS for iOS (iPhone/iPad)  (Read 457451 times)

Ian @ un4seen

  • Administrator
  • Posts: 20336
Re: BASS for iOS (iPhone/iPad)
« Reply #1200 on: 4 Aug '17 - 15:20 »
Great to hear that you have got it working. I was unaware of the main thread requirement myself until Google suggested it (I don't think it's mentioned anywhere in Apple's documentation). I will add a note to the BASS_MIDI_InGetDeviceInfo documentation.

Are you sure BASS_Init needs to be called in the main thread too? I wouldn't have thought that would affect MIDI device enumeration (unless they're somehow linked internally within iOS).

AldoIlsant

  • Guest
Re: BASS for iOS (iPhone/iPad)
« Reply #1201 on: 4 Aug '17 - 15:34 »
"Are you sure BASS_Init needs to be called in the main thread too? I wouldn't have thought that would affect MIDI device enumeration (unless they're somehow linked internally within iOS)."

I couldn't get it to work until I moved BASS_Init to the main thread. So yes, I am sure. I think you should recommend that in Bass_Init documentation as well.

Thanks

Olek

  • Posts: 18
Re: BASS for iOS (iPhone/iPad)
« Reply #1202 on: 10 Aug '17 - 08:00 »
We faced with major battery drain on iOS devices. ~20% over eight hours. I'm not sure what caused the issue but one of the guesses it's mixer channel on pause while app in background mode.
Is it possible that paused mixer channel works in background and consumes power even if user doesn't use the app?

Oleg N

  • Posts: 86
Re: BASS for iOS (iPhone/iPad)
« Reply #1203 on: 10 Aug '17 - 09:58 »
@Olek,
 
Mixer should not consume anything when paused, as far as I know...

Are You calling BASS_Pause() when not playing? could save some 0.5 - 1 % of CPU load when paused in foreground.

But even without this - I hardly understand how it can consume something in background since in background iOS throttles down Your app once it stops playing audio, anyway.
Please make sure that Your channels are stopped/paused and BASS is paused when not playing, because it looks like iOS is thinking that the app is still playing, when, in fact, it isn't. Also check what other means may force iOS to keep the app running even though it is in background (Geolocation, Background task, e t.c.)

I've got app (player) that uses mixer too and CPU load is 0% when paused, both in background and foreground. We too had issues with battery drain but it turned out to be the problem of app organization, not related to BASS as such.
« Last Edit: 10 Aug '17 - 10:14 by Oleg N »

Olek

  • Posts: 18
Re: BASS for iOS (iPhone/iPad)
« Reply #1204 on: 10 Aug '17 - 15:03 »
@Oleg N,

Thanks for your reply!

I use BASS_ChannelPause() but going to try BASS_Pause() .

We use Audio and Air play background mode. It's needed feature.
I'm not sure that problem caused by BASS. But we don't have any other background tasks that might cause issue.





Oleg N

  • Posts: 86
Re: BASS for iOS (iPhone/iPad)
« Reply #1205 on: 11 Aug '17 - 17:15 »
@Olek,

Yes, "Audio & Airplay" is for staying alive in background for playback, but as soon as You pause playback - iOS will suddenly throttle down Your app anyway.
Why You just don't look at those gears in XCode (CPU, threads) and analyze what is eating up resources in Your case? You can see everything app consumes both in foreground and in background, playing or paused.
« Last Edit: 23 Aug '17 - 09:54 by Oleg N »

Ian @ un4seen

  • Administrator
  • Posts: 20336
Re: BASS for iOS (iPhone/iPad)
« Reply #1206 on: 28 Aug '17 - 17:39 »
The iOS version of the new BASSFLAC 2.4.4 release is up in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 20336
Re: BASS for iOS (iPhone/iPad)
« Reply #1207 on: 30 Aug '17 - 17:56 »
The iOS version of the new BASSmix 2.4.9 release is up in the 1st post.

norbert

  • Posts: 118
Re: BASS for iOS (iPhone/iPad)
« Reply #1208 on: 10 Sep '17 - 16:32 »
I'm getting BASS_ERROR_FILEOPEN for PluginLoad only on real device iOS 10.2/3, on iOS Simulator it works fine (and it worked fine for over a year on real devices too!) !

Using Xamarin.iOS and the latest libbass<xy>.a:

Suddenly, after the last Xamarin.iOS update,  the bassflac,~wv,~opus plugins can't be loaded any more on my iPad:
The return code is 0 and BASS reports "BASS_ERROR_FILEOPEN".
The libbbass itself loads correctly.  And on simulator it works fine (iOS 10.2) !

Any ideas ?

Ian @ un4seen

  • Administrator
  • Posts: 20336
Re: BASS for iOS (iPhone/iPad)
« Reply #1209 on: 11 Sep '17 - 16:55 »
Please confirm how you using the BASS plugin system. Note that it's a bit different on iOS due to the fact that the BASS add-on libraries are statically linked into the app rather than dynamically loaded. I'm not familiar with how it should be done with Xamarin, but in C/C++/Objective-C, it should look something like this:

Code: [Select]
extern void BASSWVplugin;
BASS_PluginLoad(BASSWVplugin, 0);

Also confirm that the add-on libraries are being linked into your app.

norbert

  • Posts: 118
Re: BASS for iOS (iPhone/iPad)
« Reply #1210 on: 11 Sep '17 - 18:12 »
Yes I can confirm this. (the call is Bass.BASS_PluginLoad("BASSFLAC")  but internally  a flag BASS_UNICODE (=-2147483648) is passed as 2nd param.

Anyway, I have not changed neither the the plugin initialisation code  nor the linking for over a year, because it always worked both on device and simulator.

The strange thing is that it still works on the simulator!

norbert

  • Posts: 118
Re: BASS for iOS (iPhone/iPad)
« Reply #1211 on: 12 Sep '17 - 11:04 »
Solved: The actual problem was  that my device also got updated -  from iOS 10.2 to  10.3, which is not supported by  XCode 8.2.1.
Now I'm  using some "hack" to be able to deploy to "correctly" -to iOS 10.3.
Obviously this former incomatibilty caused some kind of "partial deployment"...probably the plugin *.a files were not included or linked incorrectly...

Ian @ un4seen

  • Administrator
  • Posts: 20336
Re: BASS for iOS (iPhone/iPad)
« Reply #1212 on: 3 Oct '17 - 18:00 »
The iOS version of the BASSHLS add-on is now included in the 1st post.