Author Topic: BASS for Android  (Read 619150 times)

Ian @ un4seen

  • Administrator
  • Posts: 22051
Re: BASS for Android
« Reply #1625 on: 5 Sep '19 - 14:42 »
To perhaps narrow down where the problem is, please try this latest build:

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

If the problem still happens then check whether it also happens after adding the BASS_DEVICE_AUDIOTRACK flag to your BASS_Init call. If it happens then too, you can next try enabling AAudio output like this before calling BASS_Init (and don't use the BASS_DEVICE_AUDIOTRACK flag):

Code: [Select]
BASS.BASS_SetConfig(BASS.BASS_CONFIG_ANDROID_AAUDIO, 1); // enable AAudio

Ian @ un4seen

  • Administrator
  • Posts: 22051
Re: BASS for Android
« Reply #1626 on: 11 Sep '19 - 14:48 »
An updated version of BASS up now in the 1st post. It adds support for AAudio output (BASS_CONFIG_ANDROID_AAUDIO option), and allows a preallocated session ID (from audioManager.generateAudioSessionId) to be set via the BASS_CONFIG_ANDROID_SESSIONID option. It also adds support for some Android 10 features/restrictions. The ParcelFileDescriptor class can be used with the stream/sample/music creation funcions, which allows access to scoped storage (https://developer.android.com/training/data-storage/files/external-scoped). A new FloatValue class is introduced, which should be used instead of the standard Float class to receive float values via BASS function parameters (eg. with BASS_ChannelGetAttribute) because the Float class value can no longer be modified by native code in Android 10.

teq

  • Posts: 43
Re: BASS for Android
« Reply #1627 on: 13 Sep '19 - 12:20 »
Hi! Could you clarify about FloatValue, if am using .net wrapper on Android? Should i wait for an update of wrapper?

Ian @ un4seen

  • Administrator
  • Posts: 22051
Re: BASS for Android
« Reply #1628 on: 13 Sep '19 - 13:07 »
I'm not actually sure how the Float Java class change in Android 10 affects .Net. BASS.Net is using System.Single in its place. My guess would be that Xamarin will implement that in a way that isn't affected, so you can continue using it and there's no need for something like a separate FloatValue class.

teq

  • Posts: 43
Re: BASS for Android
« Reply #1629 on: 27 Sep '19 - 17:43 »
Hi there! What do you think about using bass with Flutter? Will it be convenient or pain with writing dart->java wrappers? =) 

Ian @ un4seen

  • Administrator
  • Posts: 22051
Re: BASS for Android
« Reply #1630 on: 30 Sep '19 - 17:21 »
I'm not familiar with Flutter, but if it allows you to use native libraries then it seems like it should be possible to use BASS with it.

BassPassion

  • Posts: 31
Re: BASS for Android
« Reply #1631 on: 3 Oct '19 - 20:41 »
Dart (the language used by Flutter), has an experimental(currently under development) support for native C bindings:
https://flutter.dev/docs/development/platform-integration/c-interop

You would have to be on the Dev Channel of Flutter, so I would say it's a moving target currently.
Having said that, I am tempted to have a go at it.

teq

  • Posts: 43
Re: BASS for Android
« Reply #1632 on: 6 Oct '19 - 17:02 »
Dart (the language used by Flutter), has an experimental(currently under development) support for native C bindings:
https://flutter.dev/docs/development/platform-integration/c-interop

You would have to be on the Dev Channel of Flutter, so I would say it's a moving target currently.
Having said that, I am tempted to have a go at it.
Correct me, if i wrong, but why don't just use java bass with flutter?

Ionut Cristea

  • Posts: 1549
Re: BASS for Android
« Reply #1633 on: 9 Oct '19 - 06:49 »
Hello,

I am experiencing some issues with latest BASS version. BASS_ACTIVE_PLAYING is returned by BASS_ChannelIsActive but no audio is heard. The channel is a PUSH_STREAM and it has enough data to play. This usually happens after pause / play. When the play command is sent, BASS_ACTIVE_PLAYING is returned but not audio. Also, it seems that it recovers if pause / play commands are send again. Note that this issue wasn't present on the previous BASS version.
Thank you.
« Last Edit: 9 Oct '19 - 06:52 by Ionut Cristea »

Ian @ un4seen

  • Administrator
  • Posts: 22051
Re: BASS for Android
« Reply #1634 on: 9 Oct '19 - 15:31 »
If you put the previous BASS library version back in (and change nothing else), does the problem go away? If so, please confirm your current and previous BASS version numbers (with BASS_GetVersion), to check what may have changed. Also confirm what BASS_ATTRIB_BUFFER setting you're using on the stream, and that it's a normal playback stream (doesn't have BASS_STREAM_DECODE set).

Ionut Cristea

  • Posts: 1549
Re: BASS for Android
« Reply #1635 on: 10 Oct '19 - 07:22 »
Hi Ian,
I can confirm that reverting to the old libs the problem is not showing.

BASS.BASS_GetVersion returns 33820164
BASS_ATTRIB_BUFFER is not set and also stream BASS_STREAM_DECODE is not set, its a normal playback stream
Please let me know if you have any other questions.


Ian @ un4seen

  • Administrator
  • Posts: 22051
Re: BASS for Android
« Reply #1636 on: 10 Oct '19 - 13:16 »
Is that version number the one that you're currently using or the previous one? In either case, please give the other one too, so that I can then check what changed between them. If your current version isn't the latest version (in the 1st post), please also try that.

Ionut Cristea

  • Posts: 1549
Re: BASS for Android
« Reply #1637 on: 10 Oct '19 - 17:24 »
33820164 version is the one of the current libs that are working. The ones that didn't worked were the one which i tried few days ago (were taken from the 1st post)

Ian @ un4seen

  • Administrator
  • Posts: 22051
Re: BASS for Android
« Reply #1638 on: 11 Oct '19 - 13:11 »
OK. The main difference since 2.4.14.4 (33820164) is that AAudio output is used by default (instead of OpenSLES) on Android 8.1 or above now. What Android version does your device have? If 8.1 or above, please try disabling AAudio (before calling BASS_Init) like this:

Code: [Select]
BASS.BASS_SetConfig(BASS.BASS_CONFIG_ANDROID_AAUDIO, 0); // disable AAudio

And see if the problem still happens then. You could also try AudioTrack output by adding BASS_DEVICE_AUDIOTRACK to your BASS_Init call. Also confirm whether the problem is only affecting "push" streams, or all streams?

Ionut Cristea

  • Posts: 1549
Re: BASS for Android
« Reply #1639 on: 11 Oct '19 - 15:13 »
I have tested with Android P & 10 and reproduced the issue. I will try your suggestions in few days. Thank you.