25 May '13 - 19:57 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: 1 ... 4 5 [6] 7 8 ... 18
  Reply  |  Print  
Author Topic: BASS for Android  (Read 48353 times)
AndroidMediaPlayer
Guest
« Reply #100 on: 16 Mar '12 - 21:45 »
Reply with quoteQuote

Nope, it still stutters, realy heavy. Don't know why it worked for a moment. I am adjusting BASS_CONFIG_DEV_BUFFER bevor BASS_Init. And other Players are not affected. :/
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #101 on: 19 Mar '12 - 15:16 »
Reply with quoteQuote

OK. I think I will have to send you a debug version to find out what's going on. For an idea of where to look, please confirm what BASS functions you are using and any config (BASS_SetConfig) settings. Also, you mentioned callbacks. Is that BASS callbacks (SYNCPROC/etc), and if so, does removing them make any difference?
Logged
AndroidMediaPlayer
Posts: 13


« Reply #102 on: 20 Mar '12 - 02:46 »
Reply with quoteQuote

So, got an account now! Smiley

The methods i am using:

BASS_StreamCreateFile
BASS_Init
BASS_ChannelBytes2Seconds
BASS_ChannelGetLength
BASS_ChannelGetPosition
BASS_ChannelGetInfo
BASS_ChannelGetData
BASS_ChannelIsActive
BASS_StreamFree
BASS_ChannelSeconds2Bytes
BASS_ChannelSetPosition
BASS_ChannelStop
BASS_StreamCreate
BASS_ChannelPlay
BASS_ChannelPause
BASS_SetConfig
BASS_PluginLoad
BASS_ChannelSetAttribute
BASS_ChannelRemoveFX
BASS_ChannelSetFX
BASS_FXSetParameters

Config: only BASS_CONFIG_DEV_BUFFER for testing.

Callbacks: STREAMPROC with BASS_StreamCreate, other Callbacks are JNI Callbacks used for updating infos like current play time, etc...

Removing them doesn't make any difference. Even this simple code stutters...:

BASS_Init(-1,44100,0,NULL,NULL);
char *file = "/sdcard/music/file_to_play.mp3";
HSTREAM stream = BASS_StreamCreateFile(FALSE, file, 0, 0, 0);
BASS_ChannelPlay(stream, FALSE);

A debug version would be nice.

Edit: Uhh, the whole playback stopped after switching two apps... Oo
« Last Edit: 20 Mar '12 - 11:54 by AndroidMediaPlayer » Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #103 on: 20 Mar '12 - 15:09 »
Reply with quoteQuote

OK, I will send over a debug version shortly.
Logged
toob
Posts: 112


« Reply #104 on: 21 Mar '12 - 14:56 »
Reply with quoteQuote

Is it still the case that the only DX8 effect that currently supported in android bass is PARAMEQ?
Will the other effects be added, ie echo, distortion etc?

Yes, PARAMEQ is currently the only DX8 effect supported on Android, but the others may well be added in future. I'll have a look at that next week.

Also I have a requirement to play a stream in reverse, is this something that can be done in bass android now or will I need to wait for BASS_FX for android?

It is possible to implement the reverse processing yourself, using a decoding channel (BASS_STREAM_DECODE) to decode the file and a custom stream (BASS_StreamCreate) to play it. Your STREAMPROC function would decode a block of data from the end of the file and reverse the order of the samples in it. It would then deliver the data to BASS as it is requested, and when it's finished that, it would set (using BASS_ChannelSetPosition) the decoder back to the next block and repeat. If you will be playing MP3 files, then you should use the BASS_STREAM_PRESCAN flag when doing this, to enable accurate seeking.

Hi Ian

Is there any news on when the additional PARAMEQ effects will be available?

Also will it be possible to implement BassFx.BASS_FX_TempoCreate stream in android?

Just revisiting the reverse effect, will  BASS_FX  be added at some point as I have that working in my .Net program which I'm trying to port to android, but struggling to achieve using the methods you described above. If BASS_FX is a long way off could you steer me in the direction of some sample code perhaps?

thanks
Mark
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #105 on: 21 Mar '12 - 16:14 »
Reply with quoteQuote

Is there any news on when the additional PARAMEQ effects will be available?

Support for the other effects has now been added, and an update should be available here shortly (probably tomorrow). Just testing it a bit first Smiley

Also will it be possible to implement BassFx.BASS_FX_TempoCreate stream in android?

Just revisiting the reverse effect, will  BASS_FX  be added at some point as I have that working in my .Net program which I'm trying to port to android, but struggling to achieve using the methods you described above. If BASS_FX is a long way off could you steer me in the direction of some sample code perhaps?

I think the availability of a complete Android port of BASS_FX is still some way off at the moment (it requires quite a bit of modification to use fixed-point instead of floating-point), but I guess it may be possible to have a partial port sooner. Regarding sample code for reversing, here is the original code that BASS_FX's reverse processing is based on...

   www.un4seen.com/forum/?topic=897.msg4764#msg4764
Logged
toob
Posts: 112


« Reply #106 on: 23 Mar '12 - 16:37 »
Reply with quoteQuote

Quote

I think the availability of a complete Android port of BASS_FX is still some way off at the moment (it requires quite a bit of modification to use fixed-point instead of floating-point), but I guess it may be possible to have a partial port sooner. Regarding sample code for reversing, here is the original code that BASS_FX's reverse processing is based on...

   www.un4seen.com/forum/?topic=897.msg4764#msg4764

Thanks Ian, Converting that reverse code looks to be a bit beyond my experience specially being new to Java and not a C programmer either. I guess I'll have to wait for the partial port of BASS_FX. I'd be ideally looking for the reverse and  tempocreate functions  Grin

Would you update the date of the android download on page 1 when the DX8 update has been added then I will give it a go?

thanks again.
Mark
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #107 on: 23 Mar '12 - 18:09 »
Reply with quoteQuote

The update including the other DX8 effects (CHORUS/DISTORTION/ECHO/FLANGER/REVERB) is now up in the 1st post. The effects seem to be working quite nicely so far, but please report if you encounter any problems with them.
Logged
toob
Posts: 112


« Reply #108 on: 23 Mar '12 - 18:41 »
Reply with quoteQuote

The update including the other DX8 effects (CHORUS/DISTORTION/ECHO/FLANGER/REVERB) is now up in the 1st post. The effects seem to be working quite nicely so far, but please report if you encounter any problems with them.

Brilliant!

I can confirm that echo, distortion, chorus & flanger all work perfectly for me, big thanks.

Without seeming to be two pushy, when you say BASS_FX is still some way off would we be talking about more than a month away. Reason being is that I'd hold off on publishing this app if there was a chance it was on it's way in round about that time frame?

Mark Grin
« Last Edit: 24 Mar '12 - 15:13 by toob » Logged
slaveoffear
Posts: 4


« Reply #109 on: 26 Mar '12 - 22:52 »
Reply with quoteQuote

Hi

When will support formats (Add-ons): BASS_ALAC, BASS_APE, BASS_TTA, BASSWMA and maybe effect "stereo enhancer"?
« Last Edit: 27 Mar '12 - 11:47 by slaveoffear » Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #110 on: 27 Mar '12 - 17:25 »
Reply with quoteQuote

Without seeming to be two pushy, when you say BASS_FX is still some way off would we be talking about more than a month away. Reason being is that I'd hold off on publishing this app if there was a chance it was on it's way in round about that time frame?

I'll check with Arthur to see what can be done.

When will support formats (Add-ons): BASS_ALAC, BASS_APE, BASS_TTA, BASSWMA and maybe effect "stereo enhancer"?

