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

Ian @ un4seen

  • Administrator
  • Posts: 21012
Re: BASS for iOS (iPhone/iPad)
« Reply #1050 on: 16 Jun '15 - 14:15 »
A BASSDSD update (2.4.0.1) is up in the 1st post, which fixes a problem with DSD-over-PCM playback of DSF files.

Ali

  • Guest
Re: BASS for iOS (iPhone/iPad)
« Reply #1051 on: 18 Jun '15 - 07:11 »
Hey, from where i can download header files for BASS for ios? can you send me a link? i couldn't find any. Thanks

Ian @ un4seen

  • Administrator
  • Posts: 21012
Re: BASS for iOS (iPhone/iPad)
« Reply #1052 on: 18 Jun '15 - 16:35 »
The same BASS header (BASS.H) is used on all platforms, so it can be taken from the Windows/OSX/Linux packages that are available on the BASS webpage. The same goes for the add-on headers.

   www.un4seen.com/bass.html

Ivan Belousov

  • Guest
App loses sound after dismissing a phone call (iOs 8.3)
« Reply #1053 on: 22 Jul '15 - 13:17 »
If i used this code:
Code: [Select]
void IOSNotifyProc(DWORD status)
{
  if (status==BASS_IOSNOTIFY_INTERRUPT) {
     BASS_Pause();
  } else if (status==BASS_IOSNOTIFY_INTERRUPT_END) {
     BASS_Start();
  }
}
...
BASS_Init(-1, 44100, 0, NULL, NULL);
BASS_SetConfig(BASS_CONFIG_IOS_MIXAUDIO, 4);
        BASS_SetConfigPtr(BASS_CONFIG_IOS_NOTIFY, (void *)IOSNotifyProc);
app lose sound And I found this error in log: ERROR:     [0x198869310] 1232: AUIOClient_StartIO failed (561015905)
If i added sleep
       
Code: [Select]
[NSThread sleepForTimeInterval:1];
      BASS_Start();
before BASS_Start, all works fine.
I think i skip something Can you help?

Ian @ un4seen

  • Administrator
  • Posts: 21012
Re: BASS for iOS (iPhone/iPad)
« Reply #1054 on: 22 Jul '15 - 17:58 »
BASS will effectively call BASS_Pause/Start itself when an interruption begins/ends, so there should be no need for you to call them yourself. Do you still see that "AUIOClient_StartIO" error message in the console if you don't call BASS_Pause/Start yourself?

On the Apple mailing list, it seems like someone else has encountered the same problem as you, with the same solution of waiting a bit.

   http://lists.apple.com/archives/coreaudio-api/2015/Jan/msg00050.html

Perhaps BASS will need to be made to delay playback resumption when an interruption ends. To confirm whether the problem is related to the session category, does it still happen if you use a different category, eg. when you set BASS_CONFIG_IOS_MIXAUDIO to 0/1/5?

alexanderbaars

  • Posts: 8
Re: BASS for iOS (iPhone/iPad)
« Reply #1055 on: 20 Aug '15 - 15:18 »
Hi guys,

I am building a module for iOS.
I run into the problem I cannot start playing from offset.

As soon as I try to play the stream I get an error 38.

Code: [Select]
chan = BASS_StreamCreateURL(path, 0, BASS_STREAM_DECODE, 0,0);
chan = BASS_FX_TempoCreate(chan,  BASS_FX_FREESOURCE);

totalBytes = BASS_StreamGetFilePosition(chan, BASS_FILEPOS_END);
long length = BASS_ChannelGetLength(chan, BASS_POS_BYTE);
totalTime = BASS_ChannelBytes2Seconds(chan, length);

double seekPosBytes = totalBytes*seekRequestTime/totalTime;
int intSeekPosBytes = (int) seekPosBytes;
   
 if(!(chan = BASS_StreamCreateURL(path, intSeekPosBytes, BASS_STREAM_DECODE, 0, 0))){
            NSLog(@"Can't load stream!");
            NSLog(@"BASS_StreamCreateURL %i", BASS_ErrorGetCode());
        }
I tried local files (using StreamCreateFile) as well as online streams.
The problem exists in the simulator as well as in the iPhone.

Can anyone help?

greetings, Alex

Ian @ un4seen

  • Administrator
  • Posts: 21012
