ChrisRegado / streamdeck-googlemeet

A Stream Deck plugin to manage your Google Meet microphone and camera.
MIT License
318 stars 31 forks source link

Streamdeck plugin not opening websocket server #31

Closed paularmstrong closed 1 year ago

paularmstrong commented 1 year ago

I've been trying to track down why the plugin & extension refuse to work. The browser extension fails to connect to the websocket server. Initially thought this was due to organization configuration with the browser, but I looked a bit deeper and it seems that the ws server is never started up. No relevant logs or failures. I'm not sure where to continue looking… Anyone experienced this or have an idea how to fix?

> nc -vz localhost 2394                                                                                                                                                                                                       
nc: connectx to localhost port 2394 (tcp) failed: Connection refused
nc: connectx to localhost port 2394 (tcp) failed: Connection refused

StreamDeck0.log

14:51:58.9398          int dbgcommand(): using log file '/Users/paularmstrong/Library/Logs/ElgatoStreamDeck/StreamDeck0.log'
14:51:58.9936          int main(): Using preferences from /Users/paularmstrong/Library/Preferences/com.elgato.StreamDeck.plist
14:51:59.0880          void EGQTTranslationManager::LoadLocalizations(): Could not load the 'en_US' localization
14:51:59.0880          void EGQTTranslationManager::LoadLocalizations(): Could not load the Qt 'en_US' localization
14:51:59.0920          int main(): Compiled with Qt 6.3.1 ; SSL: Secure Transport, macOS 13.1
14:51:59.0920          int main(): Runtime SSL Supported: 1
14:51:59.0920          int main(): Runtime SSL version used: Secure Transport, macOS 13.1
14:51:59.0921          int main(): Start Stream Deck App -> Version: 6.0.2
14:51:59.1298          bool ESDCUEHub::init(): ### [CUESDK] init
14:51:59.1298          bool ESDVSDServer::init(): ### [SERVER] init
14:51:59.1301          void ESDCustomPluginCommunication::start(): Using port 28196 to communicate with plugins
14:51:59.1301          void ESDPluginManager::LoadPluginsFromCore(): Load plugins from core...
14:52:00.5504          void AccountMgr::InitializeAccountMgr(): AccountMgr initialized
14:52:00.5505          void AccountMgr::ReloadAllAccountsFromPreferences(): Reload all accounts
14:52:00.5505          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Twitter
14:52:00.5505          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for YouTube
14:52:00.5506          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Streamlabs
14:52:00.5506          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Twitch
14:52:00.5506          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Facebook
14:52:00.6141          MainWindow::MainWindow(): Running in high dpi mode: 2.00
14:52:00.7700          void ESDAppController::bootstrap(): All object init done!
14:52:00.7756          ESDSharedFileServer::ESDSharedFileServer(): mapfile location /Users/paularmstrong/Library/Application Support/com.elgato.streamdeck/STREAMDECKINTERNALSHM
14:52:00.8625          virtual bool MainWindow::event(): Wake up keypad(s).
14:52:00.8851          auto ESDObsConnectionManager::CreateSocket(): SLOBS returned error Connection refused
14:52:01.0385          void ESDAppController::onDeviceStatusChanged(): Device connected, id: @(1)[4057/99/BL38J1B05584], serial number: BL38J1B05584, firmware version: 3.00.001
14:52:01.0417          void ESDPreferenceTabGeneral::DeviceStateChangedNotification(): Dev FW ver: 3.0.1.0, Embed FW ver: 1.3.0.0
14:52:01.0417          void ESDPreferenceTabGeneral::DeviceStateChangedNotification(): show update fw button: no
14:52:01.0417          void ESDPreferenceTabGeneral::DeviceStateChangedNotification(): Serial No: BL38J1B05584
14:52:01.0769          void ESDCustomPluginCommunication::onMessageReceived(): Plugin B59C442F007AFC37A1D9B72CB69E66BE is now connected
14:52:01.1568          void ESDCustomPluginCommunication::onMessageReceived(): Plugin 8AE90D08E16D2E744531D7F753F7456E is now connected
ChrisRegado commented 1 year ago

