Author Topic: BASS_ERROR_UNKNOWN with reverse and tempo streams  (Read 3462 times)

aybe

  • Posts: 162
After following your suggestion on how to implement a turntable-like stream:

http://www.un4seen.com/forum/?topic=11858.0

I am trying to get it perfect but currently getting BASS_ERROR_UNKNOWN.

Here's the scenario:
  • create stream of input audio as decoding channel
  • create reverse stream of #1 as decoding channel and set to play forward
  • create tempo stream of #2 as regular channel to play
  • play a bit of aubio
  • go reverse until it reaches beginning, channel is now BASS_ACTIVE_STOPPED
  • play again (no direction change, so backwards), BASS_ERROR_UNKNOWN is thrown

Basically the behavior I was expecting was that the stream would just sit at the position instead of throwing BASS_ERROR_UNKNOWN.

On my side I fixed it as follows:

  • the SYNCPROC is set against tempo stream instead, with BASS_SYNC_END so BASS really reaches position zero
  • the SYNCPROC does this: set a bool to true and save BASSActive value as fields in class
  • when the user reverses playback (so forward), I automatically play again if #2 conditions are met

Basically just like a real turntable behaves, it does not blow in your face in this situation !

Not sure if this could be classified as a bug, still, I believe BASS should not return BASS_ERROR_UNKNOWN in such situation, there's really no reason to. :)

PS under WinStore

aybe

  • Posts: 162
Re: BASS_ERROR_UNKNOWN with reverse and tempo streams
« Reply #1 on: 14 Aug '18 - 05:20 »
PS

the code example I've put in http://www.un4seen.com/forum/?topic=18177.0 exhibits the exact same behavior

Ian @ un4seen

  • Administrator
  • Posts: 25872
Re: BASS_ERROR_UNKNOWN with reverse and tempo streams
« Reply #2 on: 14 Aug '18 - 15:49 »
I think I see what/where the problem is (when restarting after reverse playback has ended). I will let the BASS_FX developer know about it and then an update will hopefully be available shortly. If you're using Windows (not WinStore), I can send an update for you to try now.

I suspect the problem in your other thread is the same issue. Does it only happen after reverse playback has reached the end, not at the end of forward playback or if you stop in the middle of the file?

aybe

  • Posts: 162
Re: BASS_ERROR_UNKNOWN with reverse and tempo streams
« Reply #3 on: 14 Aug '18 - 18:12 »
I am using WinStore for this project, I'll wait for the update  :D

It does only happen at the end of the reverse stream (so the beginning of the file).

Forgot to mention in my post:
When you reach this problem and try to reset position to zero, the call to BASS_ChannelSetPosition will not fail but will do nothing; and if you get the position, it's the very end of the file.

Also, I've checked at the end of the stream and it does exhibit the behavior I was actually looking for:
  • go to 3 seconds before end of stream
  • play it
  • wait for it to reach end
  • when you go backwards, the stream continues playing backward without requiring you to play manually

To sum it up, the behavior at the end is natural and I believe the behavior at start should be the exact same thing.

PS in the middle of the file things are working properly

aybe

  • Posts: 162
Re: BASS_ERROR_UNKNOWN with reverse and tempo streams
« Reply #4 on: 14 Aug '18 - 21:53 »
Ian, can you please still share that update for the desktop ?

I will give it a try and let you know how it goes.

Thanks  :D

Ian @ un4seen

  • Administrator
  • Posts: 25872
Re: BASS_ERROR_UNKNOWN with reverse and tempo streams
« Reply #5 on: 15 Aug '18 - 12:50 »
Yes, I will send you a Windows update to try.

aybe

  • Posts: 162
Re: BASS_ERROR_UNKNOWN with reverse and tempo streams
« Reply #6 on: 18 Aug '18 - 03:24 »
The updated DLL did not change anything, unfortunately :(

Basically my shim as follows is still needed to avoid BASS_ERROR_UNKNOWN:

Code: [Select]
        public override void Play(bool restart = false)
        {
            if (Direction == BASSFXReverse.BASS_FX_RVS_REVERSE && Position <= 0)
                return; // avoid nasty bug from BASS // TODO try new lib version

            base.Play(restart);
        }