byulparan / cl-collider

A SuperCollider client for CommonLisp
Other
218 stars 23 forks source link

Undefined function osc:encode-message - can't server-quit #125

Closed j0ni closed 1 year ago

j0ni commented 1 year ago

Hello!

Thanks for your excellent toolkit, I'm having fun with it.

I have been stepping through your examples, and discovered that I cannot call (server-quit *s*) without error. Here is the stack trace with some bits expanded from a sly buffer in emacs:

Backtrace:
 0: ("undefined function" "/done" "/quit")
      [No Locals]
 1: (SC-OSC:CLOSE-DEVICE #<SC-OSC:OSC-DEVICE {10044F8853}>)
      Locals:
        OSC-DEVICE = #<SC-OSC:OSC-DEVICE {10044F8853}>
        SOCKET = #<USOCKET:DATAGRAM-USOCKET {10044F87F3}>
 2: ((:METHOD SERVER-QUIT (CL-COLLIDER::RT-SERVER)) #<CL-COLLIDER::EXTERNAL-SERVER localhost-127.0.0.1:44444>) [fast-method]
 3: ((SB-C::TOP-LEVEL-FORM (LET* ((#1=#:SYNTHDEF0 (MAKE-INSTANCE #2=# :NAME "saw-synth")) (CL-COLLIDER::*SYNTHDEF* #1#)) (WITH-CONTROLS ((NOTE 60) (DUR 4.0)) (LET* (#2# #2# #2#) (OUT.AR 0 #2#)) (CL-COLLID..
 4: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file /home/joni/Scratch/lisp/fiddle/songs.fasl" {10011D8AD3}> :TABLE #(579 #1="/home/joni/Scratch/lisp/fiddle/songs.lis..
 5: ((LAMBDA NIL :IN SB-FASL::LOAD-AS-FASL))
 6: (SB-IMPL::CALL-WITH-LOADER-PACKAGE-NAMES #<FUNCTION (LAMBDA NIL :IN SB-FASL::LOAD-AS-FASL) {10011DB90B}>)
 7: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /home/joni/Scratch/lisp/fiddle/songs.fasl" {10011D8AD3}> NIL NIL)
 8: ((LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) #<SB-SYS:FD-STREAM for "file /home/joni/Scratch/lisp/fiddle/songs.fasl" {10011D8AD3}> T)
 9: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) {7F4323CC6D5B}> #<SB-SYS:FD-STREAM for "file /home/joni/Scratch/lisp/fiddle/songs.fasl" {10011D8AD3}> T #<SB-SYS:F..
10: (LOAD #P"/home/joni/Scratch/lisp/fiddle/songs.fasl" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST :ERROR :EXTERNAL-FORMAT :DEFAULT)
11: (SLYNK:LOAD-FILE "/home/joni/Scratch/lisp/fiddle/songs.fasl")
12: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SLYNK:LOAD-FILE "/home/joni/Scratch/lisp/fiddle/songs.fasl") #<NULL-LEXENV>)
13: (EVAL (SLYNK:LOAD-FILE "/home/joni/Scratch/lisp/fiddle/songs.fasl"))
14: (SLYNK:EVAL-FOR-EMACS (SLYNK:LOAD-FILE "/home/joni/Scratch/lisp/fiddle/songs.fasl") ":sc-user" 2390)
15: ((LAMBDA NIL :IN SLYNK::SPAWN-WORKER-THREAD))
16: (SLYNK-SBCL::CALL-WITH-BREAK-HOOK #<FUNCTION SLYNK:SLYNK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL :IN SLYNK::SPAWN-WORKER-THREAD) {10011D802B}>)
17: ((FLET SLYNK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/joni/Scratch/emacs/neumacs/straight/repos/sly/slynk/backend/sbcl.lisp") #<FUNCTION SLYNK:SLYNK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL :IN SLYNK::..
18: ((LAMBDA NIL :IN SLYNK::CALL-WITH-LISTENER))
19: (SLYNK::CALL-WITH-BINDINGS ((*PACKAGE* . #<PACKAGE "SC-USER">) (*DEFAULT-PATHNAME-DEFAULTS* . #P"/home/joni/") (* . #1="/home/joni/.local/share/SuperCollider/synthdefs/") (** . #2=#<CL-COLLIDER::NODE ..
20: ((LAMBDA NIL :IN SLYNK::SPAWN-WORKER-THREAD))
21: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
22: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-THREAD::RUN))
23: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
24: ((FLET "WITHOUT-INTERRUPTS-BODY-4" :IN SB-THREAD::RUN))
25: (SB-THREAD::RUN)
26: ("foreign function: call_into_lisp_")
27: ("foreign function: funcall1")

I'm not sure where this function is defined, but it isn't in the osc package - I tried quickloading that. There is an encode-message function in the osc/osc.lisp file, but it is below a (in-package :sc-osc) call. I might try making that change locally to test the theory that this is what you intended, but I would like your advice.

Let me know if there's anything else I can provide to help.

byulparan commented 1 year ago

I was fixed call sc-osc:encode-message in sc-osc:close-device instead osc:encode-message. 618cd6b98be6f505adc673b1869df2d3a05a4cfb please test it.

I use osc package in quicklisp(osc-20190521-git) and It have encode-message. check it your osc package.

byulparan commented 1 year ago

ah! osc package updated (osc-20221106) and It changed API. I need more test, but cl-collider seems works well. please update and test it!

Thanks!

j0ni commented 1 year ago

Yep, that does the trick, thank you! Please close this as you see fit.

I'm not sure what the mechanism for release is with Quicklisp. FWIW, I also use Ultralisp as a QL distribution, which releases all day every day :)

Will this fix be in the next QL update?

Thanks again!

byulparan commented 1 year ago

Will this fix be in the next QL update?

maybe :-) Thank you!