Standalone wrapper bugs


#1

AudioDeviceSelectorComponent selectorComp needs an additional bool parameter

when i click the close button the options menu pops out

when i close the window using window->close from the taskabr i get an unhandles exception

    EnterCriticalSection ((CRITICAL_SECTION*) internal);

here

propably not very important cause not many people use it, but i just built my plugin stabdalone and ran into those problems.


#2

…well I’ve no idea how you got that, but I did get an assertion failure. Looks like I never made the AlertWindow class handle that action, which is easily fixed.

Don’t understand what you mean about the options menu or the extra bool parameter though…??


#3

well i mean

1>c:\devel\ctrlr\wrapper\standalone\juce_standalonefilterwindow.cpp(246) : error C2661: 'juce::AudioDeviceSelectorComponent::AudioDeviceSelectorComponent' : no overloaded function takes 8 arguments

i had to add another parameter to the constructor to make it work

and the other thing is when i click on the close button of the window (the red juce close button) instead of the app closing the options menu pops out on the left, what i’ve seen in the code the buttonPressed method handles all button clicks and show the menu on ALL of them, and it looks like the close button is one of those, and i think that that the method closeButtonPressed should be called not the buttonClicked


#4

Ok, I see what you mean about the bool now.

But I don’t get the close button thing - it works fine for me. The StandaloneFilterWindow is only registered as a button listener with the options button - it doesn’t get any callbacks from the other buttons and does call closeButtonPressed()… Unless you’ve done something in your code that links them up (?)


#5

don’t know what my editor did with the button listeners, i use them the way i always use them, anyway i changed the buttonClicked code to

	if (btn == optionsButton)
	{
		if (filter == 0)
	        return;

	    PopupMenu m;
	    m.addItem (1, TRANS("Audio Settings..."));
	    m.addSeparator();
	    m.addItem (2, TRANS("Save current state..."));
	    m.addItem (3, TRANS("Load a saved state..."));
	    m.addSeparator();
	    m.addItem (4, TRANS("Reset to default state"));
	
	    switch (m.showAt (optionsButton))
	    {
	    case 1:
			showAudioSettingsDialog();
			break;
	
	    case 2:
			saveState();
			break;
	
	    case 3:
			loadState();
			break;
	
	    case 4:
			resetFilter();
			break;
	
	    default:
			break;
		}
	}

	if (btn == getCloseButton())
	{
		JUCEApplication::quit();
	}
	if (btn == getMinimiseButton())
	{
		setMinimised (true);
	}

and it works the way it should, don’t know if that’s just the fault of my plugin or something else (i use the tip from SVN as always).


#6

You must have hacked something - the StandaloneFilterWindow doesn’t register with those buttons, and the DocumentWindow isn’t even a ButtonListener, so it can’t register with them.

The DocumentWindow::ButtonListenerProxy is how it gets the clicks from those buttons, and when I traced it, that’s exactly what happens… I’d recommend putting a breakpoint in addButtonListener and finding out what’s going on!


#7

I’ve too built a standalone wrapper (with today’s updates) around (mostly) the demo plugin, but it doesn’t seem to want to allow me to open an ASIO driver when I select one, other than that it appears to work… I mean the plugin appears and I can wiggle the gain control, at least


#8

When I tried it yesterday it worked fine for me. In what way is it failing?


#9

I may have doen things differently to what you’re expecting - (I’m lacking any epic C++ skilz!) - I have 2 projects one which produces a (VST)plugin and a second which uses the same filter, but includes the standalone wrapper to produce a separate application

Description:
The application runs OK, with an outer window (all buttons) and an inner window (with just minimize and exit + an options button)
If I click options an Audio settings page opens, with Audio device type (defaults to Direct Sound/Primary Sound capture driver ), input sample rate, buffersize and MIDI inputs (no MIDI o/p but I assume that’s because, as mentioned elsewhere, there’s no MIDIout)
The Audio device type drop-down lists ASIO (I’m using ASIO4ALL) but if I select this
[1016] JUCE v1.46
[1016] opening dsound in device: Primary Sound Capture Driver rate=44100 bits=16 buf=960
[1016] opening dsound in step 2
[1016] closing dsound in: Primary Sound Capture Driver

it doesn’t look like ASIO4ALL.dll gets instanciated (at least it doesn’t appear in the events/debug out window like it usually does) and I get an “Error whilst opening audio device” window
Sadly I haven’t managed to actually hear anything’s working yet, when using the default driver, but it doesn’t report any errors/crash.

Can you post up your standalone project as part of an audio example?


#10

Normally when asio4all does that, it’s just because another app has already got a DSound device open, and it needs exclusive access. Just having a browser open can sometimes cause it. Doesn’t sound like a juce bug…


#11

I don’t think so. I can close the standalone, and open an alternative VST Host without issue.
BTW No ASIO4ALL tray icon appears. As far as I can tell ASIO4ALL isn’t even getting loaded (unless it doesn’t need to be loaded to enumerate the device types and devices availabile )
When I step through the code something odd happens:
in AudioDeviceManager::setAudioDeviceSetup() after currentAudioDevice = type->createDevice (newOutputDeviceName, newInputDeviceName);
the debugger leaps to an invisible breakpoint (INT3?) in the key handler before returning to the if (currentAudioDevice == 0)… error line

'Standalone.exe': Loaded 'C:\Devel\...\build\win32\Debug\Standalone.exe', Symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\ntdll.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\kernel32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\user32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\gdi32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\comdlg32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\advapi32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\rpcrt4.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\secur32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\comctl32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\shell32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\msvcrt.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\shlwapi.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\ole32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\oleaut32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\msvfw32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\winmm.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\wininet.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\normaliz.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\iertutil.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\ws2_32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\ws2help.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\opengl32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\glu32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\ddraw.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\dciman32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f\msvcr80d.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\shimeng.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\Program Files\Google\Google Desktop Search\GoogleDesktopNetwork3.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\myokent.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\ma_cmidn.dll', Binary was not built with debug information. 'Standalone.exe': Unloaded 'C:\WINDOWS\SYSTEM32\ma_cmidn.dll' 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\ma_cmidn.dll', Binary was not built with debug information. 'Standalone.exe': Unloaded 'C:\WINDOWS\SYSTEM32\ma_cmidn.dll' 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\ma_cmidn.dll', Binary was not built with debug information. 'Standalone.exe': Unloaded 'C:\WINDOWS\SYSTEM32\ma_cmidn.dll' 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\ma_cmidn.dll', Binary was not built with debug information. 'Standalone.exe': Unloaded 'C:\WINDOWS\SYSTEM32\ma_cmidn.dll' 'Standalone.exe': Unloaded 'C:\WINDOWS\SYSTEM32\shimeng.dll' 'Standalone.exe': Unloaded 'C:\Program Files\Google\Google Desktop Search\GoogleDesktopNetwork3.dll' The thread 'Win32 Thread' (0xd00) has exited with code 0 (0x0). JUCE v1.46 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\msctf.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\setupapi.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\apphelp.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\clbcatq.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\comres.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\version.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\Program Files\Common Files\TortoiseOverlays\TortoiseOverlays.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\Program Files\TortoiseSVN\bin\TortoiseStub.dll', Binary was not built with debug information. 'Standalone.exe': Loaded 'C:\Program Files\TortoiseSVN\bin\TortoiseSVN.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\Program Files\TortoiseSVN\bin\libapr_tsvn.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\mswsock.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e\msvcr90.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\Program Files\TortoiseSVN\bin\libaprutil_tsvn.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\wldap32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\Program Files\TortoiseSVN\bin\intl3_tsvn.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e\msvcp90.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\shfolder.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\cscui.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\cscdll.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\dsound.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\wintrust.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\crypt32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\msasn1.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\imagehlp.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\wdmaud.drv', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\msacm32.drv', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\msacm32.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\midimap.dll', No symbols loaded. opening dsound in device: Primary Sound Capture Driver rate=44100 bits=16 buf=960 opening dsound in step 2 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\ksuser.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\mscms.dll', No symbols loaded. 'Standalone.exe': Loaded 'C:\WINDOWS\SYSTEM32\winspool.drv', No symbols loaded. The thread 'Juce DSound' (0xa9c) has exited with code 0 (0x0). closing dsound in: Primary Sound Capture Driver The thread 'Win32 Thread' (0x8b8) has exited with code 0 (0x0). Standalone.exe has triggered a breakpoint

