one-click-studio / gabin

Automate camera switching with OBS, Bitfocus Companion and any audio api.
https://oneclickstudio.fr
MIT License
496 stars 34 forks source link

(pre-release 0.2.5) Crash au moment de lancer l'autocam #50

Closed christophermh44 closed 1 year ago

christophermh44 commented 1 year ago

Après avoir configuré mon profil dans la pre-release 0.2.5, l'application a crashé.

La configuration était établie comme suit :

Voici la trace des logs :

01:37:32 [Gabin - main process 🤖] New gabin client connected 2023-05-26 01:37:32.0962139 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '620'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.0966568 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '623'. It is not used by any node and should be removed from the model.
2023-05-26 01:37:32.0968680 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '625'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.0973148 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '629'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.0975061 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '628'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.0978603 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '131'. It is not used by any node and should be removed from the model.
2023-05-26 01:37:32.0980087 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '134'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.0983212 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '136'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.0984340 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '140'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.0985649 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '139'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.2137832 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '620'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.2139599 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '623'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.2142208 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '625'. It is not used by any node and should be removed from the model.
2023-05-26 01:37:32.2143900 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '629'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.2147683 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '628'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.2151971 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '131'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.2153912 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '134'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.2155519 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '136'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.2156992 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '140'. It is not used by any node and should be removed from the model.
2023-05-26 01:37:32.2158312 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '139'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3046578 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '620'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3048366 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '623'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3049589 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '625'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3051386 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '629'. It is not used by any node and should be removed from the model.
2023-05-26 01:37:32.3053454 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '628'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3058453 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '131'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3059883 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '134'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3061775 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '136'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3063369 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '140'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3064997 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '139'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3944424 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '620'. It is not used by any node and should be removed from the model.
2023-05-26 01:37:32.3949175 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '623'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3952927 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '625'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3954763 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '629'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] R[1] 2023-05-26 01[1] 2023-05-26 01:37:32.3956181 [W[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitiali[1] 2023-05-26 01:37:32.3956181[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitia[1] 2023-05-26 01:37:32.3956[1] 2023-05-26 01:37:32.3956[1] 2023-05-26[1] 2023-05-26[1] 2023-05-26 01:37:32.3956[1] 2023-05-26[1] 2023-05-26[1] 2023-05-26[1] 2023-05-26 01:37:32.3956181 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '628'. It is not used by any node and should be removed from the model.
2023-05-26 01:37:32.3959201 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '131'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3961775 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '134'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3962915 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '136'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3964072 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '140'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.3965608 [W:onnxruntime:, graph.cc:3490 onnxruntime::Graph::CleanUnusedInitializersAndNodeArgs] Removing initializer '139'. It is not used by any node and should be removed from the model.
[1] 2023-05-26 01:37:32.4484837 [E:onnxruntime:, sequential_executor.cc:494 onnxruntime::ExecuteKernel] Non-zero status code returned while running Pad node. Name:'Pad_63' Status Message: Cannot use 'reflect' mode to pad dimension with a value of 0. Input shape:{1,1,1,0}
2023-05-26 01:37:32.4490770 [E:onnxruntime:, sequential_executor.cc:494 onnxruntime::ExecuteKernel] Non-zero status code returned while running If node. Name:'If_25' Status Message: Non-zero status code returned while running Pad node. Name:'Pad_63' Status Message: Cannot use 'reflect' mode to pad dimension with a value of 0. Input shape:{1,1,1,0}     [1]
[1] 01:37:32 [Gabin - main process 🤖] Error: Non-zero status code returned while running If node. Name:'If_25' Status Message: Non-zero status code returned while running Pad node. Name:'Pad_63' Status Message: Cannot use 'reflect' mode to pad dimension with a value of 0. Input shape:{1,1,1,0}
[1]     at C:\***\gabin\node_modules\.pnpm\onnxruntime-node@1.14.0\node_modules\onnxruntime-node\lib\backend.ts:41:42
    at processTicksAndRejections (node:internal/process/task_queues:77:11)
[1] 01:37:32 [Gabin - main process 🤖] Cleaning...
01:37:32 [Gabin - main process 🤖] Client disconnected ***
01:37:32 [osc-server] osc-server server disconnected
01:37:32 [osc-server] cleaning osc-server server [nodemon] app crashed - waiting for file changes before starting...
christophermh44 commented 1 year ago

Précision utile :

Le bug semble survenir quand j'utilise les drivers ASIO de Reaper (ReaRoute) ou de VoiceMeeter. Avec les drivers ASIO4ALL, cela semble fonctionner. (Dans mon setup, c'est Reaper que j'utilise)

tillderoquefeuil commented 1 year ago

J'ai l'impression que l'asio envoyé par Reaper ne plait pas du tout au VAD. Malheureusement je ne vais pas avoir le temps de recréer le setup pour m'occuper de ça pour le moment. Si jamais tu mets les mains dedans, une PR est la bienvenue!

christophermh44 commented 1 year ago

J'ai été fouiller un peu dans le code. Je ne suis pas encore en mesure de faire une PR, mais j'ai une piste intéressante.

Le buffer envoyé au VAD avait une longueur de 0 avec ReaRoute (alors qu'avec ASIO4ALL, j'avais un "vrai" buffer).

En creusant, j'ai pu voir que RtAudio au moment de l'ouverture du stream (https://almoghamdani.github.io/audify/classes/RtAudio.html#openStream) renvoie la taille du buffer qu'il utilise. Bien qu'on lui demande une taille de 960, lui indique travailler avec un buffer de 128.

Si bien que la fonction setBufferSize reçoit 128 en paramètre.

Derrière, on calcule les 3 valeurs minimales : sampleRate / 50, sampleRate / 50 * 2 et sampleRate / 50 * 3 ce qui, dans mon cas, donne 960, 1920 et 2880.

Comme ces valeurs sont toutes supérieures à 128, alors la variable this._bufferSize restera égale à 0.

Ensuite vient la fonction processChannel qui tronque le buffer reçu si jamais la taille du buffer est différente de this._bufferSize. Comme this._bufferSize est égal à 0, alors le buffer analysé ensuite est complètement vide.

Mais il reste encore un problème. SI je force la taille du buffer à 128… j'ai toujours une erreur. Mais différente :

[1] 2023-05-29 12:18:20.4995399 [E:onnxruntime:, sequential_executor.cc:494 onnxruntime::ExecuteKernel] Non-zero status code returned while running Conv node. Name:'Conv_132' Status Message: Invalid input shape: {4}
[1] 2023-05-29 12:18:20.4997998 [E:onnxruntime:, sequential_executor.cc:494 onnxruntime::ExecuteKernel] Non-zero status code returned while running If node. Name:'If_25' Status Message: Non-zero status code returned while running Conv n
ode. Name:'Conv_132' Status Message: Invalid input shape: {4}
[1]
[1] 12:18:20 [Gabin - main process 🤖] Error: Non-zero status code returned while running If node. Name:'If_25' Status Message: Non-zero status code returned while running Conv node. Name:'Conv_132' Status Message: Invalid input shape:
{4}
[1]     at C:\Users\Christopher\Documents\Apps\gabin\node_modules\.pnpm\onnxruntime-node@1.14.0\node_modules\onnxruntime-node\lib\backend.ts:41:42
    at processTicksAndRejections (node:internal/process/task_queues:77:11)

Visiblement l' « input shape » de {4} ne lui convient pas plus que celui qui était de {1,1,1,0} dans l'erreur précédente.

Je ne sais pas du tout ce que ça veut dire 😅. J'ai cru voir qu'il y avait du Machine Learning derrière ça, mais malheureusement mes connaissances s'arrêtent ici 😐

Si ça peut t'apporter plus d'infos pour diagnostiquer le problème, ça sera toujours ça de gagné ^^ De mon côté, je continuerai plus tard de voir si je trouve d'autres infos à ce sujet :)

christophermh44 commented 1 year ago

UPDATE - J'ai essayé de remplir les buffers de 0 jusqu'à obtenir des buffers d'une taille forcée à 960 et ça ne crashe plus. Par contre, je ne sais pas si la détection est idéale dans cette situation, donc je pense qu'il sera peut-être mieux de créer un autre buffer qui se remplit petit à petit jusqu'à obtenir un buffer de taille suffisante pour le passer à Silero ?