Author Topic: BASS for Android  (Read 390545 times)

_Tobias

  • Posts: 10
AAC plugin for x86?
« Reply #350 on: 12 Jun '13 - 16:19 »
Hello,

First, I'd like to thank Ian and radio42 for their great work. I really love BASS and the unlimited possibilities.

I've been using BASS and BASS.net for some time now, here are some of my Windows projects (this one's not really mine, I only help and host) made with BASS :D

Here are my current apps, also using BASS.

I'm planning on releasing an alternative for this app (I don't like it, it's too slow and old) and I want to support the channels from these apps as well.

The streaming network provides AAC and MP3 streams, only the MP3 stream is 256kbps, which is too much for a 3G connection IMO. The AAC is 128kbps which is quite acceptable.
I want to support as many devices as possible, including x86 phones. I noticed the availablilty of x86 BASS for Android some posts above. I'd like to know whether a x86 version of the AAC plugin is available, so I can fully support all architectures.

Thanks a lot in advance!

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #351 on: 12 Jun '13 - 17:29 »
Here's something for you to try...

   www.un4seen.com/stuff/bass_aac-android-x86.zip

chucuoi

  • Posts: 1
Re: BASS for Android
« Reply #352 on: 13 Jun '13 - 04:21 »
Dear Lan,

I trying mix 2 file mp3, i view example and i use code:

Code: [Select]
                       int mixer = BASSmix.BASS_Mixer_StreamCreate(44100, 2, BASS.BASS_SAMPLE_FLOAT);
// now we need some channels to plug them in...create two decoding sources
int streamA = BASS.BASS_StreamCreateFile("testA.mp3", 0, 0,
                   BASS.BASS_STREAM_DECODE | BASS.BASS_SAMPLE_FLOAT);
int streamB = BASS.BASS_StreamCreateFile("testB.mp3", 0, 0,
BASS.BASS_STREAM_DECODE | BASS.BASS_SAMPLE_FLOAT);


boolean okA = BASSmix.BASS_Mixer_StreamAddChannel(mixer, streamA, BASS.BASS_SAMPLE_FLOAT);
boolean okB = BASSmix.BASS_Mixer_StreamAddChannel(mixer, streamB, BASS.BASS_SAMPLE_FLOAT);

BASS.BASS_ChannelPlay(mixer, false);

i run in device not error, but i not found file mixed? or my code miss??

Thanks!

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #353 on: 13 Jun '13 - 13:39 »
Are any of those function calls failing, ie. returning 0? If so, you can use BASS_ErrorGetCode to get the error code and then look that up in the documentation to find out why the call failed. If the BASS_StreamCreateFile calls are failing with BASS_ERROR_FILEOPEN errors, it may be that you need to use the "Asset" class to access the files, like this...

Code: [Select]
int streamA = BASS.BASS_StreamCreateFile(new BASS.Asset(getAssets(), "testA.mp3"), 0, 0,
BASS.BASS_STREAM_DECODE | BASS.BASS_SAMPLE_FLOAT);
int streamB = BASS.BASS_StreamCreateFile(new BASS.Asset(getAssets(), "testB.mp3"), 0, 0,
BASS.BASS_STREAM_DECODE | BASS.BASS_SAMPLE_FLOAT);

iancast

  • Posts: 42
Re: BASS for Android
« Reply #354 on: 28 Jun '13 - 04:12 »
Hello guys,

