Author Topic: Question about BASS_SYNC_END | BASS_SYNC_MIXTIME in BASS_ChannelSetSync  (Read 532 times)

VorTechS

  • Posts: 265
Hi Ian,

I've just got back into the office to an un-responsive application, and the procdump procedure closed.

I've uploaded two dump files.  One from yesterday 2pm which threw an Access Violation and one from 6.30pm.   The first one was obtained by me manually switching around playlists.  The second occured through natural causes.


VorTechS

  • Posts: 265
I've just discovered that it is still possible to catch and handle AccessViolation exceptions in .NET using the [HandleProcessCorruptedStateExceptions] attribute and an appropriate Try/Catch block.

Here's a sample:

Code: [Select]
        [HandleProcessCorruptedStateExceptions]
        private void SetMixerVolume()
        {
            try
            {
                #if DebugBASSCalls
                    Console.WriteLine($"BASS: BASS_ChannelSetAttribute (SetMixerVolume), Mixer Handle: {_mixerHandle}");
                #endif

                // Set the volume of the stream only
                Un4seen.Bass.Bass.BASS_ChannelSetAttribute(_mixerHandle, BASSAttribute.BASS_ATTRIB_VOL, (float) _currentVolume);
            }
            catch (AccessViolationException ave)
            {
               
            }
        }

So, I'm going to modify all my functions making calls out to BASS accordingly and throw a breakpoint on the exception handler and then maybe I'll be able to get a better idea of what's going on!

Ian @ un4seen

  • Administrator
  • Posts: 20437
The good news is the new dump files you uploaded show the same problem (crash in a DirectSound thread apparently due to heap corruption). The bad news is we're no nearer to know what caused it. I will send you a debug version that logs all DirectSound calls and buffer writes, to see if that gives any clues.

VorTechS

  • Posts: 265
Thanks Ian!

I've dropped that in this morning and it's currently running through and logging happily.  I have about 398GB of free space, so hopefully we don't eat all of that up! 

Annoyingly I have no idea how the results of my changes above worked out, as Windows Update rebooted my PC whilst it 'wasn't doing anything'! 

However, whilst employing those changes, I also made three other changes:

1.  When creating my EQ levels, for some reason I'd hard coded 10-bands at the 'Audio Component' level (non-ui media player), and had a 10-step iteration, iterating over the bands to create the EQ parameters.  So basically, instead of iterating and calling Bass_FXSetParameters 10-times it was calling it 100 times!

2. Early debug attempts showed a console trace with the last (successful?) call to BassVis, as the architecture of the UI thread when starting the 1st track in another playlist was Stopping the visuals and re-starting them.  I've since modified the architecture of both the UI and non-UI threads so that they are more aware of what the current and previous state of the player is, so it doesn't make un-necessary changes to the Visualizations.

3. Other debug attempts showed calls from the media state tracking timer (that passes the current playback state to the UI thread) firing far too quickly for my liking.  So I've wrapped a background delay of 750ms before starting the timer again (using a background task).

By the sounds of it, none of these will affect what's going on from what you've found in the dump files.

So now we'll just play the waiting game....!



VorTechS

  • Posts: 265
Well, for a change that didn't take long at all!

Log file uploaded for you :)

The last few lines of which are:

Code: [Select]
32743315[454c]: play(3de78)
32743315[454c]: play=0
32743317[3558]: out: PlayBuf(3de78) = 0
32743317[3558]: out: BASS_ChannelPlay(80000001) = 1
32743329[44a0]: getpos(0003DE78)
32743329[44a0]: pos(3de78) =     0    -1
32743329[3558]: ended=0
32743329[3558]: getpos(0003DE78)
32743329[3558]: pos(3de78) =     0    -1

..which co-incides with my console output log:

Code: [Select]
BASS: BASS_ChannelPlay (PlugInNextTrack)
BASS: BASS_ChannelGetInfo (GetChannelProperties) Stream Handle: -2147483574
BASS: BASSChannelTypeToString (GetChannelProperties)
BASS: BASS_ChannelGetLength (GetChannelProperties) Stream Handle: -2147483574
BASS: BASS_StreamGetFilePosition (GetChannelProperties) Stream Handle: -2147483574
BASS: BASS_ChannelBytes2Seconds (GetChannelProperties) Stream Handle: -2147483574

...so, it seems it's the

Code: [Select]
BASS: BASS_ChannelBytes2Seconds (GetChannelProperties) Stream Handle: -2147483574

..failing ... ?
« Last Edit: 16 Nov '17 - 10:22 by VorTechS »

VorTechS

  • Posts: 265
Curious observation, thought it was co-incidence, so it may or may not be linked.

When I restart the application, despite my global system volume being 10 (Windows Volume Control) it seems the re-started audio output is at a much higher level, such that if I bring up the Windows volume UI, and click on the 'drag bar', it resets the volume level back to what it was before the crash.

That's despite me getting the global system volume to start:

Code: [Select]
                #if DebugBASSCalls
                    Console.WriteLine("BASS: BASS_GetVolume (SetupBass)");
                #endif

                float currentGlobalVolume = Un4seen.Bass.Bass.BASS_GetVolume();

                #if DebugBASSCalls
                    Console.WriteLine("BASS: BASS_SetVolume (SetupBass)");
                #endif

                Un4seen.Bass.Bass.BASS_SetVolume(currentGlobalVolume);

..although maybe that's not the global system volume, but whatever the current BASS volume is?

I've just added console output at the end of each routine that makes any BASS call, so that I can see a bit clearer if any calls are not completing before the crash as at the moment we only have proof of the last call made and I can't be 100% sure what the last line of code is executing at the time, so this might help to narrow it down a little for me.  Useless for you, as I'm sure the debug log says everything you need to know!
« Last Edit: 16 Nov '17 - 10:49 by VorTechS »

EWeiss

  • Posts: 355
BASS_GetVolume the same as from WASAPI? "BASS_WASAPI_GetVolume"
think is different or?

do not Forget System use no longer DirectX(Sound) for get Volume.
i hope i have right ;)

you can also not compare System Volume with BASS_GetVolume seems be different.

greets
« Last Edit: 16 Nov '17 - 19:38 by EWeiss »

VorTechS

  • Posts: 265
BASS_GetVolume the same as from WASAPI? "BASS_WASAPI_GetVolume"
think is different or?

do not Forget System use no longer DirectX(Sound) for get Volume.
i hope i have right ;)

you can also not compare System Volume with BASS_GetVolume seems be different.

greets

According to the documentation:

Code: [Select]
This function affects the volume level of all applications using the same output device

I seriously suspect there is a problem with my sound drivers, but maybe it was only because of this bug we have been chasing which is now solved (Thanks Ian).

Do you have a direct download for the latest BassVis, I do not want to install more software just to get the latest version and I couldn't find a link on the forums you pointed to?

The software was running all night last night, and I came back to my machine to find the visualizations not responding to music.  I am doing some debugging now to find out what could be the cause of this.  Perhaps it is something you know of?

EWeiss

  • Posts: 355
Quote
The software was running all night last night, and I came back to my machine to find the visualizations not responding to music.  I am doing some debugging now to find out what could be the cause of this.  Perhaps it is something you know of?

for a old Version.. ?
sorry no Support.

i want send to you the last Version over Mail.
run here more then 15 Hour Helium 12 (WPF Application) with visualization without any problem.

some People has changed my Copyright and publish my work as a "MIT" license and link then to this Forum here.
so no longer publish my work here on Un4Seen.

i have send a DMCA request to Nuget Admin so the package is removed.
http://nugetmusthaves.com/Package/BASS.Vis.Native

Quote
Copyright (c) 1999-2016 Un4seen Developments Ltd. All rights reserved.
LOL


greets
« Last Edit: 17 Nov '17 - 14:46 by EWeiss »

VorTechS

  • Posts: 265
Quote
The software was running all night last night, and I came back to my machine to find the visualizations not responding to music.  I am doing some debugging now to find out what could be the cause of this.  Perhaps it is something you know of?

for a old Version.. ?
sorry no Support.

i want send to you the last Version over Mail.
run here more then 15 Hour Helium 12 (WPF Application) with visualization without any problem.

some People has changed my Copyright and publish my work as a "MIT" license and link then to this Forum here.
so no longer publish my work here on Un4Seen.

i have send a DMCA request to Nuget Admin so the package is removed.
http://nugetmusthaves.com/Package/BASS.Vis.Native

Quote
Copyright (c) 1999-2016 Un4seen Developments Ltd. All rights reserved.
LOL


greets

Ack, that is bad!  I didn't realise that people would go THAT far for visualizations!

I think I have fixed my problem now, which seems to be when the current track ends on the mixer,  and the mixer is the stream handle for the visualizations, you must reset the visualization source back to the mixer again.

Please do send the new version to me by e-mail. 

I checked our last e-mail conversation, but it has no mention of where to get the new version from.  Let me know if you need me to remind you of my e-mail address!

EWeiss

  • Posts: 355
Quote
I think I have fixed my problem now, which seems to be when the current track ends on the mixer,  and the mixer is the stream handle for the visualizations, you must reset the visualization source back to the mixer again.
yes or create a stream copy.
And do not Forget Wasabi is not the same then HSTREAM.

greets

Ian @ un4seen

  • Administrator
  • Posts: 20437
i have send a DMCA request to Nuget Admin so the package is removed.
http://nugetmusthaves.com/Package/BASS.Vis.Native

Quote
Copyright (c) 1999-2016 Un4seen Developments Ltd. All rights reserved.
LOL

The Nuget packages weren't put up by me (just in case that's what you thought). I'm not sure who did. I don't have a problem with the BASS packages being there, but of course changing the licence and/or copyright notice isn't good. I guess it was just too much copy'n'pasting in this case rather than anything intentionally deceitful.

EWeiss

  • Posts: 355
Quote
The Nuget packages weren't put up by me (just in case that's what you thought).
you has nothing to do with it.

Quote
I guess it was just too much copy'n'pasting in this case rather than anything intentionally deceitful.
and no
that was intentionally deceitful! that is a fact.
or why my file is decompressed and my LIB for NET the Copyright removed

nobody make do it by accident
but with full Intention.. see shot that say all

Quote
I don't have a problem with the BASS packages being there,
what your do if decompress and remove your Copyright from Bass and change the license to MIT..
and after make a nuget package so all User can used Bass for free! include commercial Version. :)

i think your are not happy.
and they will not apologize .. with copy \ paste.

greets
« Last Edit: 17 Nov '17 - 17:54 by EWeiss »

Ian @ un4seen

  • Administrator
  • Posts: 20437
Oh, I didn't realise they had gone that far (I missed the image and only saw the copyright notice you posted above).

EWeiss

  • Posts: 355
Oh, I didn't realise they had gone that far (I missed the image and only saw the copyright notice you posted above).

no Problem have a nice day.

greets