Hmm, that's odd. To clarify, the Stream Deck plugin (the com.chrisregado.googlemeet.streamDeckPlugin file) installed fine for you and you were able to drag & drop Google Meet buttons onto the Stream Deck, but they just never work?

If the plugin launched, you should be able to do a ps aux | grep com.chrisregado.googlemeet and see a process like the following running:

/Users/chris/Library/Application Support/com.elgato.StreamDeck/Plugins/com.chrisregado.googlemeet.sdPlugin/dist/macos/main/main -port 28196 -pluginUUID CA8E4684E44AEB1D9A2F64585F126A81 -registerEvent registerPlugin -info {"application":{"font":".AppleSystemUIFont","language":"en","platform":"mac","platformVersion":"13.1.0","version":"6.0.2.17735"},"colors":{"buttonPressedBackgroundColor":"#303030FF","buttonPressedBorderColor":"#646464FF","buttonPressedTextColor":"#969696FF","disabledColor":"#007AFF7F","highlightColor":"#007AFFFF","mouseDownColor":"#2EA8FFFF"},"devicePixelRatio":1,"devices":[{"id":"35E111DDB814A2EABF8F096515B63771","name":"Stream Deck","size":{"columns":5,"rows":3},"type":0}],"plugin":{"uuid":"com.chrisregado.googlemeet","version":"1.3.0"}}

If the plugin is completely failing to start (which will also happen if it can't open port 2394), that should appear in the StreamDeck0.log file. For example, I can force a failure by:

  1. Completely quitting the Stream Deck software such that my StreamDeck displays the placeholder Elgato logo. (Right click on the menubar icon and Quit.)
  2. Launching something else that listens on localhost port 2394: nc -v -l 127.0.0.1 2394
  3. Re-launching the Stream Deck app.

Then in my ~/Library/Logs/ElgatoStreamDeck/StreamDeck0.log I see:

18:28:11.0145          int dbgcommand(): using log file '/Users/chris/Library/Logs/ElgatoStreamDeck/StreamDeck0.log'
18:28:11.0638          int main(): Using preferences from /Users/chris/Library/Preferences/com.elgato.StreamDeck.plist
18:28:11.1420          void EGQTTranslationManager::LoadLocalizations(): Could not load the 'en_US' localization
18:28:11.1420          void EGQTTranslationManager::LoadLocalizations(): Could not load the Qt 'en_US' localization
18:28:11.1446          int main(): Compiled with Qt 6.3.1 ; SSL: Secure Transport, macOS 13.1
18:28:11.1446          int main(): Runtime SSL Supported: 1
18:28:11.1447          int main(): Runtime SSL version used: Secure Transport, macOS 13.1
18:28:11.1447          int main(): Start Stream Deck App -> Version: 6.0.2
18:28:11.1722          bool ESDCUEHub::init(): ### [CUESDK] init
18:28:11.1723          bool ESDVSDServer::init(): ### [SERVER] init
18:28:11.1725          void ESDCustomPluginCommunication::start(): Using port 28196 to communicate with plugins
18:28:11.1725          void ESDPluginManager::LoadPluginsFromCore(): Load plugins from core...
18:28:12.4982          void AccountMgr::InitializeAccountMgr(): AccountMgr initialized
18:28:12.4983          void AccountMgr::ReloadAllAccountsFromPreferences(): Reload all accounts
18:28:12.4988          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Twitter
18:28:12.4988          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for YouTube
18:28:12.4988          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Streamlabs
18:28:12.4989          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Twitch
18:28:12.4989          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Facebook
18:28:12.5545          MainWindow::MainWindow(): Running in high dpi mode: 1.00
18:28:12.6821          void ESDAppController::bootstrap(): All object init done!
18:28:12.6882          ESDSharedFileServer::ESDSharedFileServer(): mapfile location /Users/chris/Library/Application Support/com.elgato.streamdeck/STREAMDECKINTERNALSHM
18:28:12.7685          virtual bool MainWindow::event(): Wake up keypad(s).
18:28:12.7873          auto ESDObsConnectionManager::CreateSocket(): SLOBS returned error Connection refused
18:28:12.9309          void ESDCustomPlugin::onNativeProcessFinished(): The plugin 'Google Meet' exited normally with code 1
18:28:12.9310          void ESDCustomPlugin::restartNativeProcess(): Restarting plugin 'Google Meet' in 0 seconds(s)

And Stream Deck will periodically attempt to start it again:

18:28:13.0671          void ESDCustomPlugin::onNativeProcessFinished(): The plugin 'Google Meet' exited normally with code 1
18:28:13.0672          void ESDCustomPlugin::restartNativeProcess(): Restarting plugin 'Google Meet' in 60 seconds(s)
paularmstrong commented 1 year ago

The plugin appears to not be running:

>  ps aux | grep com.chrisregado.googlemeet | grep -V grep                                                                                                                                                                                   
> echo $?
1

I have uninstalled and re-installed the plugin and added buttons for it.

15:55:40.1169          int dbgcommand(): using log file '/Users/paularmstrong/Library/Logs/ElgatoStreamDeck/StreamDeck0.log'
15:55:40.1632          int main(): Using preferences from /Users/paularmstrong/Library/Preferences/com.elgato.StreamDeck.plist
15:55:40.2434          void EGQTTranslationManager::LoadLocalizations(): Could not load the 'en_US' localization
15:55:40.2435          void EGQTTranslationManager::LoadLocalizations(): Could not load the Qt 'en_US' localization
15:55:40.2460          int main(): Compiled with Qt 6.3.1 ; SSL: Secure Transport, macOS 13.1
15:55:40.2461          int main(): Runtime SSL Supported: 1
15:55:40.2461          int main(): Runtime SSL version used: Secure Transport, macOS 13.1
15:55:40.2461          int main(): Start Stream Deck App -> Version: 6.0.2
15:55:40.2748          bool ESDCUEHub::init(): ### [CUESDK] init
15:55:40.2748          bool ESDVSDServer::init(): ### [SERVER] init
15:55:40.2750          void ESDCustomPluginCommunication::start(): Using port 28196 to communicate with plugins
15:55:40.2751          void ESDPluginManager::LoadPluginsFromCore(): Load plugins from core...
15:55:41.6699          void AccountMgr::InitializeAccountMgr(): AccountMgr initialized
15:55:41.6700          void AccountMgr::ReloadAllAccountsFromPreferences(): Reload all accounts
15:55:41.6701          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Twitter
15:55:41.6701          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for YouTube
15:55:41.6702          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Streamlabs
15:55:41.6702          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Twitch
15:55:41.6702          void AccountMgr::RecreateServiceInstancesForType(): Recreate service instances for Facebook
15:55:41.7228          MainWindow::MainWindow(): Running in high dpi mode: 2.00
15:55:41.8577          void ESDAppController::bootstrap(): All object init done!
15:55:41.8640          ESDSharedFileServer::ESDSharedFileServer(): mapfile location /Users/paularmstrong/Library/Application Support/com.elgato.streamdeck/STREAMDECKINTERNALSHM
15:55:41.9342          virtual bool MainWindow::event(): Wake up keypad(s).
15:55:41.9528          auto ESDObsConnectionManager::CreateSocket(): SLOBS returned error Connection refused
15:55:42.1002          void ESDAppController::onDeviceStatusChanged(): Device connected, id: @(1)[4057/99/BL38J1B05584], serial number: BL38J1B05584, firmware version: 3.00.001
15:55:42.1019          void ESDPreferenceTabGeneral::DeviceStateChangedNotification(): Dev FW ver: 3.0.1.0, Embed FW ver: 1.3.0.0
15:55:42.1019          void ESDPreferenceTabGeneral::DeviceStateChangedNotification(): show update fw button: no
15:55:42.1020          void ESDPreferenceTabGeneral::DeviceStateChangedNotification(): Serial No: BL38J1B05584
15:55:42.1399          void ESDCustomPluginCommunication::onMessageReceived(): Plugin F4C36659721AE1C2A2F5BF31BD1A05DC is now connected
15:55:42.2198          void ESDCustomPluginCommunication::onMessageReceived(): Plugin 86EDD5CEBE93AADCD0D7E0C6E92DB158 is now connected
15:55:46.8248          void ESDAppStoreManager::UpdateAppStorePlugins(): Check for Plugin Store updates
15:55:46.8265          void ESDAppStoreManager::UpdateAppStoreIconPacks(): Check for icon pack Store updates
15:55:46.8272          void EGQTSWUpdateDialog::checkForUpdate(): Check for update 2: https://gc-updates.elgato.com/mac/sd-update/final/app-version-check.json
15:55:46.8274          void EGQTSWUpdateDownloader::startDownload(): Download task name: Update File, file URL: https://gc-updates.elgato.com/mac/sd-update/final/app-version-check.json
15:55:46.8303          auto ESDObsConnectionManager::CreateSocket(): SLOBS returned error Connection refused
15:55:47.1988          virtual EGQTSWUpdateDialog::UpdateState EGQTSWUpdateDialog::shouldUpdate(): current SW Ver: 6.0.2.17735, remote SW Ver: 5.3.3.15214
15:55:47.1989          bool EGQTSWUpdateDialog::handleUpdateFileDownloaded(): No update available
15:55:51.8262          auto ESDObsConnectionManager::CreateSocket(): SLOBS returned error Connection refused

(Screenshot just to show plugin installed and button added)

Screenshot 2023-01-03 at 3 59 27 PM
ChrisRegado commented 1 year ago

Hmm, that is very odd. I've never seen that happen before.

Do other non-Javascript plugins work for you? (I see Home Assistant in your screenshot, but that appears to be pure Javascript, which works a little differently with the Elgato SDK.) For example, you should be able to install https://github.com/elgatosf/streamdeck-applemail/releases and see it running in ps aux | grep -i com.elgato.applemail.

There's a list of open-source plugins here if you want to try a different example: https://github.com/madmatt/streamdeck-plugins/blob/master/index.md


I started a new build here (direct download link) just in case there's some recent change in Elgato's build tools for 6.0, but that's just a random guess. I'm also running app v6.0.2 (17735) on Ventura 13.1 on an M1 Max, and old builds are still working fine for me.

paularmstrong commented 1 year ago

Do other non-Javascript plugins work for you? (I see Home Assistant in your screenshot, but that appears to be pure Javascript, which works a little differently with the Elgato SDK.) For example, you should be able to install https://github.com/elgatosf/streamdeck-applemail/releases and see it running in ps aux | grep -i com.elgato.applemail.

Nope! Looks like this is not running either. The Home Assistant plugin is definitely working correctly, though.


The new build you linked also results in nothing running. 😞

ChrisRegado commented 1 year ago

One other thing that comes to mind is both streamdeck-googlemeet and that Apple Mail example are x86 apps rather than native ARM builds, so if your M1 Mac doesn't have Rosetta 2 installed, you'd need to softwareupdate --install-rosetta --agree-to-license.

I'd still expect to see some sort of error in StreamDeck0.log, but that at least sounds like a reasonable bug in StreamDeck 6.0's recent transition to a native Apple Silicon app.


Beyond that, could there be some sort of extra security software / MDM blocking execution of plugins?

What happens if you try to launch the plugin binary directly from a terminal?:

~/Library/Application\ Support/com.elgato.StreamDeck/Plugins/com.chrisregado.googlemeet.sdPlugin/dist/macos/main/main

You should at least be able to get a usage error:

usage: main [-h] -port PORT -pluginUUID PLUGIN_UUID -registerEvent REGISTER_EVENT -info INFO
main: error: the following arguments are required: -port, -pluginUUID, -registerEvent, -info
paularmstrong commented 1 year ago

softwareupdate --install-rosetta --agree-to-license

That was it! Issue completely resolved now.

ChrisRegado commented 1 year ago

Aha, I'll add that to the readme. Before Stream Deck 6.0, Rosetta would need to be installed for the Stream Deck app to run at all, so no one would find themselves in this situation.