Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageTimeout #70

Open
niklasberlin opened this issue Dec 22, 2021 · 3 comments
Open

MessageTimeout #70

niklasberlin opened this issue Dec 22, 2021 · 3 comments
Labels

Comments

@niklasberlin
Copy link

Hi, i'm having a Problem with getting a MessageTimeout after i send a request to GetSceneItemList with the current PreviewScene after an on_preview Event, when i try this on other parts of my code it works fine and does not result in a timeout. According to the log of OBS and Wireshark a response (including "status":"ok") is send by the websocket plugin

in other words:
when i make the request (GetSceneItemList) at the begining of my script (with the Scene Name i get via the getPreviewScene Request) evrything works fine, but when i make the request as a response for an PreviewSceneChange with the Scene name i get from the Event, the request runs into a timeout even though OBS and Wireshark confirm that a response has been send

here is a output from my terminal:

Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\Niklas\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
self.run()
File "C:\Users\Niklas\AppData\Local\Programs\Python\Python310\lib\site-packages\obswebsocket\core.py", line 236, in run
self.core.eventmanager.trigger(obj)
File "C:\Users\Niklas\AppData\Local\Programs\Python\Python310\lib\site-packages\obswebsocket\core.py", line 281, in trigger
callback(data)
File "C:\Users\Niklas\Documents\scripte\python\obs-ws\app.py", line 120, in on_preview
scene_Prev = getSrcForScene(current_Prev)
File "C:\Users\Niklas\Documents\scripte\python\obs-ws\app.py", line 46, in getSrcForScene
result = ws.call(requests.GetSceneItemList(sceneName))
File "C:\Users\Niklas\AppData\Local\Programs\Python\Python310\lib\site-packages\obswebsocket\core.py", line 162, in call
r = self.send(payload)
File "C:\Users\Niklas\AppData\Local\Programs\Python\Python310\lib\site-packages\obswebsocket\core.py", line 179, in send
return self._wait_message(message_id)
File "C:\Users\Niklas\AppData\Local\Programs\Python\Python310\lib\site-packages\obswebsocket\core.py", line 187, in _wait_message
raise exceptions.MessageTimeout(u"No answer for message {}".format(
obswebsocket.exceptions.MessageTimeout: No answer for message 18


I tested this on a windows 10 and an ubuntu Maschine, both running OBS Version 27.1.3 and obs-websocket-py Version 0.5.3

@niklasberlin
Copy link
Author

i have created a minimalistic example that reproduces the error on my side:

timeout-demo.zip

@zyzniewski
Copy link

Looks like sending requests blocks receiving thread while still processing event handler. Should be solved with #37

@ajhollenbach
Copy link

ajhollenbach commented Jan 15, 2023

Receiving this error again with Web Socket Server built into OBS Studio 29.0.0 running the switch_scenes.py sample.

@Elektordi Elektordi added the bug label Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants