Old 06-27-2014, 02:46 AM   #1
User Name
Human being with feelings
 
Join Date: Jun 2014
Posts: 4
Default Issue obtaining the number of input channels

Hello Reaper forum!,

I am an audio plugin developer hobbyist and have recently encounterd a problem with my multi-channel input plugins after updating to Reaper 4.62 (32 and 64bit).

I use the 'JUCE' framework for development and the function "buffer.getNumChannels()", with Reaper versions up to "4.57", used to returned the correct number of input channels the current audio track contained. After updating however, it now just returns the maximum number of input channels the plugin can support, which is false.

Like I say, I didn't have this issue until updating Reaper and I don't have the issue in Nuendo 4-6 (using the same plugin). Leading me to believe that this a recently introduced bug.

Just thought I should let Cockos know.

Best,
User Name (ever)
User Name is offline   Reply With Quote
Old 06-27-2014, 08:02 AM   #2
Ollie
Super Moderator (no feelings)
 
Ollie's Avatar
 
Join Date: Dec 2007
Location: On or near a dike
Posts: 9,834
Default

Did you check "Inform plug-in when track channel count changes" in the FX Browser (right-click context menu for the plug-in)?
Ollie is offline   Reply With Quote
Old 06-30-2014, 07:59 AM   #3
User Name
Human being with feelings
 
Join Date: Jun 2014
Posts: 4
Default

Hey Ollie,

I just tried that but the issue still persists.

Reaper shows the number of active channels correctly (2/8, 6/8, 8/8). But it always tells my plugins (internally) that its 8/8. note: for different number of input channels I have different processing/interfaces, which is how I noticed this.

The issue appears to be isolated to just the more recent builds of reaper.

best,
User Name
User Name is offline   Reply With Quote
Old 06-30-2014, 11:17 AM   #4
Ollie
Super Moderator (no feelings)
 
Ollie's Avatar
 
Join Date: Dec 2007
Location: On or near a dike
Posts: 9,834
Default

Since you have the "inform plug-in when..." menu entry I take it that you're not talking about an AU plug-in (where an multi-out issue seems to exist).

That option was introduced recently, but so far there are no reports of multi-out plug-ins not working or not reacting on that option. I moved this to the developer forum, maybe someone has some enlightening comments here.
Ollie is offline   Reply With Quote
Old 07-06-2014, 05:39 PM   #5
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

Yes, before 4.57 there are two calls to the constructor (?) on plugin load - one with the total number of inputs and then one with the number of track channels. Changing track channels also made a call (not familiar with JUCE and don't have IPlug setup at the mo, so don't know what to).

Now there is now only one call on load with total number of inputs and no call when there is a change in track channel count. So something has definitely changed...

Last edited by Lazarus; 07-06-2014 at 05:49 PM. Reason: changed stuff
Lazarus is offline   Reply With Quote
Old 07-16-2014, 08:35 AM   #6
charlifiiiii
Human being with feelings
 
Join Date: Jul 2014
Posts: 6
Default

Hello,

I have a similar issue. My plugin (VST or AU, built with the Juce framework) can have either 1, 2 (default), 6 or 8 outputs. Depending on the number of outputs, it performs different actions.

