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

Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1000 on: 18 Feb '15 - 13:41 »
The "ctype" value (BASS_CTYPE_STREAM_CA) reveals that it is CoreAudio that is decoding the AIFF file. BASS will handle PCM AIFF files itself, so it may that the file contains encoded data, which is apparently requiring quite a lot of CPU to decode. If you upload the AIFF file in question, I'll take a look at it...

   ftp.un4seen.com/incoming

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #1001 on: 18 Feb '15 - 14:26 »
I uploaded a file : 71 (Original Mix).aiff

In fact it's more simple than just one file, It's all the AIFF files who comes from to Beatport for sure.
I tried 27 files, all have the same problem.
After that, I tried to buy the same track that I uploaded to you in WAV and mp3 to make some tests, and no problem at all with these extensions ???

So, I made a last quick test also : I converted the original WAV in AIFF and the problem is here too.

Now, that I know is core audio who decode the file I'll try some test too, because I'm really interesting to understand where the problem appear and I can test with other decoder too.
I always thought for sure that an AIFF was as fast as a wav to decode ???

Thanks

Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1002 on: 18 Feb '15 - 17:16 »
PCM AIFF files should indeed use about the same CPU as PCM WAV files, but both file formats can contain encoded data, which may require more CPU. Your AIFF file contains PCM data, which BASS should handle itself, and indeed BASS is handling it (ctype=BASS_CTYPE_STREAM_AIFF) when I try it here, so it's strange that CoreAudio is handling it there. Please show how you are creating the stream. For comparison, what "ctype" values do you get when playing MP3 or WAV files in the same location as the AIFF file?

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #1003 on: 18 Feb '15 - 18:21 »
Ok forget it.

I just find the trouble.
I'm using a class name TSLibraryImport who use AVAssetExportSession to extract the track from iTunes library, and the problem is right here.

If I put the file directly to bass the decoding is as expected.
but if I extract the same file from iTunes library with AVAssetExportSession something goes wrong and the file is strange.
It is appear just for aiff, the others formats are not affected.

Thanks again for your times

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #1004 on: 19 Feb '15 - 03:25 »
Ok, I'm back to you with more information.  ;D
At first, I tried to use the original AIFF file with Bass (the same I sent to you) and the result was great.
So I thought that the TSLibraryImport was the problem.

But not at all, after a closer look, the library is just an AVAssetExportSession from Apple to export the file from iTunes to the local disc.
So I made a small project in objective ++ with multiple decoder  : Bass, AVAssetReader and Superpowered to test the results.

And the result was totally different.
In the project, I use the original file and the exported file from AVAssetExportSession and in fact, all the decoder can read the both file with no difference at all, except Bass ???

So, I posted this project in Github, I think, you'll be interested to take a look.
And, I'm really interesting too,  why Bass failed on AIFF file from AVAssetExportSession where the others succeeded with no difference at all ???

https://github.com/ppeau/AIFFDecoderPerformance

Hope can help ?

Pat


Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1005 on: 19 Feb '15 - 14:30 »
The importing probably involves a change of file format (perhaps to CAF), resulting in it being unplayable by BASS itself. To check that, please upload the file after it has been imported into your app...

   ftp.un4seen.com/incoming/

Another thing you could try is playing the file directly from the ipod library, ie. without importing it first. That is possible via BASS_StreamCreateURL, as described in this post...

   www.un4seen.com/forum/?topic=10910.msg111490#msg111490

It will still be CoreAudio handling the file in that case, but who knows, perhaps it will be faster :)

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #1006 on: 19 Feb '15 - 16:03 »
Hi, you already have the file available in the public repository : https://github.com/ppeau/AIFFDecoderPerformance
The file ExportedFile.aiff is in the zip : https://github.com/ppeau/AIFFDecoderPerformance/archive/master.zip

I'll test the BASS_StreamCreateURL with the "without importing it first".

So, if there is no solution, It is not a big deal, because temporarily, if that works for the playback stream I will use the "without importing it first" and for decoding I'll maybe use Superpowered who is lightning fast.

and by the way :

Quote
The importing probably involves a change of file format (perhaps to CAF), resulting in it being unplayable by BASS itself.

Like you can test quickly in the repository, it is not unplayable by BASS. Bass can play it. It is just very very slow compare to the others ???


Thanks a lot

