Author Topic: BASS for Android  (Read 390233 times)

Dodge

  • Posts: 32
Re: BASS for Android
« Reply #375 on: 12 Aug '13 - 23:28 »
Hello,

not sure if i do something wrong, but the alarm devide does not work.


while initializing i do:
Quote
BASS.BASS_Init(MUSIC_DEVICE, 44100, 0);
BASS.BASS_Init(ALARM_DEVICE, 44100, 0);

and before BASS.BASS_StreamCreateURL i do

Quote
BASS.BASS_SetDevice(isMusic ? MUSIC_DEVICE : ALARM_DEVICE);

while i use this values
Quote
private static final int MUSIC_DEVICE = 1;
private static final int ALARM_DEVICE = 2;

the MUSIC device works but the ALARM does not. there is no error, just no sound.

tested on Galaxy Nexus (4.2.2 - CM 10.1 20130811 nightly) and Genymotion emulator with 4.2.2


thanks in advance

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #376 on: 13 Aug '13 - 14:11 »
That's strange. Is the alarm level turned up in the Android volume settings? Can you hear sound from other apps that you know to be using the ALARM stream?

Dodge

  • Posts: 32
Re: BASS for Android
« Reply #377 on: 13 Aug '13 - 16:45 »
yes, i hear the sound with other apps using ALARM device

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #378 on: 13 Aug '13 - 17:52 »
OK. I will send you a debug version to get some info on what's happening.

Dodge

  • Posts: 32
Re: BASS for Android
« Reply #379 on: 15 Aug '13 - 06:49 »
Hello,

not sure if i do something wrong, but the alarm devide does not work.


while initializing i do:
Quote
BASS.BASS_Init(MUSIC_DEVICE, 44100, 0);
BASS.BASS_Init(ALARM_DEVICE, 44100, 0);

and before BASS.BASS_StreamCreateURL i do

Quote
BASS.BASS_SetDevice(isMusic ? MUSIC_DEVICE : ALARM_DEVICE);

while i use this values
Quote
private static final int MUSIC_DEVICE = 1;
private static final int ALARM_DEVICE = 2;

the MUSIC device works but the ALARM does not. there is no error, just no sound.

tested on Galaxy Nexus (4.2.2 - CM 10.1 20130811 nightly) and Genymotion emulator with 4.2.2


thanks in advance

As we found the issue, i'll post it for everyone else...

it is related to threading... ;)

i had started the music and setVolume(0) on Thread 1
and then on another thread i did a volume fade in over X seconds, but on the other thread the setVolume did not work because the device context on this thread was set to the wrong device.

fix: in the volume fade in thread, i had to add a SetDevice call to set the correct device...


Big Thanks to Ian, for "wasting" his time with this absolutly stupid mistake :D

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #380 on: 21 Aug '13 - 17:06 »
A BASS library update that adds support for IMA/DVI ADPCM WAVE files is now up in the first post.

Dodge

  • Posts: 32
Re: BASS for Android
« Reply #381 on: 31 Aug '13 - 17:58 »
Hey :)

is it possible to play files with urls like "content://settings/system/alarm_alert" or "content://media/internal/audio/media/127"? :)

i tried with BASS_StreamCreateFile and BASS_StreamCreateURL but both gave me BASS_ERROR_FILEOPEN :(

goobliata

  • Posts: 26
Re: BASS for Android
« Reply #382 on: 2 Sep '13 - 04:21 »
I'm having the same problem as someone had earlier with BASSMIDI (only on Android from what I've tested.) There's a horn in this MIDI and it sounds very loud and noisy. I'm using the very latest build from the first post.

xaviandroid

  • Posts: 1
Re: BASS for Android
« Reply #383 on: 2 Sep '13 - 15:49 »
Hello,
is there any example for streaming mp4 file from an url, using BASS_AAC functions as BASS_MP4_StreamCreateFileUser, since there is no function BASS_MP4_StreamCreateURL

goobliata

  • Posts: 26
Re: BASS for Android
« Reply #384 on: 2 Sep '13 - 16:48 »
Ok, here's a tip if you're experiencing the loud noisy midi: Awave Studio seems to "sanitize" soundfonts when you save them. All I did was load mine, save it, and now my MIDI plays fine. I have lots of other MIDIs I need to play, hopefully this has fixed all the instruments.

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #385 on: 2 Sep '13 - 17:17 »
I'm having the same problem as someone had earlier with BASSMIDI (only on Android from what I've tested.) There's a horn in this MIDI and it sounds very loud and noisy. I'm using the very latest build from the first post.

Is the problem only happening with particular SF2 file(s)? If so, please upload an example troublesome SF2 file, along with a MIDI file that produces the problem with it, to have a look at here...

   ftp.un4seen.com/incoming/

is there any example for streaming mp4 file from an url, using BASS_AAC functions as BASS_MP4_StreamCreateFileUser, since there is no function BASS_MP4_StreamCreateURL

When first released, the BASS_AAC add-on didn't support streaming of MP4 files, but I think support has since been added (depending on the file's atom order). To take advantage of that, you need to either enable the BASS_CONFIG_AAC_MP4 option (via BASS_SetConfig) and use BASS_AAC_StreamCreateURL, or load BASS_AAC as a plugin via BASS_PluginLoad and use BASS_StreamCreateURL. The latter is generally the preferred option if you will be playing other file formats too, ie. a single BASS_StreamCreateURL call can handle multiple formats.

goobliata

  • Posts: 26
Re: BASS for Android
« Reply #386 on: 2 Sep '13 - 19:12 »
Is the problem only happening with particular SF2 file(s)? If so, please upload an example troublesome SF2 file, along with a MIDI file that produces the problem with it, to have a look at here...

   ftp.un4seen.com/incoming/

Uploaded. As I said Awave Studio seems to have cleaned up the soundfont, but maybe it's still helpful to you.

iancast

  • Posts: 42
Re: BASS for Android
« Reply #387 on: 3 Sep '13 - 15:35 »
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)

Hello,

I know it's been a while but I can confirm on my side that my two applications using BASS for Android work properly on Tegra 3 CPUs (i.e. Nexus 7 2012, HTC One X). One app is basically streaming audio from internet streams and can also record short audio clips; the other uses pretty much everything in BASS (all audio formats, BASS_FX, BASSMIX, etc.)

We only have problems with the Samsung Galaxy S4 so far.

Hope that helps

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #388 on: 3 Sep '13 - 16:21 »
Uploaded. As I said Awave Studio seems to have cleaned up the soundfont, but maybe it's still helpful to you.

Unfortunately, the uploaded retro.sf2 file appears to be corrupt/incomplete. Could you please try uploading it again, or perhaps provide a link to it? Just to be clear, it should be the original file (not the Awave version).

I know it's been a while but I can confirm on my side that my two applications using BASS for Android work properly on Tegra 3 CPUs (i.e. Nexus 7 2012, HTC One X). One app is basically streaming audio from internet streams and can also record short audio clips; the other uses pretty much everything in BASS (all audio formats, BASS_FX, BASSMIX, etc.)

We only have problems with the Samsung Galaxy S4 so far.

Have you been able to narrow it down to a particular BASS function call that the crash is happening in? If you have a device available that you can reproduce the problem with, I could send you a debug BASS version to get some more info on what's going on.

goobliata

  • Posts: 26
Re: BASS for Android
« Reply #389 on: 5 Sep '13 - 00:51 »
I uploaded retro.sf2 again. I can't provide a link to it since it's a commercial soundfont.

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #390 on: 5 Sep '13 - 13:05 »
Thanks, got the file successfully now. Unfortunately, it looks like there was a problem with the castle.mid upload too; perhaps the original uploads were in ASCII mode? Could you upload that file again too, or just confirm which of the soundfont's preset(s) are affected by the problem?

goobliata

  • Posts: 26
Re: BASS for Android
« Reply #391 on: 5 Sep '13 - 14:29 »
Uploaded castle.mid again.

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #392 on: 5 Sep '13 - 16:00 »
Thanks, got that file successfully now too. I don't seem to be able to reproduce the problem that you described though, ie. the castle.mid file seems to sound fine. Should the problem be obvious or is it subtle? If the latter, at what position in the file does it occur? Did you definitely upload the original soundfont, not the one that you cleaned up with Awave? If so, please see if you can reproduce the problem with the MIDITEST example that's included in the Android BASS package. Please also check that you are using the latest BASSMIDI libraries included in the package.

goobliata

  • Posts: 26
Re: BASS for Android
« Reply #393 on: 5 Sep '13 - 17:52 »
I'm not developing on Android right now but when I am I'll try MIDITEST. I was running on an OUYA, not that it should make a difference? I'm 99.9% sure you got the original soundfont.

iancast

  • Posts: 42
Re: BASS for Android
« Reply #394 on: 5 Sep '13 - 18:18 »
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

Hello Ian,

We finally got around to fix the issue with the Samsung Galaxy S4. I built the Java NetRadio sample and it was working fine; then I could reproduce the crash using Xamarin.Android with pretty much the same code in C#.

They fixed the bug in the latest release (4.8.1) and now our app works without any issue on Samsung Galaxy S4. Someone with a Galaxy Tab 10.1 contacted us for the same issue; hopefully the Xamarin patch will fix this too (we don't have that tablet at work).

Hope that might help other people. Thanks!

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #395 on: 6 Sep '13 - 14:20 »
Excellent! Thanks for the fix report.

tom128

  • Posts: 9
Re: BASS for Android
« Reply #396 on: 9 Sep '13 - 07:33 »
I've tested your MidiTest example and is working well and I'm trying to apply this to my current midi player project.   I've included same library as MidiTest and used BASSMIDI.BASS_MIDI_StreamCreateFile (...)  to open midi file and BASS.BASS_ChannelPlay(...) starts midi playing well with the loaded soundfonts.   But I don't find way to stop midi playing.   I've tried BASS.BASS_ChannelPause(), ..ChannelStop,  BASS_Stop(), BASS_Pause().  None of these work.  I guessed these are the right replacement of MediaPlayer's start() and pause().   Pls. help me!

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #397 on: 9 Sep '13 - 16:11 »
That's strange, all 4 of the functions you list should stop playback. Please check the return values, and error codes via BASS_ErrorGetCode.

tom128

  • Posts: 9
Re: BASS for Android
« Reply #398 on: 10 Sep '13 - 05:31 »
Sorry, it was my programming mistake.  All those functions work well.   Great library!  But I have one question.   My current midi player is based on android MediaPlayer class.   Is there a way to use BASS while I still keep my current codes using MediaPlayer class ?

Ian @ un4seen

  • Administrator
  • Posts: 20393
Re: BASS for Android
« Reply #399 on: 10 Sep '13 - 17:37 »
I haven't tried it myself, but I think it should be possible to use both BASS playback and MediaPlayer playback in an app. Is it not working, or did you mean something more than that?