Anyone having problems with BASS and the Samsung Galaxy S4? I'm not sure yet the problem is 100% BASS-related, but two apps I'm working on that are using BASS crash with the Galaxy S4. In short, the first playback will work (whether it's an internet stream or a file), and the second playback will crash the application without a Java-specific exception. They work fine with pretty much every other device I had my hands on (S2, S3, Note 2, Nexus 7, Razr HD, HTC One X, etc.).

I'll keep on testing and keep you updated.
Yanick
« Last Edit: 28 Jun '13 - 05:46 by iancast »

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #355 on: 28 Jun '13 - 12:53 »
Is it crashing in a particular function call? I will probably need to send you a debug version to get some more info on what's happening, but please first see if you can reproduce the problem with one of the examples in the BASS package, eg. the PLUGINS example.

_Tobias

  • Posts: 10
Re: BASS for Android
« Reply #356 on: 14 Jul '13 - 15:44 »

_Tobias

  • Posts: 10
Re: BASS for Android
« Reply #357 on: 15 Jul '13 - 21:00 »
I have a small problem, when the channel is BASS_ACTIVE_STALLED, calling stop will cause the execution to hang. Is there any way a channel can be stopped instantly ignoring the stalled state?

Thanks in advance!

Tobias

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #358 on: 16 Jul '13 - 15:08 »
I've put an updated BASS library in the package in the 1st post. Please give that a try and see if the problem still happens. If it does still happen, please confirm where it is getting stuck, eg. is it in a BASS_ChannelStop or BASS_StreamFree call?

_Tobias

  • Posts: 10
Re: BASS for Android
« Reply #359 on: 16 Jul '13 - 20:11 »
I've put an updated BASS library in the package in the 1st post. Please give that a try and see if the problem still happens. If it does still happen, please confirm where it is getting stuck, eg. is it in a BASS_ChannelStop or BASS_StreamFree call?
Will try ASAP. I got a corrupted HDD so my source is gone :/
Is the x86 build updated as well?

_Tobias

  • Posts: 10
Re: BASS for Android
« Reply #360 on: 16 Jul '13 - 22:22 »
Works perfectly! Thanks!

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #361 on: 17 Jul '13 - 15:55 »
That's great! The x86 build has now been updated too (link in the 1st post).

motomart

  • Posts: 4
Re: BASS for Android
« Reply #362 on: 18 Jul '13 - 16:28 »
Hi Ian,
Thanks for great player, works perfect!
I'm having the issue with BASS_CONFIG_NET_PREBUF.
My intention is to start playing when 1-2 sec is buffered but create large buffer around 10 sec. later to ride through intermittent G3 or 1X connections. It runs correctly the first time, starts playing the stream when buffer is at PREBUF percentage (20%), but when buffer empties and start buffering again you can briefly hear the sound at PREBUFF position (@ 20%) and then silence until buffer reach about 50%.  At this point it only plays if buffer level is over 50%. Is there anything I'm missing or it's the library issue?
Thanks!


Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #363 on: 18 Jul '13 - 17:50 »
The playback resumption download buffer level is currently hardcoded at 50%, as you found. To make that more flexible, a new BASS_ATTRIB_NET_RESUME option has been added (update in 1st post), which allows the resumption buffer level to be set via BASS_ChannelSetAttribute. For example, if you want playback to resume when the download buffer reaches 20% full, you would do this...

Code: [Select]
BASS.BASS_ChannelSetAttribute(handle, BASS.BASS_ATTRIB_NET_RESUME, 20);

Let me know if you have any trouble with it.

motomart

  • Posts: 4
Re: BASS for Android
« Reply #364 on: 18 Jul '13 - 19:02 »
The playback resumption download buffer level is currently hardcoded at 50%, as you found. To make that more flexible, a new BASS_ATTRIB_NET_RESUME option has been added (update in 1st post), which allows the resumption buffer level to be set via BASS_ChannelSetAttribute. For example, if you want playback to resume when the download buffer reaches 20% full, you would do this...

Code: [Select]
BASS.BASS_ChannelSetAttribute(handle, BASS.BASS_ATTRIB_NET_RESUME, 20);

Let me know if you have any trouble with it.



You are the man...
Thank you Ian!

I think I was happy too quick... It still have 50% resume level...
Any more ideas?
« Last Edit: 18 Jul '13 - 20:04 by motomart »

motomart

  • Posts: 4
Re: BASS for Android
« Reply #365 on: 18 Jul '13 - 20:24 »
I moved BASS_SetConfig and SetAtribute options to timer and everything works as expected. 
Thanks again!

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #366 on: 19 Jul '13 - 16:47 »
Good to hear that it's working, but it shouldn't be necessary to use a timer, so that's a bit puzzling. To clarify, the BASS_CONFIG_NET_PREBUF setting should be applied before the BASS_StreamCreateURL call, and the BASS_ATTRIB_NET_RESUME setting should be applied after the call, ie. when you have a stream handle to use in the BASS_ChannelSetAttribute call. Is that what you did, and found it not to work? If so, did the calls report success in their return values?

motomart

  • Posts: 4
Re: BASS for Android
« Reply #367 on: 22 Jul '13 - 13:55 »
Ian, I have the BASS_ATTRIB_NET_RESUME just before BASS.BASS_ChannelPlay call and everything is good. Looks like the attribute need to be set every time it starts buffering from 0.
Thank you for your help!

                  

Dodge

  • Posts: 32
Re: BASS for Android
« Reply #368 on: 25 Jul '13 - 20:39 »
Hey there,

are NVIDIA Tegra 3 (and maybe similar) CPUs are not supported?

We get some reports, that the app crashes on a LG P880 with a Tegra 3 CPU when starting Music.


Can someone confirm this? (We'll try to get some more infos from the users but wanted to ask here first to be sure - if the user does not want to "help" :X)

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #369 on: 26 Jul '13 - 16:33 »
I haven't seen any other reports of problems with Nvidia Tegra 3 CPUs so far. It's an ARMv7 CPU, so it ought to work the same as any other ARMv7 CPU. Do you have any details on the crash? If not, you could use something like ACRA to get that.

Dodge

  • Posts: 32
Re: BASS for Android
« Reply #370 on: 27 Jul '13 - 06:55 »
Thank you for your fast reply.

Currently we don't have any details on the crash. somehow ACRA didn't got informations on the crash, maybe somewhere is a catch (i'll check) that stops the exception.

we asked the user to get a logcat but until now he didn't answer :(

Dodge

  • Posts: 32
Re: BASS for Android
« Reply #371 on: 29 Jul '13 - 07:19 »
still no answer by the user :/


but i got another question. My App has an alarm clock feature, and currently it uses the MUSIC Stream of Android. is there a way to tell BASS to go on the ALARM Stream?

like the default media play can be set to ALARM like this

      mediaPlayer = new MediaPlayer();
      mediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);


thanks in advance:)

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #372 on: 29 Jul '13 - 15:44 »
but i got another question. My App has an alarm clock feature, and currently it uses the MUSIC Stream of Android. is there a way to tell BASS to go on the ALARM Stream?

That wasn't possible previously, but I have put up an update (in the 1st post) that adds a "Default (alarm)" device (use device=2 in the BASS_Init call), which outputs on the ALARM stream. To use both MUSIC and ALARM streams, you would call BASS_Init with device=1 (or -1) and again with device=2, and then use BASS_SetDevice to switch the device context as needed.

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: BASS for Android
« Reply #373 on: 1 Aug '13 - 17:15 »
The latest version (2.4.1.1) of the BASSOPUS add-on is now up in the first post.

Dodge

  • Posts: 32
Re: BASS for Android
« Reply #374 on: 11 Aug '13 - 20:28 »
but i got another question. My App has an alarm clock feature, and currently it uses the MUSIC Stream of Android. is there a way to tell BASS to go on the ALARM Stream?

That wasn't possible previously, but I have put up an update (in the 1st post) that adds a "Default (alarm)" device (use device=2 in the BASS_Init call), which outputs on the ALARM stream. To use both MUSIC and ALARM streams, you would call BASS_Init with device=1 (or -1) and again with device=2, and then use BASS_SetDevice to switch the device context as needed.

thank you for the update! :)

i'm just back from my holidays and will test it in the next few days.