(I’ve cleaned and rebuilt it a few times, and it keeps doing the same thing - I’m starting to wonder if my standalone project has some undesirable compiler/linker options which I’m neglecting)


#12

Looks like a link error… Maybe you’re linking to a mismatched version of juce or something?..

I can’t post my example project because it’s not public code, but asio4all definitely works here, and there I’ve made no mods to the standalone wrapper code.

If you build the juce demo, does asio4all work in there? If so, you know your build is screwed.


#13

OK, I may have something…

  1. Something’s still screwy with my link (I think) I’ve been through it setting most of the BOLDED items I must have faffed-with to their project default values - This didn’t seem to make any difference though - The code did the same thing…
  2. Remember when I said “Mostly” the demo code… well the bit’s I messed with (mia colpa! mia grandissima colpa!) was the number of in/outs my plugin uses - It’s unusual as it has 2 Audio INs and MIDI In and only produces MIDI Out (No audio outputs)

#define JucePlugin_MaxNumInputChannels 2 #define JucePlugin_MaxNumOutputChannels 0 #define JucePlugin_PreferredChannelConfigurations { 2, 0 }
This has meant me modifying a few asserts and commenting out some code in the process (which I was surprised couldn’t handle the situation)

[code] // for each of our input channels, we’ll attenuate its level by the
// amount that our volume parameter is set to.
if (buffer.getNumSamples() > 0)
for (int channel = 0; channel < getNumInputChannels(); ++channel)
{
//buffer.applyGain (channel, 0, buffer.getNumSamples(), gain);
}
else DBG(“Nothing!”);

// in case we have more outputs than inputs, we'll clear any output
// channels that didn't contain input data, (because these aren't
// guaranteed to be empty - they may contain garbage).
for (int i = getNumInputChannels(); i < getNumOutputChannels(); ++i)
{
    //buffer.clear (i, 0, buffer.getNumSamples());
}[/code]

void AudioSampleBuffer::setSize (const int newNumChannels, const int newNumSamples, const bool keepExistingContent, const bool clearExtraSpace, const bool avoidReallocating) throw() { jassert (newNumChannels >[b]=[/b] 0);

I didn’t think I was being all that naughty, but evidently, I am :frowning: :twisted:

OH, and my ASIO observation? - That the cause of most of my troubles is that newOutputDeviceName = “” , newInputDeviceName = "ASIO4ALL v2"
in

That newOutputDeviceName empty string seems to be the thing that’s breaking it -If I assign it to newInputDeviceName it seems to work OK


#14

Right, if I reset the plugin to have 2 ins and 2 outs it looks like it works OK… i.e. it still fails if audio outs=0
[edit](no MIDI out, :frowning: )


#15

So asio4all’s failing to open an input-only device, then? Does it seem like this is a juce bug, or just asio4all not behaving itself?


#16

Ahh! :slight_smile: Cound be… but I’d be surprised. I’m sure I’ve done it before (admitedly ages ago / ASIO4ALL v1) when I (for some very strange reasons) had one host behaving as an ASIO in and a separate one as an ASIO out
I’ll try and investigate