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

Overtone neither able to connect, nor to start SuperCollider server #467

Closed
moritzschaefer opened this issue Nov 27, 2020 · 12 comments
Closed

Comments

@moritzschaefer
Copy link

I'm using NixOS and got jack running using

pasuspender qjackctl
[I] moritz@moxps ~/Music> ps aux | grep jack
moritz   13549  0.0  0.0 493980  5876 pts/0    S+   19:44   0:00 pasuspender qjackctl
moritz   13550  0.0  0.6 1061380 200820 pts/0  SLl+ 19:44   0:01 /run/current-system/sw/bin/qjackctl
moritz   14067  0.3  0.4 284176 131204 ?       SLsl 19:45   0:05 /run/current-system/sw/bin/jackd -dalsa -dhw:0 -r48000 -p1024 -n2

jack_simple_client does produce a tone and I am able to generate tones using the SuperCollider IDE (so my JACK server seems to be working fine).

When I try to run overtone.live, it is however unable to start the internal SC server:

[I] moritz@moxps ~/t/insane> clojure
Clojure 1.10.1
user=> (use 'overtone.live)
--> Loading Overtone...
SC FFT global init: cosTable initialised.
--> Booting internal SuperCollider server...
Cannot read socket fd = 94 err = Success
CheckRes error
Could not read result type = 22
Client name = Overtone conflits with another running client
Cannot connect to the server
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
could not initialize audio.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f0b45198ba7, pid=22986, tid=23076
#
# JRE version: OpenJDK Runtime Environment (14.0.2) (build 14.0.2-internal+0-adhoc..jdk14u-jdk-14.0.2-ga)
# Java VM: OpenJDK 64-Bit Server VM (14.0.2-internal+0-adhoc..jdk14u-jdk-14.0.2-ga, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libscsynth.so.1+0x63ba7]  World_WaitForQuit+0x7
#
# Core dump will be written. Default location: Core dumps may be processed with "/nix/store/7aa53389d52a35h5f5x79pph0qi7kchz-systemd-246.6/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/moritz/tmp/insane/core.22986)
#
# An error report file with more information is saved as:
# /home/moritz/tmp/insane/hs_err_pid22986.log
--> Connecting to internal SuperCollider server...
[thread 23047 also had an error]
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
fish: “clojure” terminated by signal SIGABRT (Abort)
[I] moritz@moxps ~/t/insane [SIGABRT]>

Further, when I boot a server in the SuperCollider IDE and try to use that one with overtone, I get a timeout error:


[I] moritz@moxps ~/t/insane [SIGABRT]> clojure
Clojure 1.10.1
user=> (use 'overtone.core)
--> Loading Overtone...
SC FFT global init: cosTable initialised.
--> Please boot a server to start making noise:
    * (boot-server)             ; boot default server (honours config)
    * (boot-internal-server)    ; boot an internal server
    * (boot-external-server)    ; boot an external server
    * (connect-external-server) ; connect to an existing external server

nil
user=> (connect-external-server)
--> Connecting to external SuperCollider server: 127.0.0.1:57110
java.util.concurrent.TimeoutException: deref! timeout error. Dereference took longer than 5000 ms whilst whilst turning server notifications on
        at overtone.helpers.lib$deref_BANG_.invokeStatic(lib.clj:275)
        at overtone.helpers.lib$deref_BANG_.invoke(lib.clj:261)
        at overtone.helpers.lib$deref_BANG_.invokeStatic(lib.clj:269)
        at overtone.helpers.lib$deref_BANG_.invoke(lib.clj:261)
        at overtone.sc.machinery.server.connection$server_notifications_on.invokeStatic(connection.clj:64)
        at overtone.sc.machinery.server.connection$server_notifications_on.invoke(connection.clj:33)
        at overtone.sc.machinery.server.connection$setup_connect_handlers$handler_fn__4099.invoke(connection.clj:120)
        at overtone.libs.handlers$run_handler.invokeStatic(handlers.clj:135)
        at overtone.libs.handlers$run_handler.invoke(handlers.clj:129)
        at overtone.libs.handlers$run_one_shot_handlers.invokeStatic(handlers.clj:201)
        at overtone.libs.handlers$run_one_shot_handlers.invoke(handlers.clj:195)
        at overtone.libs.handlers$emhs_handle_async_one_shots$fn__1644.invoke(handlers.clj:208)
        at clojure.lang.AFn.run(AFn.java:22)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at java.base/java.lang.Thread.run(Thread.java:832)
Execution error at overtone.libs.deps/wait-until-deps-satisfied (deps.clj:184).
The following deps took too long (20 seconds) to be satisfied: :server-ready

Is this an error on my (configuration) side or a bug?

@hlolli
Copy link
Member

hlolli commented Nov 27, 2020

luckily I'm also on nixos (and the .so libraries are patched with patchelf on nixos). But I need to test what's going on here, it could be some conflict happening in the dynamic loader, which is picking up both your supercollider and the distributed binaries. For completion, which overtone version or revision are you running on?

@moritzschaefer
Copy link
Author

moritzschaefer commented Nov 27, 2020

Hey @hlolli, thanks for tuning in. It's 0.10.6.
Also, please let me know if and how I can provide more useful debug outputs. A timeout error is not really helpful it seems.

@moritzschaefer
Copy link
Author

Or, since you use NixOS, do you have a nix file for a SuperCollider (/overtone) environment?

@moritzschaefer
Copy link
Author

I got it running with the following steps

  • run 'scsynth -u 57110
  • Run clojure from a directory with the corresponding deps.edn
  • Run (use 'overtone.core) and (connect-to-external-server)
  • Connect the outputs of supercollider to the system-playback in the JACK-graph (opened from QJACKcontrol).

I leave this issue open, since the internal server would still be a lot more convenient if it worked.

Also I appreciate any hints on how to automate these steps (especially the last one)

@whatevergeek
Copy link

whatevergeek commented Jan 13, 2021

I got it running with the following steps

  • run 'scsynth -u 57110
  • Run clojure from a directory with the corresponding deps.edn
  • Run (use 'overtone.core) and (connect-to-external-server)
  • Connect the outputs of supercollider to the system-playback in the JACK-graph (opened from QJACKcontrol).

I leave this issue open, since the internal server would still be a lot more convenient if it worked.

Also I appreciate any hints on how to automate these steps (especially the last one)

thanks for sharing this info... it helped me to at least get something running :-)

I was using lein and did the following:

step 1:
run the following on a terminal:
scsynth -u 57110

step 2:
$ lein new insane-noises

# add the following dependencies to insane-noises/project.clj
# [org.clojure/clojure "1.9.0"]
# [overtone "0.10.6"]

$ cd insane-noises
$ lein repl

step 3: (in the repl)
insane-noises.core=> (use 'overtone.core)
insane-noises.core=> (connect-external-server 57110)

step 4: (playing sound in the repl)
insane-noises.core=> (demo (sin-osc))

@eethann
Copy link

eethann commented Jan 26, 2021

I use the same approach as @whatevergeek.

@wcerfgba
Copy link

Also having this problem -- I cannot boot an internal or external scsynth from Overtone, I have to start it in a separate terminal, connect the outputs in JACK, and only then can I connect Overtone to scsynth.

@gjpower
Copy link

gjpower commented Sep 4, 2021

Can we put a notice of this issue on the main readme? I wasted a silly amount of time going in circles thinking my JACK server was somehow broken when it was working for everything else.

@mathgamain
Copy link

Same thing happened to me, I have to connect to external server and connect the outputs with jack before hearing anything. I this issue could indeed be more prominently noted.

@fleimgruber
Copy link

fleimgruber commented Apr 18, 2022

For anyone involved who got it working via the steps above, please see #484. Do you have any ideas on how to debug this further? For me no sound is played back.

@stevenleeg
Copy link

In case anyone runs into this issue on Fedora, @whatevergeek's steps worked for me, however I was also seeing the following error while trying to run (connect-external-server):

insane-noises.core=> (connect-external-server)
Execution error (IOException) at java.lang.ProcessImpl/forkAndExec (ProcessImpl.java:-2).
error=2, No such file or directory

After some digging around in the source, I found that the issue was caused by this function trying to run the jack_lsp command, which wasn't installed on my machine.

After running sudo dnf install jack-audio-connection-kit-example-clients (which contains that command) I was finally able to get some sound out of overtone!

@plexus
Copy link
Contributor

plexus commented Jan 8, 2024

Hey everyone, we've put out several new releases of Overtone in the last two months, with a bunch of changes and improvements to how SuperCollider is handled. We no longer embed our own supercollider, so you do have to install it manually yourself, but starting scsynth and connecting jack should be much more robust now. We also no longer rely on jack_lsp or jack_connect, instead we connect as a jack client directly to make the connections.

I'm going to close this now as I think the main issue has been resolved. Please do open a new issue if you still encounter problems!

Thank you very much.

@plexus plexus closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants