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

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1025 on: 17 Apr '15 - 11:13 »
Hello,

I'm getting some crashes in BASS iOS. Sadly, I don't have any crash logs, it's just breaking in Xcode. Moreover, it's kinda random, just playing a lot with it, and sometimes, I'm getting a "SIGABRT", and once another one, I don't remember exactly it but it was something linked to "ARM" (I will edit it, if I reproduce it). Notes, that happens only on iPhone 5 device, never get it on iPhone 6. So, I'm supposing it's due to the device architecture.

I think it's linked with the exception raised when the "all exceptions" is activated (it's always breaking on the same line). This one happened on all device (real and simulator).

Code: [Select]
HSTREAM channel = BASS_StreamCreateFileUser(STREAMFILE_NOBUFFER, BASS_STREAM_DECODE | BASS_STREAM_RESTRATE, &fileprocs, (__bridge void *)(channel));

Is anyone got this issues?
« Last Edit: 17 Apr '15 - 12:58 by Ckouta »

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: BASS for iOS (iPhone/iPad)
« Reply #1026 on: 17 Apr '15 - 17:09 »
To help narrow-down what/where the problem is, do you have a call stack from the crash, eg. from Xcode? Also, are your "fileprocs" callback functions getting called?

Oleg N

  • Posts: 94
Re: BASS for iOS (iPhone/iPad)
« Reply #1027 on: 17 Apr '15 - 20:34 »
Hi everyone,

Is there a way to find/know exact native bit depth of the audio device in the iPhone/iPad? This question is asked by users more and more recently since we added iOS version of our product. However, I was unable to find firm facts about hardware used.

ken

  • Posts: 739
Re: BASS for iOS (iPhone/iPad)
« Reply #1028 on: 20 Apr '15 - 07:11 »
64-bit support is included in the iOS BASS libraries. That was added last June, so if you're currently using older libraries, you can re-download to get the 64-bit goodness.

Sorry for late replay. I only find one "libbass.a", is it both 32 and 64 bit?

I assume that "libbassmix.a" and "libbass_fx.a" also supports 64bit

/Ken

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1029 on: 20 Apr '15 - 08:28 »
To help narrow-down what/where the problem is, do you have a call stack from the crash, eg. from Xcode? Also, are your "fileprocs" callback functions getting called?

Sadly, I don't have any logs, it's just a random crash I got sometimes while playing breaking on this function.
Yes, my "fileprocs" are all well-settled. On an iPhone 6, I have no crash... it's working perfectly. It's just on the iPhone 5 I'm crashing sometimes.

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: BASS for iOS (iPhone/iPad)
« Reply #1030 on: 20 Apr '15 - 17:58 »
Sorry for late replay. I only find one "libbass.a", is it both 32 and 64 bit?

I assume that "libbassmix.a" and "libbass_fx.a" also supports 64bit

Yep, all of the libraries include 64-bit support now.

Sadly, I don't have any logs, it's just a random crash I got sometimes while playing breaking on this function.
Yes, my "fileprocs" are all well-settled. On an iPhone 6, I have no crash... it's working perfectly. It's just on the iPhone 5 I'm crashing sometimes.

OK. The next time it happens, please post the call stack from Xcode to see if that gives any clues. Also add some logging to the "fileprocs" callback functions (eg. on entry and exit) to confirm whether they get called before the crash occurs.

X-Vlad

  • Posts: 15
Re: BASS for iOS (iPhone/iPad)
« Reply #1031 on: 21 Apr '15 - 11:03 »
Hi Guys,

I've Delphi XE8 trial and want to play with BASS component. I need to play audio stream from radio station in iPhone app. But I don't know how to include BASS component into project. header file and lib.

Could somebody help me? Maybe someone have small project that can be shared with me.

Thank you.

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1032 on: 21 Apr '15 - 13:50 »
Hi,

I have some question about seeking using Bass.
I already read some posts about it, but I probably miss a part

This is my code:

Code: [Select]

for (NSNumber *channel in self.allBassChannels) {
QWORD newPos = BASS_ChannelSeconds2Bytes([channel intValue], seconds);
DWORD flags = BASS_POS_BYTE;
if (seconds > [self songPlayingProgress]) {
flags |= BASS_POS_DECODETO;
}
if (!BASS_Mixer_ChannelSetPosition([channel intValue], newPos, flags)) {
DDLogError(@"BASS_Mixer_ChannelSetPosition error code: %d", BASS_ErrorGetCode());
break;
}
}

I have a array of channels, for which I'm setting a new position when the user is seeking, but most of the time, it's simply failing, and go back to the previous position.

Did I miss something to implement a proper seek?

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: BASS for iOS (iPhone/iPad)
« Reply #1033 on: 21 Apr '15 - 16:57 »
What error code are you seeing from the BASS_Mixer_ChannelSetPosition call? To check whether it's related to the use of the BASS_POS_DECODETO flag, does removing that flag avoid the problem?

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1034 on: 21 Apr '15 - 18:36 »
What error code are you seeing from the BASS_Mixer_ChannelSetPosition call? To check whether it's related to the use of the BASS_POS_DECODETO flag, does removing that flag avoid the problem?

If I remove this flag, I can't seek further than where I am in the audio, always getting the error "7".
If I let the flag, seeking further is working well, but the operation looks more expensive. Also, with this flag, I have only around 50% success while seeking back, getting the error "7".

For me, it looks like I need this flag but it will be better if I can remove it...  :-\

Also, that happens only when I'm streaming the audio, the seek is working well if I have the audio offline (and without the flag).
« Last Edit: 22 Apr '15 - 08:03 by Ckouta »

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: BASS for iOS (iPhone/iPad)
« Reply #1035 on: 22 Apr '15 - 18:07 »
OK, I think that would explain it. When you say "streaming the audio", I guess you're using BASS_StreamCreateURL? If so, please note that it will only be possible to seek within the portion of the file that has been downloaded so far, and only if the BASS_STREAM_BLOCK flag isn't set. The download progress can be monitored with BASS_StreamGetFilePosition (mode=BASS_FILEPOS_DOWNLOAD).

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1036 on: 23 Apr '15 - 07:40 »
When I'm saying "streaming the audio", I just mean when the audio starts, I don't have the full track in app, but when I disable the seek until I have the full track. This way, I'm always sure if the user seek I have the data to play this part.

Also, I'm not using BASS_StreamCreateURL, but BASS_StreamCreateFileUser.

The weird part is that working well when I'm seeking further, but not when I want to seek back.

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: BASS for iOS (iPhone/iPad)
« Reply #1037 on: 23 Apr '15 - 15:48 »
When I'm saying "streaming the audio", I just mean when the audio starts, I don't have the full track in app, but when I disable the seek until I have the full track. This way, I'm always sure if the user seek I have the data to play this part.

Also, I'm not using BASS_StreamCreateURL, but BASS_StreamCreateFileUser.

What "system" parameter are you using in the BASS_StreamCreateFileUser call? If it's STREAMFILE_BUFFER/PUSH, then it will basically be using the same mechanism as BASS_StreamCreateURL, with the same seeking limitation.

The weird part is that working well when I'm seeking further, but not when I want to seek back.

Is the backward seeking problem only when using the BASS_POS_DECODETO flag? If so, please note that it decodes data to reach the requested position, so it can only go forwards from the current position.

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1038 on: 23 Apr '15 - 16:54 »
What "system" parameter are you using in the BASS_StreamCreateFileUser call? If it's STREAMFILE_BUFFER/PUSH, then it will basically be using the same mechanism as BASS_StreamCreateURL, with the same seeking limitation.

I'm using the "STREAMFILE_NOBUFFER" as "system" parameter in BASS_StreamCreateFileUser call. Is that wrong?

Is the backward seeking problem only when using the BASS_POS_DECODETO flag? If so, please note that it decodes data to reach the requested position, so it can only go forwards from the current position.

No, I'm not using this flag while backward seeking. It looks coherent for me to use it only when seeking forward

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: BASS for iOS (iPhone/iPad)
« Reply #1039 on: 23 Apr '15 - 17:36 »
Oh. If you're using system=STREAMFILE_NOBUFFER, then seeking should work the same as with a local file. Are the calls to your BASS_FILEPROCS callback functions all succeeding? If you're unsure, you could add logging to those functions to check.

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1040 on: 24 Apr '15 - 08:26 »
Everything looks fine in my BASS_FILEPROCS fileprocs, I means, I have the same output as when it's working.
The only difference is that BASS_Mixer_ChannelSetPosition fails with the code error 7.

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: BASS for iOS (iPhone/iPad)
« Reply #1041 on: 24 Apr '15 - 17:34 »
Where are your custom file routines getting the file content from, and is the seeking problem happening with a particular file format or all formats? To help narrow down what the problem is, please try playing a local file using the example code in the BASS_FILEPROCS documentation, and see whether seeking works then.

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1042 on: 27 Apr '15 - 08:25 »
The file routines get the file content from a custom object who manage the stream, seek... I'm also using this object to play the offline songs (which working well). Also, we manage only one audio format: aac, so the problem is happening only with this format.

Just test with the example code in the BASS_FILEPROCS documentations with a locale file, it's exactly the same behaviour as when I'm seeking without streaming.

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: BASS for iOS (iPhone/iPad)
« Reply #1043 on: 27 Apr '15 - 17:02 »
So to confirm... seeking works fine when using the example BASS_FILEPROCS functions, but it doesn't if you switch back to your file routines? If so, and everything else is identical, then it seems like there is a problem somewhere in your routines. Are you sure your routines are always succeeding, ie. have you logged them to confirm it? You could also try another file format (eg. MP3) to check whether the issue is limited to the AAC format.

ed123

  • Posts: 2
Re: BASS for iOS (iPhone/iPad)
« Reply #1044 on: 6 May '15 - 16:19 »
We are using bass dll in our real time audio analyzer application. It works pretty fine on Windows, however in iOS we observe microphone input being high-passed. Is there are any settings we can apply during BASS initialization that will switch off that high pass filtering?

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: BASS for iOS (iPhone/iPad)
« Reply #1045 on: 6 May '15 - 17:32 »
That's strange. BASS doesn't apply any filtering to the recorded sample data, so I can only guess that it is the device/OS that is doing that. Are you recording at the native sample rate, as reported by BASS_RecordGetInfo ("freq" value)? If not, you could try that and see if it makes any difference. Also, if you try recording with other software on the same device, do you get the filtering then?

ed123

  • Posts: 2
Re: BASS for iOS (iPhone/iPad)
« Reply #1046 on: 7 May '15 - 09:19 »
I am not setting sample rate for the mic. I guess the recording sample rate is set to its default value by Bass. The interesting thing is that when i run 3rd party audio analyzer in the background my application starts receiving unfiltered microphone input. But once i exit that application, my application mic input becomes high pass filtered, which i clearly see from the FFT analysis.

I suppose it's happening in iOS itself not in the Bass library. Probably something related to this http://stackoverflow.com/questions/13348988/is-there-a-way-to-turn-off-the-automatic-low-frequency-filtering-of-the-audio-in

I tried setting AVAudioSessionModeMeasurement after bass initialization, didn't help so far. I will keep investigating and let you know.

Btw, i am using iPhone 6 iOS 8.3. And for the 3rd party FFT analyzer http://www.studiosixdigital.com/audiotools/

PS: I am using the same Bass initialization steps on PC and it works just fine.
« Last Edit: 7 May '15 - 09:24 by ed123 »

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: BASS for iOS (iPhone/iPad)
« Reply #1047 on: 7 May '15 - 13:39 »
Ah yes, that could be it. Are you making the the "setMode" call after BASS_RecordInit (and BASS_Init if used), and is it reporting success, ie. returning YES/1?

blamejane

  • Posts: 3
Re: BASS for iPhoneOS
« Reply #1048 on: 12 Jun '15 - 16:01 »
In there is any C# coders that use MonoTouch framework for developing iPhone apps, I'm happy to tell you that BASS for IPhone works with MonoTouch (yes you can link static libraries in MonoTouch). I can make a simple MonoTouch example if needed.

/Ken

Hi Ken,

Could you provide a sample project please??  I have a license and I'm trying to set this up on a mac for a Unity game on IOS.

Thanks

Valerie

mserougi

  • Posts: 13
Re: BASS for iPhoneOS
« Reply #1049 on: 15 Jun '15 - 16:09 »
In there is any C# coders that use MonoTouch framework for developing iPhone apps, I'm happy to tell you that BASS for IPhone works with MonoTouch (yes you can link static libraries in MonoTouch). I can make a simple MonoTouch example if needed.

/Ken

Hi Ken,

Could you provide a sample project please??  I have a license and I'm trying to set this up on a mac for a Unity game on IOS.

Thanks

Valerie


+1 to that. A sample project would be awesome, it'll shed some light on getting Bass to work with a different IDE, like Xamarin Studio.