Author Topic: BASS for Android  (Read 422744 times)

kenumir

  • Posts: 7
Re: BASS for Android
« Reply #1425 on: 18 Jul '18 - 13:59 »
Problem with null pointer exception when init BASS:
Code: [Select]
java.lang.NullPointerException: Attempt to invoke interface method 'int com.android.internal.app.IAppOpsService.checkAudioOperation(int, int, int, java.lang.String)' on a null object reference
        at android.media.AudioTrack.isRestricted(AudioTrack.java:1602)
        at android.media.AudioTrack.play(AudioTrack.java:1580)
        at com.un4seen.bass.BASS.BASS_Init(BASS.java:-2)

Latest version from forum.

Ian @ un4seen

  • Administrator
  • Posts: 21020
Re: BASS for Android
« Reply #1426 on: 18 Jul '18 - 15:49 »
Please post your BASS_Init call, and also confirm what Android version you're running on and/or if you've reproduced the problem on multiple devices.

kenumir

  • Posts: 7
Re: BASS for Android
« Reply #1427 on: 18 Jul '18 - 22:20 »
Device:
Code: [Select]
Huawei Mate 8 (HUAWEI NXT-L09)
Android 6.0

Init:
Code: [Select]
BASS.BASS_Init(-1, 44100, BASS.BASS_DEVICE_FREQ | BASS.BASS_DEVICE_16BITS | BASS.BASS_DEVICE_AUDIOTRACK)
Cannot reproduce this on my devices. Came from bug report system. For now only once.

Ian @ un4seen

  • Administrator
  • Posts: 21020
Re: BASS for Android
« Reply #1428 on: 19 Jul '18 - 15:46 »
OK. It looks like the problem happened inside an AudioTrack.play call so I've added a check to that, which should catch the exception and have the BASS_Init call fail (with BASS_ERROR_UNKNOWN) instead. The BASS update is in the 1st post. Let me know if you see the problem happen again with that.

jnyang

  • Guest
Re: BASS for Android
« Reply #1429 on: 29 Jul '18 - 08:24 »
Hi, Ian.

I am currently trying to update the BASS library of my Android app to use the capability of Android's built-in codecs like AAC.
However, it seems that the BASS library crashes (signal 11 (SIGSEGV)) when opening M4A files with enabling floating-point sampling like the followings:

Code: [Select]
BASS.BASS_StreamCreateFile('/path/to/file/file.m4a, 0, 0, BASS.BASS_SAMPLE_LOOP|BASS.BASS_SAMPLE_FLOAT)
It is tested with the "fxtest" sample code on various Android devices, e.g., Samsung Galaxy A8 (2018), and all the test devices I have crashed.
Without the "BASS_SAMPLE_FLOAT" flag, the app plays the file without any errors.

Could you check whether it is a bug of the BASS library or not?
Thanks in advance for your help. :D

otherside

  • Posts: 34
Re: BASS for Android
« Reply #1430 on: 31 Jul '18 - 11:50 »
Hello.
I got reports from users that a crash happens in BASS_MusicLoad().
Can you please return 0 instead of native expection? Because it is impossible to handle, app crashes. I cannot reproduce it, unfortunately.
« Last Edit: 31 Jul '18 - 12:51 by otherside »

Ian @ un4seen

  • Administrator
  • Posts: 21020
Re: BASS for Android
« Reply #1431 on: 31 Jul '18 - 14:41 »
I am currently trying to update the BASS library of my Android app to use the capability of Android's built-in codecs like AAC.
However, it seems that the BASS library crashes (signal 11 (SIGSEGV)) when opening M4A files with enabling floating-point sampling like the followings:

Code: [Select]
BASS.BASS_StreamCreateFile('/path/to/file/file.m4a, 0, 0, BASS.BASS_SAMPLE_LOOP|BASS.BASS_SAMPLE_FLOAT)
It is tested with the "fxtest" sample code on various Android devices, e.g., Samsung Galaxy A8 (2018), and all the test devices I have crashed.
Without the "BASS_SAMPLE_FLOAT" flag, the app plays the file without any errors.

Oops! Here's an update that should fix that:

   www.un4seen.com/stuff/bass-android-test.zip

Let me know if you still get the problem happening with that.

I got reports from users that a crash happens in BASS_MusicLoad().
Can you please return 0 instead of native expection? Because it is impossible to handle, app crashes. I cannot reproduce it, unfortunately.

If you have got crash logs, please post one to have a look at. If not, are you using some other logging to confirm that it is crashing in a BASS_MusicLoad call? Also, do you know what files the users were trying to load, and if so, can you get them from the users?

jnyang

  • Guest
Re: BASS for Android
« Reply #1432 on: 1 Aug '18 - 00:04 »
Oops! Here's an update that should fix that:

   www.un4seen.com/stuff/bass-android-test.zip

Let me know if you still get the problem happening with that.

Now it works without any errors. Thanks, Ian!  :)

otherside

  • Posts: 34
Re: BASS for Android
« Reply #1433 on: 1 Aug '18 - 09:08 »
h the "fxtest" sample code on various Android devices, e.g., Samsung Galaxy A8
If you have got crash logs, please post one to have a look at. If not, are you using some other logging to confirm that it is crashing in a BASS_MusicLoad call? Also, do you know what files the users were trying to load, and if so, can you get them from the users?

Here's log
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.mp3.player <<<

backtrace:
  #00  pc 0000000000022aa4  /data/app/com.mp3.player-1/lib/arm/libbass.so (BASS_MusicLoad+219)
  #01  pc 0000000000d0e0bb  /data/app/com.mp3.player-1/oat/arm/base.odex

Ian @ un4seen

  • Administrator
  • Posts: 21020
Re: BASS for Android
« Reply #1434 on: 1 Aug '18 - 14:00 »
Now it works without any errors. Thanks, Ian!  :)

Great! The BASS update is now up in the 1st post.

Here's log
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.mp3.player <<<

backtrace:
  #00  pc 0000000000022aa4  /data/app/com.mp3.player-1/lib/arm/libbass.so (BASS_MusicLoad+219)
  #01  pc 0000000000d0e0bb  /data/app/com.mp3.player-1/oat/arm/base.odex

Please post the signal/code info and registers (r0/etc) from the crash log too, and confirm what BASS version was used (use BASS_GetVersion to check that).

otherside

  • Posts: 34
Re: BASS for Android
« Reply #1435 on: 2 Aug '18 - 11:39 »
Please post the signal/code info and registers (r0/etc) from the crash log too, and confirm what BASS version was used (use BASS_GetVersion to check that).
Unfortunately the message above is the only I have.
bass version = 33819916, bassFx version = 33819649

Ian @ un4seen

  • Administrator
  • Posts: 21020
Re: BASS for Android
« Reply #1436 on: 2 Aug '18 - 15:01 »
OK. From that, I see where the crash happened but unfortunately not why it happened. Are you in contact with any affected users? If so, can you ask them to send you a file that the crash happened with, and also confirm if the crash happens every time that they try to play that file?