$npx -y skills add tebjan/vvvv-skills --skill vvvv-troubleshootingDiagnoses and fixes common vvvv gamma errors in C# nodes, SDSL shaders, and runtime behavior. Use when encountering errors, exceptions, crashes, red nodes, shader compilation failures, missing nodes in the browser, performance issues, or unexpected behavior.
| 1 | # vvvv gamma Troubleshooting |
| 2 | |
| 3 | ## C# / ProcessNode Issues |
| 4 | |
| 5 | ### "Node" Suffix in Class Name |
| 6 | |
| 7 | **Symptom**: Node works but has ugly name in vvvv. |
| 8 | **Fix**: Remove "Node" suffix — vvvv convention forbids it. |
| 9 | |
| 10 | ```csharp |
| 11 | // WRONG |
| 12 | [ProcessNode] |
| 13 | public class SteeringBehaviorNode { } |
| 14 | |
| 15 | // CORRECT |
| 16 | [ProcessNode] |
| 17 | public class SteeringBehavior { } |
| 18 | ``` |
| 19 | |
| 20 | ### Out Parameters After Inputs |
| 21 | |
| 22 | **Symptom**: Pins appear in wrong order or node doesn't compile correctly. |
| 23 | **Fix**: `out` parameters must come FIRST in Update signature. |
| 24 | |
| 25 | ```csharp |
| 26 | // WRONG |
| 27 | public void Update(float input = 0f, out float result) { ... } |
| 28 | |
| 29 | // CORRECT |
| 30 | public void Update(out float result, float input = 0f) { ... } |
| 31 | ``` |
| 32 | |
| 33 | ### Node Not Appearing in Node Browser |
| 34 | |
| 35 | **Symptom**: Your C# class exists but doesn't show up in vvvv. |
| 36 | **Fix**: Check these in order: |
| 37 | 1. `[assembly: ImportAsIs]` attribute exists in your project |
| 38 | 2. `[ProcessNode]` attribute on the class |
| 39 | 3. Project targets `net8.0` |
| 40 | 4. DLL is in the correct `lib/net8.0/` path relative to `.vl` document |
| 41 | 5. Project builds without errors |
| 42 | |
| 43 | ### Allocations Causing Frame Drops |
| 44 | |
| 45 | **Symptom**: GC spikes, stuttering, frame drops. |
| 46 | **Diagnosis**: Allocations in the Update loop. |
| 47 | |
| 48 | Common culprits: |
| 49 | - `new` keyword in Update method |
| 50 | - LINQ operators (`.Where()`, `.Select()`, `.ToList()`) |
| 51 | - String concatenation (`+` operator on strings) |
| 52 | - Boxing value types (passing `int` where `object` expected) |
| 53 | |
| 54 | **Fix**: Cache everything, pre-allocate buffers, eliminate LINQ from hot paths. |
| 55 | |
| 56 | ### Missing Change Detection |
| 57 | |
| 58 | **Symptom**: CPU usage high even when nothing changes. |
| 59 | **Fix**: Compare inputs to cached values, only recompute on change. |
| 60 | |
| 61 | ```csharp |
| 62 | if (param != _lastParam) |
| 63 | { |
| 64 | _cached = Compute(param); |
| 65 | _lastParam = param; |
| 66 | } |
| 67 | result = _cached; // Always output cached |
| 68 | ``` |
| 69 | |
| 70 | ### Downstream Nodes See null/default |
| 71 | |
| 72 | **Symptom**: Connected nodes get no data, even though the node "works". |
| 73 | **Fix**: Always output cached result, even when no computation happens. |
| 74 | |
| 75 | ```csharp |
| 76 | // WRONG — output is only set inside the if block |
| 77 | public void Update(out float result, float input = 0f) |
| 78 | { |
| 79 | if (input != _last) |
| 80 | { |
| 81 | result = Compute(input); |
| 82 | _last = input; |
| 83 | } |
| 84 | // result is unassigned when input hasn't changed! |
| 85 | } |
| 86 | |
| 87 | // CORRECT — always assign output |
| 88 | public void Update(out float result, float input = 0f) |
| 89 | { |
| 90 | if (input != _last) |
| 91 | { |
| 92 | _cached = Compute(input); |
| 93 | _last = input; |
| 94 | } |
| 95 | result = _cached; |
| 96 | } |
| 97 | ``` |
| 98 | |
| 99 | ## SDSL Shader Issues |
| 100 | |
| 101 | For SDSL syntax rules, common mistakes, and correct/wrong examples, consult the **vvvv-shaders** skill and its `syntax-rules.md`. Key issues: `static const` scope, missing semicolons, missing `override`, enum binding format. |
| 102 | |
| 103 | ## Runtime Issues |
| 104 | |
| 105 | ### Memory Leaks |
| 106 | |
| 107 | **Symptom**: Memory usage grows over time. |
| 108 | **Causes**: |
| 109 | - Missing `IDisposable` on nodes with native resources |
| 110 | - COM objects (`ComPtr<T>`) not disposed |
| 111 | - Event handler subscriptions not unsubscribed |
| 112 | |
| 113 | ### Thread Safety |
| 114 | |
| 115 | **Symptom**: Intermittent crashes, data corruption. |
| 116 | **Fix**: `Update()` runs on the main thread. Capture `SynchronizationContext` in the constructor, then marshal background results back: |
| 117 | |
| 118 | ```csharp |
| 119 | private SynchronizationContext _vlSyncContext; |
| 120 | |
| 121 | public MyNode() |
| 122 | { |
| 123 | _vlSyncContext = SynchronizationContext.Current!; |
| 124 | } |
| 125 | |
| 126 | // From background thread: |
| 127 | _vlSyncContext.Post(_ => { /* runs on VL thread */ }, null); |
| 128 | ``` |
| 129 | |
| 130 | ### Circular Dependencies |
| 131 | |
| 132 | **Symptom**: vvvv warns about circular dependency, patch won't compile. |
| 133 | **Fix**: Insert a `FrameDelay` node to break the cycle. |
| 134 | |
| 135 | ## Build Issues |
| 136 | |
| 137 | ### Target Framework Mismatch |
| 138 | |
| 139 | **Symptom**: DLL loads but types aren't found. |
| 140 | **Fix**: Ensure `.csproj` targets `net8.0` (matching vvvv gamma's runtime). |
| 141 | |
| 142 | ### Assembly Version Conflicts |
| 143 | |
| 144 | **Symptom**: `FileLoadException` or `TypeLoadException` at runtime. |
| 145 | **Fix**: Align package versions with vvvv's bundled versions. Check vvvv's `lib/` folder for reference. |
| 146 | |
| 147 | For detailed error-to-solution mapping, see [error-catalog.md](error-catalog.md). |