Re: BASS for iOS (iPhone/iPad)
« Reply #1056 on: 20 Aug '15 - 17:59 »
Error code 38 is BASS_ERROR_DECODE. Are you getting that from a BASS_ChannelPlay call? If so, it indicates that a decoding channel (using BASS_STREAM_DECODE) can't be played directly. I notice you're calling BASS_FX_TempoCreate on the 1st stream, but perhaps it's missing from the 2nd stream?

pgruebele

  • Posts: 41
Hi.

I have a working BASS Android app built using Xamarin Forms.  I have a PCL project which references Bass.Net.Android and an Android project which also references Bass.Net.Android and also includes the native libraries.  This works very well, thanks!

The problem is that now I want to add an IOS project to my solution.  I did this, added the GCC flags, native libraries and Bass.Net.IOS reference.  BUT what about my PCL?  It already references Bass.Net.Android so if I add Bass.Net.IOS I get duplicate symbols defined.  If I add just 4.0/Bass.Net I get undefined references to System.Windows.Forms.  If I only include Bass.Net.IOS then the Android app crashes.

So my question is:  How can I make a PCL which uses BASS.Net and which works on both Android and IOS?

Cheers

alexanderbaars

  • Posts: 8
Re: BASS for iOS (iPhone/iPad)
« Reply #1058 on: 26 Aug '15 - 08:18 »
Error code 38 is BASS_ERROR_DECODE. Are you getting that from a BASS_ChannelPlay call? If so, it indicates that a decoding channel (using BASS_STREAM_DECODE) can't be played directly. I notice you're calling BASS_FX_TempoCreate on the 1st stream, but perhaps it's missing from the 2nd stream?

Hi Ian,

The decoding channel can only be played directly with an offset of 0 (zero).
Playing from an offset will only work if I omit the BASS_STREAM_DECODE flag in the BASS_StreamCreateUrl call. But without this flag I can not use the FX tempo tweaks I am looking for.
Starting from 0 means the file has to be buffered at least up until the required offset. I am working with rather large files and the waiting time is therefore substantially long (way too long, more than 10 seconds).
How can I overcome this problem.

And how is it that the construction (create a channel anew with offset and decode-flag after totaltime calculation of initial channel) works fine for Android...
« Last Edit: 26 Aug '15 - 08:23 by alexanderbaars »

Ian @ un4seen

  • Administrator
  • Posts: 21012
Re: BASS for iOS (iPhone/iPad)
« Reply #1059 on: 26 Aug '15 - 15:22 »
The BASS_STREAM_DECODE flag will have no bearing on the effectiveness of the BASS_StreamCreateURL "offset" parameter, but it will determine whether you can call BASS_ChannelPlay on the stream. Perhaps your code should look like this?

Code: [Select]
chan = BASS_StreamCreateURL(path, 0, BASS_STREAM_DECODE, 0,0);
//chan = BASS_FX_TempoCreate(chan,  BASS_FX_FREESOURCE); // not needed as you're not playing this stream

totalBytes = BASS_StreamGetFilePosition(chan, BASS_FILEPOS_END);
long length = BASS_ChannelGetLength(chan, BASS_POS_BYTE);
totalTime = BASS_ChannelBytes2Seconds(chan, length);

double seekPosBytes = totalBytes*seekRequestTime/totalTime;
int intSeekPosBytes = (int) seekPosBytes;

BASS_StreamFree(chan); // done with this stream
   
if(!(chan = BASS_StreamCreateURL(path, intSeekPosBytes, BASS_STREAM_DECODE, 0, 0))){
  NSLog(@"Can't load stream!");
  NSLog(@"BASS_StreamCreateURL %i", BASS_ErrorGetCode());
} else {
  chan = BASS_FX_TempoCreate(chan,  BASS_FX_FREESOURCE); // enable tempo processing
  BASS_ChannelPlay(chan, 0); // start it
}

alexanderbaars

  • Posts: 8
Re: BASS for iOS (iPhone/iPad)
« Reply #1060 on: 26 Aug '15 - 15:48 »
Hi Ian,

Just an hour ago I figured it out. I was indeed missing the BASS_StreamFree(chan) before generating the new stream with offset.
I am now able to start a channel with offset.

Thank you for your attention!

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1061 on: 31 Aug '15 - 09:21 »
Hi Ian,

