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

Ian @ un4seen

  • Administrator
  • Posts: 20210
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: 10
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: 81
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: 10
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: 81
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 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: 14 Aug '17 - 13:07 by Oleg N »