Websocket opdoce
Date | 2016-08-30 00:14 |
From | Hlöðver Sigurðsson |
Subject | Websocket opdoce |
As I am experimenting with pnacl csound, I came with the thought that websocket would be a good protocol to communicate with the browser trough csound. So I went wild trying to update libwebsocket to current version 2.0 (in the beginning I just thought that the variable names had been wrongly assigned, but the opcode is designed for older verison 1.x). So this would be a general question about how to debug csound, I get segfault and Im curious to find out where it's coming from.
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
My snail slowing progress of chasing errors and recompiling WebSocketsOpcode.c is here: https://www.refheap.com/122631 (also in cmake the lib name is said to be websockets when my .so file says libwebsockets, so I changed cmake as well, but I may be going in totally wrong direction). |
Date | 2016-08-30 01:09 |
From | Steven Yi |
Subject | Re: Websocket opdoce |
We generally try to avoid using the same name for opcode libraries as those we might link to or other popular libraries. For example, we changed the stk opcodes from libstk.so to libstkops.so. We should do the same for the websocket opcodes in this case. (If you would file a ticket for it, that'd be great.) For debugging, generally what I do is use gdb from the command line. I would use something like: >> gdb csound -- name_of_project.csd >> r Instead of using the dashes to set args for what you'll be running, you can use this from the gdb prompt: >> set args name_of_project.csd then use r to run. With just this setup, whenever a segfault occurs, gdb should catch the error and report it it, then provide a prompt. At the prompt, you can use "bt" to get a backtrace, which should then print out the call stack up until the point it segfaulted. If the information at that point isn't enough, you could use a breakpoint to pause execution once you get to a function. You can do something like this before using 'r' on the gdb prompt: >> break name_of_function If the function is within a library, gdb might say something like the symbol isn't found but do you want to go ahead and break on it if it's loaded from a library. Say yes. Once a breakpoint is hit, you get the prompt. You can use 'bt' again, but at this point, you can use commands like 'n' to move step through the function. You might also use print to print the value of a variable before continuing forward with evaluation. Hope that helps! steven On Mon, Aug 29, 2016 at 7:14 PM, Hlöðver Sigurðsson |
Date | 2016-08-30 06:39 |
From | Tarmo Johannes |
Subject | Re: Websocket opdoce |
Hi, For any case I mention - as much I know, Csound pnacl cannot use csound plugins and websockets opcode is one... Great that you are working on it and finding problems/bugs of the websocket opcode anyway! Tarmo 30.08.2016 2:14 kirjutas kuupäeval "Hlöðver Sigurðsson" <hlolli@gmail.com>:
|
Date | 2016-08-30 13:04 |
From | Michael Gogins |
Subject | Re: Websocket opdoce |
You can use websockets from Javascript and Javascript can communicate with csound via channels. Regards, On Aug 30, 2016 1:39 AM, "Tarmo Johannes" <tarmo.johannes@otsakool.edu.ee> wrote:
|
Date | 2016-08-30 13:46 |
From | Ed Costello |
Subject | Re: Websocket opdoce |
As Michael said you can just use websockets directly with javascript no need for the opcode. Yeah the opcode was built for libwebsockets 1.4 I think, I see that there is a whole new version out, if you need any help with understanding any the code just let me know. Ed On Tue, 30 Aug 2016 at 13:04 Michael Gogins <michael.gogins@gmail.com> wrote:
-- Edward Costello |
Date | 2016-08-30 13:51 |
From | Hlöðver Sigurðsson |
Subject | Re: Websocket opdoce |
Thanks Steven, will try debugging after work, as for why I want to experiment with websockets, is that I want to see if I can connect kr signals to three.js or some javascript shader library without the browser as a man in the middle, as well as seeing possibility of connecting metro clocks to other apps. I'm just assumeing that osc in the browser will get selinux and all firewalls to scream and I've heard that websockets are often used to send data into and from the browser. I didn't notice outgoing channels from csound pnacl in the documentation from Victor but I'm sure its possible. Let's see if this is a dead end experiment or not, I could always use channel and then websocket in js. 2016-08-30 14:46 GMT+02:00 Ed Costello <phasereset@gmail.com>:
|
Date | 2016-08-30 13:54 |
From | Richard |
Subject | Re: Websocket opdoce |
For completeness: you can also use server side websockets from Python (Flask or Django), should you want to run Csound locally... Richard On 30/08/16 14:46, Ed Costello wrote:
|
Date | 2016-08-30 23:36 |
From | Hlöðver Sigurðsson |
Subject | Re: Websocket opdoce |
Server side websockets would be sweet, a way of many to collaborate music trough the internet. But as for getting the new libwebsockets to work has been a good c programming practice for me but I have to admit my defeat. I don't get any segfaults anymore and gdb debugger just goes in circle from Websocket_callback to process_thread, so it looks like all the operations are leagal. But the result is now that I get after few seconds `websocket: variable klfo data not sent,buffer overrrun`. I may end up just using v1.4, some more experienced person is welcome to look at the code https://www.refheap.com/122651 2016-08-30 14:54 GMT+02:00 Richard <zappfinger@gmail.com>:
|