vvvv gamma Troubleshooting
C# / ProcessNode Issues
"Node" Suffix in Class Name
Symptom: Node works but has ugly name in vvvv.
Fix: Remove "Node" suffix — vvvv convention forbids it.
CODEBLOCK0
Out Parameters After Inputs
Symptom: Pins appear in wrong order or node doesn't compile correctly.
Fix: out parameters must come FIRST in Update signature.
CODEBLOCK1
Node Not Appearing in Node Browser
Symptom: Your C# class exists but doesn't show up in vvvv.
Fix: Check these in order:
- 1.
[assembly: ImportAsIs] attribute exists in your project - INLINECODE2 attribute on the class
- Project targets INLINECODE3
- DLL is in the correct
lib/net8.0/ path relative to .vl document - Project builds without errors
Allocations Causing Frame Drops
Symptom: GC spikes, stuttering, frame drops.
Diagnosis: Allocations in the Update loop.
Common culprits:
- -
new keyword in Update method - LINQ operators (
.Where(), .Select(), .ToList()) - String concatenation (
+ operator on strings) - Boxing value types (passing
int where object expected)
Fix: Cache everything, pre-allocate buffers, eliminate LINQ from hot paths.
Missing Change Detection
Symptom: CPU usage high even when nothing changes.
Fix: Compare inputs to cached values, only recompute on change.
CODEBLOCK2
Downstream Nodes See null/default
Symptom: Connected nodes get no data, even though the node "works".
Fix: Always output cached result, even when no computation happens.
CODEBLOCK3
SDSL Shader Issues
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.
Runtime Issues
Memory Leaks
Symptom: Memory usage grows over time.
Causes:
- - Missing
IDisposable on nodes with native resources - COM objects (
ComPtr<T>) not disposed - Event handler subscriptions not unsubscribed
Thread Safety
Symptom: Intermittent crashes, data corruption.
Fix: Update() runs on the main thread. Capture SynchronizationContext in the constructor, then marshal background results back:
CODEBLOCK4
Circular Dependencies
Symptom: vvvv warns about circular dependency, patch won't compile.
Fix: Insert a FrameDelay node to break the cycle.
Build Issues
Target Framework Mismatch
Symptom: DLL loads but types aren't found.
Fix: Ensure .csproj targets net8.0 (matching vvvv gamma's runtime).
Assembly Version Conflicts
Symptom: FileLoadException or TypeLoadException at runtime.
Fix: Align package versions with vvvv's bundled versions. Check vvvv's lib/ folder for reference.
For detailed error-to-solution mapping, see error-catalog.md.
vvvv gamma 故障排除
C# / ProcessNode 问题
类名中的Node后缀
症状:节点能工作,但在 vvvv 中显示的名称不美观。
修复:移除Node后缀——vvvv 规范禁止使用该后缀。
csharp
// 错误
[ProcessNode]
public class SteeringBehaviorNode { }
// 正确
[ProcessNode]
public class SteeringBehavior { }
输出参数位于输入参数之后
症状:引脚顺序错误或节点无法正确编译。
修复:out 参数必须放在 Update 签名的最前面。
csharp
// 错误
public void Update(float input = 0f, out float result) { ... }
// 正确
public void Update(out float result, float input = 0f) { ... }
节点未出现在节点浏览器中
症状:你的 C# 类存在,但未在 vvvv 中显示。
修复:按顺序检查以下内容:
- 1. 项目中存在 [assembly: ImportAsIs] 特性
- 类上存在 [ProcessNode] 特性
- 项目目标框架为 net8.0
- DLL 位于相对于 .vl 文档的正确 lib/net8.0/ 路径中
- 项目构建无错误
内存分配导致帧率下降
症状:GC 峰值、卡顿、帧率下降。
诊断:Update 循环中存在内存分配。
常见元凶:
- - Update 方法中的 new 关键字
- LINQ 操作符(.Where()、.Select()、.ToList())
- 字符串拼接(字符串上的 + 操作符)
- 值类型装箱(将 int 传递给期望 object 的位置)
修复:缓存所有内容,预分配缓冲区,从热点路径中移除 LINQ。
缺少变化检测
症状:即使没有变化,CPU 使用率也很高。
修复:将输入与缓存值进行比较,仅在变化时重新计算。
csharp
if (param != _lastParam)
{
_cached = Compute(param);
_lastParam = param;
}
result = _cached; // 始终输出缓存值
下游节点看到 null/默认值
症状:连接的节点没有收到数据,尽管节点能工作。
修复:即使没有进行计算,也始终输出缓存结果。
csharp
// 错误——输出仅在 if 块内设置
public void Update(out float result, float input = 0f)
{
if (input != _last)
{
result = Compute(input);
_last = input;
}
// 当输入未变化时,result 未赋值!
}
// 正确——始终赋值输出
public void Update(out float result, float input = 0f)
{
if (input != _last)
{
_cached = Compute(input);
_last = input;
}
result = _cached;
}
SDSL 着色器问题
关于 SDSL 语法规则、常见错误以及正确/错误示例,请参考 vvvv-shaders 技能及其 syntax-rules.md 文件。关键问题:static const 作用域、缺少分号、缺少 override、枚举绑定格式。
运行时问题
内存泄漏
症状:内存使用量随时间增长。
原因:
- - 包含原生资源的节点缺少 IDisposable
- COM 对象(ComPtr)未释放
- 事件处理程序订阅未取消
线程安全
症状:间歇性崩溃、数据损坏。
修复:Update() 在主线程上运行。在构造函数中捕获 SynchronizationContext,然后将后台结果编组回来:
csharp
private SynchronizationContext _vlSyncContext;
public MyNode()
{
_vlSyncContext = SynchronizationContext.Current!;
}
// 从后台线程:
vlSyncContext.Post( => { / 在 VL 线程上运行 / }, null);
循环依赖
症状:vvvv 警告存在循环依赖,补丁无法编译。
修复:插入一个 FrameDelay 节点来打破循环。
构建问题
目标框架不匹配
症状:DLL 加载成功但找不到类型。
修复:确保 .csproj 的目标框架为 net8.0(与 vvvv gamma 的运行时匹配)。
程序集版本冲突
症状:运行时出现 FileLoadException 或 TypeLoadException。
修复:将包版本与 vvvv 捆绑的版本对齐。参考 vvvv 的 lib/ 文件夹。
有关详细的错误到解决方案映射,请参见 error-catalog.md。