Error w/GUI/PControl - You can not use this Qt functionality in the current thread

Hi everyone, its been QUITE some time… but I’ve come across a problem that I urgently need to fix an really don’t know how to deal with—

I just built a new synth and it was working great. Wonderful. Was LOVING it but suddenly I have this error which seems to be something to do with the GUI <> PControl that Scott wrote for me years ago, for getting all the controls into an interface, which I totally utterly rely on now so am stuck that this is happening.

I’ve tried all sorts of basic things like I’ve replaced the master.synthsc with a copy I had that I know was working… but that didn’t help. I’ve tried a new control bus, node etc. but I just don’t know what the ‘current thread’ means in relation to Qt and ScopeView, which seems to be upset with this matter.

I’ve tried loading just a few PControls to see if it was just ‘too many’ but that wasn’t effective. It was working fine for day and still, the synth compiles fine, it generates the Controls fine and they come up on the GUI as they should. There are no errors in the code that are coming up anywhere visible- But as soon as I ‘start synth’ on it, I get this error below-

I also noticed this::: when I launch SC…ERROR: syntax error, unexpected INTEGER, expecting NAME or WHILE or ‘[’ or ‘(’ I’ve tried grep to find it but nothing…

Sadly I don’t have the time to be able to really fix this without help so I’m at the mercy of guidance here and hope I can get some. Everything else still seeeeeeems to be working…

THANK YOU for reading this and any advice!

Mileece

I’m I’m on the 3.11.2 build (its been stable for me until now)
Monterrey 12.7.2
Model Name: MacBook Pro
Model Identifier: MacBookPro15,1
Processor Name: 6-Core Intel Core i9
Processor Speed: 2.9 GHz
Number of Processors: 1
Total Number of Cores: 6

ERROR: Qt: You can not use this Qt functionality in the current thread. Try scheduling on AppClock instead.
ERROR: Primitive 'QObject_InvokeMethod’ failed.
Failed.
RECEIVER:
Instance of ScopeView { (0x7fa128ba2108, gc=D8, fmt=00, flg=00, set=06)
instance variables [41]
qObject : RawPointer 0x600003d58f00
finalizer : instance of Finalizer (0x7fa1484ae1c8, size=2, set=1)
virtualSlots : nil
wasRemoved : false
font : nil
resize : Integer 1
alpha : Float 1.000000 00000000 3FF00000
decorator : nil
layout : nil
userCanClose : true
deleteOnClose : true
action : nil
mouseDownAction : nil
mouseUpAction : instance of Function (0x7fa0e948fca8, size=2, set=2)
mouseEnterAction : nil
mouseLeaveAction : nil
mouseMoveAction : nil
mouseOverAction : nil
mouseWheelAction : instance of Function (0x7fa0e94908e8, size=2, set=2)
keyDownAction : nil
keyUpAction : nil
keyModifiersChangedAction : nil
keyTyped : nil
focusGainedAction : nil
focusLostAction : nil
dragLabel : nil
beginDragAction : nil
canReceiveDragHandler : nil
receiveDragHandler : nil
toFrontAction : nil
endFrontAction : nil
onClose : nil
onResize : nil
onMove : nil
bufnum : Integer 0
xZoom : Float 1.000000 00000000 3FF00000
yZoom : Float 0.900000 CCCCCCCD 3FECCCCC
x : Float 0.000000 00000000 00000000
y : Float 0.000000 00000000 00000000
fill : true
waveColors : instance of Array (0x7fa1081efa28, size=10, set=4)
}
PATH: /Users/mileece/Library/Application Support/SuperCollider/startup.scd
CALL STACK:
MethodError:reportError
arg this =
Nil:handleError
arg this = nil
arg error =
Thread:handleError
arg this =
arg error =
Object:throw
arg this =
Object:primitiveFailed
arg this =
ScopeView:stop
arg this =
ScopeWidget:stopSynth
arg this =
ScopeWidget:doOnServerQuit
arg this =
ArrayedCollection:do
arg this = [*2]
arg function =
var i = 0
List:do
arg this =
arg function =
Meta_AbstractServerAction:performFunction
arg this =
arg server =
arg function =
Meta_AbstractServerAction:run
arg this =
arg server =
var selector = ‘doOnServerQuit’
ServerStatusWatcher:serverRunning

arg this =
arg running = false
ServerStatusWatcher:quit
arg this =
arg onComplete = nil
arg onFailure = nil
arg watchShutDown = false
Server:prOnServerProcessExit
arg this =
arg exitCode = 0
Meta_String:doUnixCmdAction
arg this =
arg res = 0
arg pid = 1094
^^ The preceding error dump is for ERROR: Primitive ‘_QObject_InvokeMethod’ failed.
Failed.
RECEIVER: a ScopeView

1 Like

An actual legit famous SC user! :grin:

Anyway, the error is occurring when a server has shut down, and this is triggering a call to stop a server scope view (so, not upon “start synth”). The error is specifically referring to the fact that GUI operations should be called within a defer { ... GUI stuff here } block.

I’m not sure if this is an issue in your code, or maybe a.class library bug.

There was a post within the last couple of days about a GUI operation failing despite being scheduled on AppClock, in Windows, but I couldn’t reproduce it in Linux. It’s possible that something drifted / regressed in Windows.

But I’d have expected Mac to be ok.

That’s a syntax error in code being submitted to the interpreter after library startup. Maybe something in your startup.scd file (or invoked by startup.scd).

hjh

Hi!

Thanks for responding!!

(lol famous about to be famous for failing at SC doh!!)

It’s very perplexing cause nothing really changed in the synth- it’s actually a copy of one I made that has been stable AF for years so it’s odd balls.

I reset my pram and am doing a reinstall to see if I can somehow get everything back on the same thread? So far, as I found trying to port over to the silicon architecture, seems if I go forward with newer builds the quarks are not finding some of their dependencies like the ’Material’ class… which again I think is related to the GUI so it might not work.

I’ll try to consider what you’re saying more carefully once I’m through this reset sequence. I’m praying it won’t make this all worse, but then again, what would doing a performance in SC be if it wasn’t absolutely hair raising!

Eeek!

Also, seen this pop up opening the start-up file. it’s been the same for years and nothing changed except I made a lethal cup of tea… compiled 850 files in 0.90 seconds

Info: 6 methods are currently overwritten by extensions. To see which, execute:
MethodOverride.printAll

compile done
localhost : setting clientID to 0.
internal : setting clientID to 0.
Class tree inited in 0.01 seconds
ERROR: Class not defined.
in interpreted text
line 7 char 15:

~p = InitPlayer;


ERROR: Message ‘tabletSlider2D’ not understood.
RECEIVER:
class QtGUI (0x7fda887b6100) {
instance variables [19]
name : Symbol ‘QtGUI’
nextclass : instance of Meta_QuadC (0x7fda789b5e80, size=19, set=5)
superclass : Symbol ‘Object’
subclasses : nil
methods : nil
instVarNames : nil
classVarNames : instance of SymbolArray (0x7fda887b4a40, size=1, set=2)
iprototype : nil
cprototype : instance of Array (0x7fda887b6280, size=1, set=2)
constNames : nil
constValues : nil
instanceFormat : Integer 0
instanceFlags : Integer 0
classIndex : Integer 168
classFlags : Integer 0
maxSubclassIndex : Integer 168
filenameSymbol : Symbol ‘/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/GUI/Base/QtGUI.sc’
charPos : Integer 0
classVarIndex : Integer 469
}
ARGS:
CALL STACK:
DoesNotUnderstandError:reportError
arg this =
Nil:handleError
arg this = nil
arg error =
Thread:handleError
arg this =
arg error =
Object:throw
arg this =
Object:doesNotUnderstand
arg this =
arg selector = ‘tabletSlider2D’
arg args = [*0]
< FunctionDef in Method Meta_CV:buildViewDictionary >
arg name = ‘tabletSlider2D’
< FunctionDef in Method Collection:collectAs >
arg elem = ‘tabletSlider2D’
arg i = 7
ArrayedCollection:do
arg this = [*12]
arg function =
var i = 7
Collection:collectAs
arg this = [*12]
arg function =
arg class =
var res = [*7]
Dictionary:keysValuesArrayDo
arg this =
arg argArray = [*32]
arg function =
var i = 2
var j = 1
var key = nil
var val = nil
var arraySize = nil
Dictionary:keysValuesDo
arg this =
arg function =
Dictionary:do
arg this =
arg function =
Meta_CV:buildViewDictionary
arg this =
var connectDictionary =
Function:doOnStartUp
arg this =
ArrayedCollection:do
arg this = [*10]
arg function =
var i = 8
List:do
arg this =
arg function =

^^ The preceding error dump is for ERROR: Message ‘tabletSlider2D’ not understood.
RECEIVER: QtGUI

Hi,

A quick suggestion – reading your stack traces has been complicated by the fact that they were not enclosed in

```
code tags
```

… with the concrete result that lines like arg error = <instance of PrimitiveFailedError> treat the <> as an HTML tag, which is unrecognized, and thus not displayed. I think you can retroactively edit your posts and add the triple-backtick tags above and below the error dumps – then I and others can see more of what’s happening.

OK, so… trying to go through these one by one.

ERROR: Qt: You can not use this Qt functionality in the current thread. Try scheduling on AppClock instead.
ERROR: Primitive 'QObject_InvokeMethod’ failed.

The culprit seems to be the method ScopeWidget:stopSynth. This is being triggered by server-quit. Server quit actions run in SystemClock – AFAIK this has not changed. This stopSynth method must be calling aScopeView.stop without wrapping it in defer. GUI operations in methods should pretty much always be deferred, because you don’t know how the method will be called. So the lack of it here is a programming error. (BTW Google doesn’t know about ScopeWidget…? Where is this defined?)

ScopeWidget doesn’t exist in my environment, so it must be an extension. You could add the defer { ... } yourself. Maybe also a good idea to log a bug report on the quark.

ERROR: Message ‘tabletSlider2D’ not understood.

That error occurs here: Conductor/classes/CV/CV.sc at master · supercollider-quarks/Conductor · GitHub

if ( (class = gui.perform(name)).notNil) { ... }

According to github, that line of code is 16 years old. At that time, it might have been safe to check a GUI framework for the existence of a widget by doing e.g. QtGUI.nonexistentView which may, at that time, have responded with nil. Now it throws an error. So this line needs to be updated, probably to gui.tryPerform(name).

QtGUI has been pretty stable for several years, so if this bug hasn’t been discovered, it means nobody has been using the Conductor quark for several years (including yourself :wink: – so perhaps one of the things that changed in your environment might have been installing this Quark somehow?).

ERROR: Class not defined.
in interpreted text
line 7 char 15:

~p = InitPlayer;

The error text says it all… for whatever reason, the file defining InitPlayer isn’t in the list of compile paths (Preferences → Interpreter).

This will cause the entire startup.scd files not to run, which could trigger other errors.

hjh

It was a weird and convoluted fix, involving magic handing the archive of setting back into the gui as a template and gradually removing the old O’Connell’s which if Ed the NaN … shahid was a broken input on the gui- magically repaired 85: magic. And then also not

Got the synth loading again by commenting out the green which maybe problems over one of the Pcintorks sending its NaN …

A good point delivered by Nathan Ho!

So I thiiiink , I’m back on track. Less hair, older, and more frai, but still at it.

Btw I can’t read this so it might be jump med