The issue is that the Juce function getNumOutputChannel() (http://www.juce.com/api/classAudioPr...c8240e21ec9d90) always returns 8 for the VST, and 2 for the AU, whatever the number of channels in the Reaper track. Is there any way to get the real number of output channels in the track ?

Thanks,

Charles
charlifiiiii is offline   Reply With Quote
Old 07-16-2014, 08:56 AM   #7
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,750
Default

This behavior changed around REAPER version 4.58. This is a tricky area because any disagreement between the plugin and host about how many channels are being processed will lead to an instant crash.

At initialization time, the plugin notifies REAPER with the number of output channels it prefers. The recent change was this: REAPER initially informs the plugin that it will get exactly that number of buffers. If the plugin responds positively to this notification (specifically by returning nonzero to effSetSpeakerArrangement), then REAPER sends a second notification with the number of actual output channels the REAPER user wants (according to the track channel count and the plugin pin connector grid). REAPER will send further notifications if the user later changes the desired number of channels.

If you have more specific information about which VST calls JUCE is making or receiving, I can be more specific about what needs to change (either on our side or theirs).
schwa is offline   Reply With Quote
Old 07-18-2014, 02:09 AM   #8
charlifiiiii
Human being with feelings
 
Join Date: Jul 2014
Posts: 6
Default

Thanks for your reply

For the VST, the number of outputs should be defined in setSpeakerArrangement() in Juce :
https://github.com/julianstorer/JUCE...apper.cpp#L893

However, the function is never called (I put a breakpoint there, it is not reached)

Instead, the number of outputs is only set at init by https://github.com/julianstorer/JUCE...apper.cpp#L252

I don't know why setSpeakerArrangement() is not called...

Thanks,

Charles
charlifiiiii is offline   Reply With Quote
Old 07-23-2014, 07:11 AM   #9
charlifiiiii
Human being with feelings
 
Join Date: Jul 2014
Posts: 6
Default

I think Lazarus is right.
In Reaper versions > 4.57, effSetSpeakerArrangement is not called when the number of channels change in a track.
Can you confirm schwa ?

Thanks !

Charles
charlifiiiii is offline   Reply With Quote
Old 07-23-2014, 08:54 AM   #10
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,750
Default

As Ollie mentioned above, the effSetSpeakerArrangement message is only sent if the user enables "inform plug-in when track channel count changes". This setting is under the individual plug-in compatibility settings, which can be accessed via the "+" button on the plug-in window when the plug-in is loaded, or via the right-click context menu in the FX browser.
schwa is offline   Reply With Quote
Old 07-23-2014, 03:46 PM   #11
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

It's definitely called twice with the option checked, once with the requested number of channels and once with the max number of plugin channels (if track channels > 2). So if the plugin doesn't return a value for effSetSpeakerArrangement for a channel count > 2 does Reaper now request the max plugin channels to avoid potential crashes?
Lazarus is offline   Reply With Quote
Old 07-24-2014, 02:10 AM   #12
charlifiiiii
Human being with feelings
 
Join Date: Jul 2014
Posts: 6
Default

Thanks, it works indeed ! My mistake was that I did not re-load the VST plugin after setting that option.
The option does not appear for AU plugins however. Is there another solution for AU ?
charlifiiiii is offline   Reply With Quote
Old 06-30-2015, 11:35 PM   #13
ivansc
Human being with feelings
 
Join Date: Aug 2007
Location: Near Cambridge UK and Near Questembert, France
Posts: 22,754
Default

Resurrecting this one as I have just been pointed to the thread by Antares support.

A question for any Devs that might wander by - is this something that should be "fixed" in Reaper, or is Reaper code following approved practice and the plugin mfrs shoul dbe altering their code?
Either way, it does set a trap for the unwary.
Took me several emails after failing to find anything here or on the Antares site relating to Harmony evo crashing reaper.

What really threw me was of course that H.E. had always "just worked" on earlier Reaper versions, so I naturally assumed the crashing behaviour was down to Antares.

If I dont get any response in a week or so I guess I will have to log this as a bug-with-a-workaround...

EDIT: Well two more threads have surfaced on here regarding this and it really DOES seem like this needs to be addressed, if only for the purposes of tidying up yet another confusing anomaly.
At the very least, what harm would be done by having that "Inform plug-in when track channel count changes" as "ON" in the default state on startup?

Sorry about my dumbness here, but as a user I find stuff like this that is either poorly documented or not documented at all, yet can easily become a time-consuming show-stopper, a little irritating when it messes with the old creative juices.

Last edited by ivansc; 07-01-2015 at 04:19 AM.
ivansc is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:13 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.