A BASS_ALAC port is now up in the first post. Unfortunately, I don't think a BASSWMA port will be possible as the required libraries (eg. WMVCORE) aren't available on Android. I think a BASS_APE port will be possible but the core Monkey's Audio decoder needs some modification first. I'll look into that.
Logged
slaveoffear
Posts: 4


« Reply #111 on: 28 Mar '12 - 09:59 »
Reply with quoteQuote

A BASS_ALAC port is now up in the first post.

Thanks so much

Unfortunately, I don't think a BASSWMA port will be possible as the required libraries (eg. WMVCORE) aren't available on Android.

WMA is not very important, if difficult to do

I think a BASS_APE port will be possible but the core Monkey's Audio decoder needs some modification first. I'll look into that.

I will wait
Logged
slaveoffear
Posts: 4


« Reply #112 on: 29 Mar '12 - 20:21 »
Reply with quoteQuote

I want to EQ without distortion, preamp and other effects.

BASS_FX better to use? When do you plan to share BASS_FX?
Logged
Mr.Green
Posts: 3


« Reply #113 on: 1 Apr '12 - 20:31 »
Reply with quoteQuote

Hi. Greate lib! Many thanks.

I tried to use 10-band equalizer. There are a lot of distursion on high db. I have read on this forum, that compressor effect could help. But I found out that it's not working now. When do you play to implement compressor effect for Android?

And second question about id3 tags. Do you plan to implement read/write album covers? It's realy needed.
Logged
AndroidMediaPlayer
Posts: 13


« Reply #114 on: 3 Apr '12 - 00:09 »
Reply with quoteQuote

Ian, do you have some plans to port Tags to other platforms? Or why is it only available for Windows? Smiley
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #115 on: 3 Apr '12 - 18:10 »
Reply with quoteQuote

I think a BASS_APE port will be possible but the core Monkey's Audio decoder needs some modification first. I'll look into that.

I will wait

An Android version of the BASS_APE add-on is now up in the first post. Note CPU usage can be quite high with some APE files (compared to other formats). That's true on all platforms, but it's more significant on a low powered mobile device than a high powered desktop system.

I want to EQ without distortion, preamp...

Distortion can result if the EQ takes the level of the sample data out of range. A preamp control can be used to bring it back into range, and that can be implemented via a DSP function, something like this...

int preamp; // gain in 8.24 fixed-point (0x1000000=normal)

BASS.DSPPROC PreAmpDsp=new BASS.DSPPROC() {
public void DSPPROC(int handle, int channel, ByteBuffer buffer, int length, Object user) {
if (preamp==0x1000000) return; // nothing to do
buffer.order(null); // little-endian byte order
IntBuffer ibuffer=buffer.asIntBuffer();
int[] b=new int[length/4]; // allocate an "int" array for the sample data
ibuffer.get(b); // get the data from the buffer into the array
for (int a=0; a<length/4; a++) {
long s=b[a]; // get a sample from the array
s=(s*preamp)>>24; // apply the preamp gain
b[a]=(int)s; // put the result back in the array
}
ibuffer.rewind();
ibuffer.put(b); // put the array back into the buffer
}
};

...

BASS.BASS_SetConfig(BASS.BASS_CONFIG_FLOATDSP, 1); // enable 8.24 fixed-point DSP

...

preamp=0x1000000; // start with normal gain
BASS.BASS_ChannelSetDSP(handle, PreAmpDsp, null, 1000); // set the preamp DSP on a BASS channel

You can then adjust the gain via the "preamp" value. Enabling the BASS_CONFIG_FLOATDSP option allows the data to flow through the effects without being clipped, as well as simplifying the DSP code.

I tried to use 10-band equalizer. There are a lot of distursion on high db. I have read on this forum, that compressor effect could help. But I found out that it's not working now. When do you play to implement compressor effect for Android?

In its emulated DX8 efects, BASS tries to match the original DX8/Windows effects, but the DX8 compressor effect is a bit buggy, so BASS doesn't currently bother to emulate that. You could try using the preamp DSP above to lower the level and avoid the distortion.

And second question about id3 tags. Do you plan to implement read/write album covers? It's realy needed.

No, I'm afraid there are currently no plans for built-in support for reading/writing album covers in ID3 tags, but perhaps there are other libraries/classes that can be used to provide that functionality.

Ian, do you have some plans to port Tags to other platforms? Or why is it only available for Windows? Smiley

The Tags add-on has some Windows-specific stuff, but I think it should be possible to add support for other platforms. I'll look into it.
Logged
toob
Posts: 112


« Reply #116 on: 4 Apr '12 - 08:59 »
Reply with quoteQuote

Without seeming to be two pushy, when you say BASS_FX is still some way off would we be talking about more than a month away. Reason being is that I'd hold off on publishing this app if there was a chance it was on it's way in round about that time frame?

I'll check with Arthur to see what can be done.

Have you had a response back from Arthur? Just need the reverse and tempo elements...
Logged
Mr.Green
Posts: 3


« Reply #117 on: 5 Apr '12 - 09:28 »
Reply with quoteQuote

You could try using the preamp DSP above to lower the level and avoid the distortion.

Thanks a lot! That's working perfect for Android >= 2.3. But for Android 2.2 when I use decode mode DSP doesn't work. I tried to set preamp after decoding and before writing to AudioTrack. In my right headphone it's working, but in my left headphone is only noise. Here is my code for Android 2.2:

mChan=BASS.BASS_StreamCreateFile(songPath, 0, 0, BASS.BASS_MUSIC_DECODE);
...
length = BASS.BASS_ChannelGetData(mChan, buffer, buffer.capacity());
if (length > 0) {
  buffer.order(null); // little-endian byte order
  IntBuffer ibuffer = buffer.asIntBuffer();
  int[] b=new int[length / 4]; // allocate an "int" array for the sample data
  ibuffer.get(b); // get the data from the buffer into the array
  for (int a = 0; a < length / 4; a++) {
  long s = b[a]; // get a sample from the array
  s=(s*mPreamp)>>24; // apply the preamp gain
  b[a]=(int)s; // put the result back in the array
}
ibuffer.rewind();
ibuffer.put(b);
                                   
mTrack.write(buffer.array(), 0, length);
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #118 on: 5 Apr '12 - 17:48 »
Reply with quoteQuote

The problem there is that the preamp code is expecting 8.24 fixed-point data, but you will probably be getting 16-bit data from the BASS_ChannelGetData call. The preamp code also actually needs to be in a DSP function for it to have the desired effect on the EQ; it is too late once the data has been converted back to 16-bit. DSP will be applied in a BASS_ChannelGetData call, so there is no need to deviate from the original code in this case.

Meanwhile... a partial BASS_FX port is now up in the first post. The reverse/tempo/bpm/beat stuff is included, but not the BASS_FX_BFX_xxx effects, which need more work regarding conversion to fixed-point. One difference to note compared to other platforms is that the BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO option is enabled by default on tempo streams for lower CPU usage, but it can be disabled via BASS_ChannelSetAttribute if wanted. A BASS library update is also up in the first post, which is required by the BASS_FX port.
Logged
Mr.Green
Posts: 3


« Reply #119 on: 5 Apr '12 - 19:43 »
Reply with quoteQuote

The problem there is that the preamp code is expecting 8.24 fixed-point data, but you will probably be getting 16-bit data from the BASS_ChannelGetData call. The preamp code also actually needs to be in a DSP function for it to have the desired effect on the EQ; it is too late once the data has been converted back to 16-bit. DSP will be applied in a BASS_ChannelGetData call, so there is no need to deviate from the original code in this case.

That's working. I just forget to apply DSP=)
Logged
Pages: 1 ... 4 5 [6] 7 8 ... 18
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines