Author Topic: Regression inside latest version of BASS_FX (2.4.4.0)  (Read 7153 times)

nadia

  • Posts: 302
Hello  ;D

I've found a regression inside latest version of BASS_FX (2.4.4.0).
It seems that the BASS_ChannelGetPosition and BASS_ChannelSetPosition functions are no more accurate as they where in previous versions when dealing with a stream resampled through the BASS_FX_TempoCreate function.

In order to demonstrate the issue I've made a modification to the Tempo.exe project included with the BASS_FX package (uploaded into http://www.megaupload.com/?d=JFBX4A8U); inside this sample I've added a routine which displays (under the trackbar position) the position in bytes during playback respect to the overall stream size in bytes; I've also removed the BASS_SAMPLE_LOOP flag from the BASS_FX_TempoCreate function call in order to better display the problem.

As you will see, after loading the provided "short.wav" file (included inside the zip), playback will start and, when playback ends, the displayed position in bytes, returned by BASS_ChannelGetPosition is not the same value of the overall length in bytes returned by BASS_ChannelGetLength.

The BASS_ChannelSetPosition is not demonstrated in this sample but it seems to be affected also by a wrong positioning when called over the same stream resampled by BASS_FX_TempoCreate.

Any idea about the reason of this behavior?

Kind regards  ;D

Nadia
« Last Edit: 16 Apr '09 - 12:29 by nadia »

(: JOBnik! :)

  • Posts: 1065

nadia

  • Posts: 302
Hi ;D

Here's an update to try:
http://www.jobnik.org/files/bass_fx2441.zip

Hi JOBnik!  ;D

now it works perfectly when the source is a file on disk but it still doesn't behave correctly when the source is a memory buffer.
Please, find on the following link a modified version of the previous Tempo_pos project which demonstrates the issue: the selected sound file is read into a memory buffer and the buffer is then passed to the BASS_StreamCreateFile function.
http://www.megaupload.com/?d=GW3AP8GF

Kind regards  ;D

Nadia

(: JOBnik! :)

  • Posts: 1065
Hi ;D

Are you sure?
Your example works fine here ;)

nadia

  • Posts: 302
Hi ;D

Are you sure?
Your example works fine here ;)

Hi  ;D

yes, absolutely: I've tried with different files and all of them display the same result... strange that you cannot replicate it. Have you tried with the provided short.wav sample?

Kind Regards  ;D

Nadia
« Last Edit: 19 Apr '09 - 22:03 by nadia »

(: JOBnik! :)

  • Posts: 1065
Hi ;D

I've tested with so many files and of course with the one provided by you :)
And all of them showed the right position.

Are you sure, that you are using BASS_FX.DLL, that is provided in this link for both tests?
http://www.jobnik.org/files/bass_fx2441.zip

nadia

  • Posts: 302
Hi  ;D

yes, I've verified that the loaded version of BASS_FX is 2.4.4.1 and I've made a sligth modification of the sample in order to load from file and from memory using 2 different buttons; when I load the short.wav file directly, at the end of playback the reported position is identical to the channel length (819200 bytes); when I load the file into the memory buffer before loading it into BASS, at the end of playback the reported position is 811724 bytes only.

That said, I have tried with other WAV files and the problem effectively doesn't seem to happen but with the mentioned short.wav file the error is constant: I cannot understand what's different because all tested files are PCM 44100, stereo, 16 bits.

The modified sample is available on the link below:
http://www.megaupload.com/?d=N3NO1LYY

Kind Regards  ;D

Nadia

(: JOBnik! :)

  • Posts: 1065
Hi ;D

I don't know how it work there ;) here when I compile with Release option, all I get is crashes with your changes :)

Just increase the buffer :)
char c[100];

nadia

  • Posts: 302
Hi ;D

I don't know how it work there ;) here when I compile with Release option, all I get is crashes with your changes :)

Just increase the buffer :)
char c[100];

Hi  ;D

I didn't tried compiling in Release mode and in Debug mode the crash didn't happen; the crash as you reported is obviously caused by a buffer smaller then it should.

Anyway, the problem with the issue I reported with the short.wav file is still reproduced here: if I go back to version 2.4.2.0 the problem is not reproduced at all.

I've tried playing the mentioned short.wav file with different BASS_FX versions and here are displayed positions when playback ends:

- BASS_FX 2.4.2.0
  From file:       819200 /819200
  From memory: 819200 /819200

- BASS_FX 2.4.3.1
  From file:       811724 /819200
  From memory: 811724 /819200

- BASS_FX 2.4.4.0
  From file:       811724 /819200
  From memory: 811724 /819200

- BASS_FX 2.4.4.1
  From file:       819200 /819200
  From memory: 811724 /819200

Any idea?

Kind Regards  ;D

Nadia

(: JOBnik! :)

  • Posts: 1065
Hi ;D

At 1st I was testing only in Debug mode and all the tests were fine.
Then I thought to test it with Release mode, because I thought maybe you're doing that way and just got crashes all the time because of buffer c[30] was too small.

In all my tests and with all your examples:

- BASS_FX 2.4.4.1
  From file:       819200 /819200
  From memory: 819200 /819200

I'm testing on my system Vista Ultimate x64, but at evening I'll test it on XP x86.

nadia

  • Posts: 302
Re: Regression inside latest version of BASS_FX (2.4.4.0)
« Reply #10 on: 21 Apr '09 - 07:43 »
Hi ;D

At 1st I was testing only in Debug mode and all the tests were fine.
Then I thought to test it with Release mode, because I thought maybe you're doing that way and just got crashes all the time because of buffer c[30] was too small.

In all my tests and with all your examples:

- BASS_FX 2.4.4.1
  From file:       819200 /819200
  From memory: 819200 /819200

I'm testing on my system Vista Ultimate x64, but at evening I'll test it on XP x86.

Hi  ;D

all my tests were performed under WinXP Pro x86

Kind Regards  ;D

Nadia

(: JOBnik! :)

  • Posts: 1065
Re: Regression inside latest version of BASS_FX (2.4.4.0)
« Reply #11 on: 22 Apr '09 - 15:41 »
Hi ;D

Works fine here on WinXP Pro x86 and on Vista x64 ;-)
Ian has tested as well and couldn't reproduce the problem...

Did you try to test it and change the buffer to c[100]; ? Because I had different positions when it was too small.

Please test the attached precompiled 1st, after that I'll send you a debug version to test with :)

nadia

  • Posts: 302
Re: Regression inside latest version of BASS_FX (2.4.4.0)
« Reply #12 on: 22 Apr '09 - 17:31 »
Hi ;D

Works fine here on WinXP Pro x86 and on Vista x64 ;-)
Ian has tested as well and couldn't reproduce the problem...

Did you try to test it and change the buffer to c[100]; ? Because I had different positions when it was too small.

Please test the attached precompiled 1st, after that I'll send you a debug version to test with :)

Hi  ;D

yes, I changed the buffer but the problem was due to the fact that I was using an older version of BASS (not BASS_FX) 2.4.2.2 dated September 26, 2008 while the one you attached to the zip was 2.4.2.3 dated October 28, 2008, a version I wasn't aware of. By replacing BASS.DLL the problem disappeared without changing my compiled tempo_pos.exe.

Sorry for the trouble  ::)

Kind Regards  ;D

Nadia


(: JOBnik! :)

  • Posts: 1065
Re: Regression inside latest version of BASS_FX (2.4.4.0)
« Reply #13 on: 26 Apr '09 - 15:32 »
Hi ;D

Besides the incorrect end position, was there any problem with BASS_ChannelGet/SetPosition as well?
If so, please give more information :)

nadia

  • Posts: 302
Re: Regression inside latest version of BASS_FX (2.4.4.0)
« Reply #14 on: 26 Apr '09 - 16:55 »
Hi ;D

Besides the incorrect end position, was there any problem with BASS_ChannelGet/SetPosition as well?
If so, please give more information :)

Hi  ;D

after upgrading to the latest versions of BASS_FX and BASS I cannot see any further positioning issue: thanks for your help.

Kind regards  ;D

Nadia

(: JOBnik! :)

  • Posts: 1065
Re: Regression inside latest version of BASS_FX (2.4.4.0)
« Reply #15 on: 26 Apr '09 - 18:05 »
Hi ;D

Yes, I understood that :)
But my question was, if before an update there was a problem with SetPosition before reaching the end and GetPosition was incorrect before reaching the end as well? ;)
« Last Edit: 26 Apr '09 - 18:33 by (: JOBnik! :) »

nadia

  • Posts: 302
Re: Regression inside latest version of BASS_FX (2.4.4.0)
« Reply #16 on: 26 Apr '09 - 22:49 »
Hi ;D

Yes, I understood that :)
But my question was, if before an update there was a problem with SetPosition before reaching the end and GetPosition was incorrect before reaching the end as well? ;)

Hi  ::)

as far as a I can see, the SetPosition issue was a direct consequence of the wrong position returned by the GetPosition function you fixed at the beginning of this thread: after your fix it disappeared.

Kind Regards  ;D

Nadia