Patrice
« Last Edit: 19 Feb '15 - 17:01 by ppeau »

Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1007 on: 19 Feb '15 - 17:21 »
Ah, I didn't notice that you had included the imported file. By "unplayable by BASS itself", I just meant without the help of CoreAudio. Anyway, looking at the imported file, I see that it is still an AIFF file with just a small change in the file's header. A BASS update that should be able to handle the imported file itself (without CoreAudio's help :)) is now up in the 1st post; you can check the "ctype" to confirm whether BASS or CoreAudio is handling the file.

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #1008 on: 19 Feb '15 - 17:25 »
Quote
Ah, I didn't notice that you had included the imported file. By "unplayable by BASS itself", I just meant without the help of CoreAudio. Anyway, looking at the imported file, I see that it is still an AIFF file with just a small change in the file's header. A BASS update that should be able to handle the imported file itself (without CoreAudio's help Smiley) is now up in the 1st post; you can check the "ctype" to confirm whether BASS or CoreAudio is handling the file.

Oh boy, you're quite fast :o.

I'll on my way to test that right now

Thanks a lot

ppeau

  • Posts: 48
Re: BASS for iOS (iPhone/iPad)
« Reply #1009 on: 19 Feb '15 - 17:39 »
Ok Test finished
From 50 seconds to decode the AIFF from AVAssetExportSession, now I'm able to decode it with bass in 3 seconds :o with an iPad mini.
If think I can say : It's the fastest modification for the biggest result ever.  ;D

Thanks a lot, you make my day

Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1010 on: 5 Mar '15 - 17:12 »
An iOS version of the BASSDSD add-on has been added to the package in the 1st post.

Oleg N

  • Posts: 94
Re: BASS for iOS (iPhone/iPad)
« Reply #1011 on: 6 Mar '15 - 17:39 »
As for Tags add-on, is there a way it can retrieve replay gain tag information?

Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1012 on: 6 Mar '15 - 18:01 »
No, I'm afraid not. You would need to check for that stuff separately in the tags that are available from BASS_ChannelGetTags, eg. a "REPLAYGAIN_TRACK_GAIN" entry in BASS_TAG_APE or BASS_TAG_OGG tags.

Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1013 on: 13 Mar '15 - 16:56 »
The iOS version of the BASSmix 2.4.8 release is now up in the 1st post.

robertr

  • Posts: 18
Re: BASS for iOS (iPhone/iPad)
« Reply #1014 on: 16 Mar '15 - 14:29 »
Is anyone using the Tags plugin with a 64bit app?
I am not able to compile after adding this plugin. Downloaded just now to make sure I had the latest version.

Error is: Undefined symbols for architecture x86_64
Not sure if this is a 64bit issue or something else.

BassMix and BassFlac is working fine.

Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1015 on: 16 Mar '15 - 16:30 »
What are the symbols that are missing? The current TAGS add-on build does include x86_64 support, but older builds didn't. So perhaps an older LIBTAGS.A file is still being used in your project even though you have downloaded the latest? If you're certain that the latest LIBTAGS.A file is in your project, you could also try "cleaning" the project and see if that helps.

robertr

  • Posts: 18
Re: BASS for iOS (iPhone/iPad)
« Reply #1016 on: 16 Mar '15 - 17:12 »
Hi Ian, It is the latest libtags.a from february 5th it seems. Cleaning project does not help.
Lots of link errors similar to those below. This might be a user error on my part, but I am a but stumped at the moment how to proceed.

Undefined symbols for architecture x86_64:
  "std::string::find(char, unsigned long) const", referenced from:
      l035 in libtags.a(libtags.a-x86_64-master.o)
  "std::runtime_error::what() const", referenced from:
      l468 in libtags.a(libtags.a-x86_64-master.o)
  "std::string::_S_copy_chars(char*, char const*, char const*)", referenced from:
      l118 in libtags.a(libtags.a-x86_64-master.o)
      l119 in libtags.a(libtags.a-x86_64-master.o)

Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1017 on: 16 Mar '15 - 17:28 »
Ah, I think adding "-lstdc++" to your project's "Other Linker Flags" setting should fix that.

robertr

  • Posts: 18
Re: BASS for iOS (iPhone/iPad)
« Reply #1018 on: 16 Mar '15 - 19:30 »
I actually had that linker flag. Turned out I had to add an empty .mm file to make xcode compile the c++ code properly.
Anyways, thanks for putting me in the right direction Ian.

robertr

  • Posts: 18
Re: BASS for iOS (iPhone/iPad)
« Reply #1019 on: 17 Mar '15 - 08:52 »
Sorry to bother you again, but the app always crash when trying to read a tag:
"terminating with uncaught exception of type no_tag".

 if (handle) {
        const char* tags = BASS_ChannelGetTags(handle, BASS_TAG_OGG);
        if (tags) {
            const char* result = TAGS_Read(handle, "%ARTI");
            NSLog( @"%s", result );
        }
        BASS_StreamFree(handle);
    }


Have tried several files of different format.
Bass is initialized and calls like BASS_ChannelGetInfo works perfect.
Any ideas?


Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1020 on: 17 Mar '15 - 16:22 »
That's strange. I don't seem to be able to reproduce that problem here. Are you only having the problem when running your app in the x86_64 simulator, ie. not on a device or i386 simulator?

robertr

  • Posts: 18
Re: BASS for iOS (iPhone/iPad)
« Reply #1021 on: 18 Mar '15 - 13:52 »
Ian, just found out that it works on a device, but not in the simulator.
Is this a limitation of the plugin?

Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1022 on: 18 Mar '15 - 14:02 »
The TAGS add-on seems to be working fine in the simulator here, so I don't think there is a general issue with that. What simulator version are you using? Perhaps there is something in your project's settings that's causing the problem. If you upload a little project that produces the problem there, I'll see if I can reproduce the problem with it here...

   ftp.un4seen.com/incoming/

ken

  • Posts: 742
Re: BASS for iOS (iPhone/iPad)
« Reply #1023 on: 2 Apr '15 - 11:33 »

Apple change there policy (again) https://developer.apple.com/news/?id=12172014b

So must I use a 64 but version of BASS and the add-ons now? If, do you have a 64 bit version?

Ian @ un4seen

  • Administrator
  • Posts: 21314
Re: BASS for iOS (iPhone/iPad)
« Reply #1024 on: 2 Apr '15 - 17:24 »
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.