I have an issue on iOS7 only (it's working well on 8/9). Some aac songs are not playing at all, I mean, the
Code: [Select]
BASS_ChannelPlay doesn't return any errors... but the audio doesn't start, never. If I set the pitch / tempo
Code: [Select]
BASS_ChannelSetAttribute after, that will return a bass error 5. Moreover, it happened just with some songs, not all.

I also log the fileprocs, but everything looks good to me: the track size, the bytes read... it's just not playing.

Any ideas about it?


Ian @ un4seen

  • Administrator
  • Posts: 21012
Re: BASS for iOS (iPhone/iPad)
« Reply #1062 on: 31 Aug '15 - 14:12 »
Error code 5 is BASS_ERROR_HANDLE, which means an invalid handle was used. The root problem will probably be that a preceding stream creation call failed; is the handle 0 in the BASS_ChannelSetAttribute call? Please check the error code straight after the stream creation call. From the mention of "fileprocs", I guess you're currently using BASS_StreamCreateFileUser? Do you also get the problem when using BASS_StreamCreateFile instead? If you're only having the problem with particular AAC files, please upload them to have a look at here:

   ftp.un4seen.com/incoming/

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1063 on: 1 Sep '15 - 11:35 »
I confirm, the handle is equal to 0.
I'm currently using BASS_StreamCreateFileUser  to handle some features like streaming... can I do the same using BASS_StreamCreateFile to stream my audio? Following the header, I didn't see how.

I will upload 5 aac sample which are not working on iOS7 (working well on 8/9). All named "ckouta_sample{1/2/3/...}.aac".

Hope that can help!

EDIT: I can't connect to the server as a guest, is there some credentials?
« Last Edit: 1 Sep '15 - 12:42 by Ckouta »

Ian @ un4seen

  • Administrator
  • Posts: 21012
Re: BASS for iOS (iPhone/iPad)
« Reply #1064 on: 1 Sep '15 - 15:37 »
To login to the FTP server, you should use "anonymous" for the username and any email address for the password.

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1065 on: 1 Sep '15 - 17:21 »
Done. You should find the files in your ftp.

pgruebele

  • Posts: 41
Shared versus PCL
« Reply #1066 on: 1 Sep '15 - 17:57 »
Hi Ian.

Am I correct that bass.net supports only shared projects and not PCL?

Cheers
Philip

Ian @ un4seen

  • Administrator
  • Posts: 21012
Re: BASS for iOS (iPhone/iPad)
« Reply #1067 on: 7 Sep '15 - 16:34 »
I will upload 5 aac sample which are not working on iOS7 (working well on 8/9). All named "ckouta_sample{1/2/3/...}.aac".

Thanks for the files. They're not working on iOS7 here either. BASS depends on CoreAudio for AAC decoding on iOS, and that is producing a "rate" error code for those files. I can't find that error in Apple's documentation, but presumably it indicates that the codec doesn't like the file's sample rate. Your files all have a sample rate of 96000 Hz, so my guess is that the AAC codec in iOS7 doesn't support 96000 Hz.

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1068 on: 8 Sep '15 - 09:14 »
Thanks for the explanation! We will reduce our sample rate to fix this.

Ckouta

  • Posts: 35
Re: BASS for iOS (iPhone/iPad)
« Reply #1069 on: 11 Sep '15 - 09:00 »
Code: [Select]
libbass.a(libbass.a-arm64-master.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
Do you think to handle bitcode soon? That will be great!

Ian @ un4seen

  • Administrator
  • Posts: 21012
Re: BASS for iOS (iPhone/iPad)
« Reply #1070 on: 11 Sep '15 - 16:55 »
I will look into it and see if something can be arranged.

Oleg N

  • Posts: 94
Re: BASS for iOS (iPhone/iPad)
« Reply #1071 on: 15 Sep '15 - 10:21 »
Ian, is TTA supported on iOS?

Ian @ un4seen

  • Administrator
  • Posts: 21012
Re: BASS for iOS (iPhone/iPad)
« Reply #1072 on: 15 Sep '15 - 13:43 »
An iOS version of the BASS_TTA add-on is now up in the 1st post.

Oleg N

  • Posts: 94
Re: BASS for iOS (iPhone/iPad)
« Reply #1073 on: 15 Sep '15 - 16:51 »
Cool, thank You
but it doesn't contain a BASSTTAplugin nor BASS_TTAplugin symbol.
« Last Edit: 15 Sep '15 - 16:54 by Oleg N »

Ian @ un4seen

  • Administrator
  • Posts: 21012
Re: BASS for iOS (iPhone/iPad)
« Reply #1074 on: 15 Sep '15 - 18:01 »
Oops! You're right, the iOS-specific stuff hadn't been added. Another build is up in the 1st post now, so please re-download to get that. Let me know if it still gives you any trouble.