Skip to content
New issue

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

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

Already on GitHub? # to your account

Using python-osc as script in OBS, OBS is inoperable. #123

Open
MarioMey opened this issue Aug 26, 2020 · 2 comments
Open

Using python-osc as script in OBS, OBS is inoperable. #123

MarioMey opened this issue Aug 26, 2020 · 2 comments

Comments

@MarioMey
Copy link

I'm trying to use python-osc to make OBS receive and send OSC messages. This OBS plugin uses python-osc to send messages. Inside that code, all osc_server code is commented because it didn't work. But there is a new pull request that allows to do import osc_server, so it would can receive messages.

To receive messages, it is necessary to run server.serve_forever() but this function hangs/freezes OBS waiting for OSC messages. It receives them, it can print messages, it works... but I can't use OBS because it is frozen.

By doing this, I get this:

print(server.serve_forever.__doc__)
Handle one request at a time until shutdown.
         Polls for shutdown every poll_interval seconds. Ignores
         self.timeout. If you need to do periodic tasks, do them in
         another thread.

How should I run server.serve_forever() in another thread?

@hackery
Copy link

hackery commented Feb 1, 2022

Perhaps wrap the server_forever call in a Thread, something like

server = osc_server.ThreadingOSCUDPServer(("0.0.0.0", 8080), dispatcher)
thread = Thread(target=server.serve_forever, daemon=True).start()

Use a daemon thread type because there doesn't seem to be an interface to stop() the OSC server.

@MarioMey
Copy link
Author

MarioMey commented Feb 2, 2022

Well, since this thread is a bit old... yes, your suggestion is what I'm actually using since beggining of last year...

Anyway, thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants