SuperCollider server crashes JVM #230

Open
sjmurdoch opened this Issue May 10, 2013 · 8 comments

Comments

Projects
None yet
6 participants

When I try starting Overtone with an internal Super Collider server, the JVM crashes:

$ lein repl
nREPL server started on port 50623
REPL-y 0.1.10
Clojure 1.3.0
    Exit: Control+D or (exit) or (quit)
Commands: (user/help)
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
          (user/sourcery function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
Examples from clojuredocs.org: [clojuredocs or cdoc]
          (user/clojuredocs name-here)
          (user/clojuredocs "ns-here" "name-here")
user=> (use 'overtone.live)
--> Loading Overtone...
--> Booting internal SuperCollider server...
Invalid memory access of location 0x160 rip=0x11e70757c
Exception in thread "Thread-2" java.net.SocketException: The transport's socket appears to have lost its connection to the nREPL server
                                 transport.clj:95 clojure.tools.nrepl.transport/bencode[fn]
                                 transport.clj:95 clojure.tools.nrepl.transport/bencode[fn]
                                 transport.clj:42 clojure.tools.nrepl.transport/fn-transport[fn]
                                    core.clj:1836 clojure.core/binding-conveyor-fn[fn]
                                      AFn.java:18 clojure.lang.AFn.call
                              FutureTask.java:303 java.util.concurrent.FutureTask$Sync.innerRun
                              FutureTask.java:138 java.util.concurrent.FutureTask.run
                      ThreadPoolExecutor.java:895 java.util.concurrent.ThreadPoolExecutor$Worker.runTask
                      ThreadPoolExecutor.java:918 java.util.concurrent.ThreadPoolExecutor$Worker.run
                                  Thread.java:680 java.lang.Thread.run
Bye for now!clojure.lang.ExceptionInfo: Subprocess failed {:exit-code 139}
    at clojure.core$ex_info.invoke(core.clj:4327)
    at leiningen.core.eval$fn__1963.invoke(eval.clj:213)
    at clojure.lang.MultiFn.invoke(MultiFn.java:231)
    at leiningen.core.eval$eval_in_project.invoke(eval.clj:283)
    at leiningen.repl$start_server.invoke(repl.clj:117)
    at leiningen.repl$server$fn__4421.invoke(repl.clj:173)
    at clojure.lang.AFn.applyToHelper(AFn.java:159)
    at clojure.lang.AFn.applyTo(AFn.java:151)
    at clojure.core$apply.invoke(core.clj:617)
    at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1788)
    at clojure.lang.RestFn.invoke(RestFn.java:425)
    at clojure.lang.AFn.applyToHelper(AFn.java:163)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at clojure.core$apply.invoke(core.clj:621)
    at clojure.core$bound_fn_STAR_$fn__4102.doInvoke(core.clj:1810)
    at clojure.lang.RestFn.invoke(RestFn.java:397)
    at clojure.lang.AFn.run(AFn.java:24)
    at java.lang.Thread.run(Thread.java:680)

project.clj is

(defproject tutorial "1.0"
  :dependencies [ [org.clojure/clojure "1.5.1"]
                  [overtone "0.8.1"] ])

sneilan commented May 11, 2013

I see the same issue with same dependencies on OSX 10.7.5 64bit
macaroni-book:tutorial seanneilan$ uname -a
Darwin macaroni-book.cable.rcn.com 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64

macaroni-book:tutorial seanneilan$ lein repl
nREPL server started on port 51392
REPL-y 0.1.10
Clojure 1.3.0
Exit: Control+D or (exit) or (quit)
Commands: (user/help)
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
(user/sourcery function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Examples from clojuredocs.org: [clojuredocs or cdoc](user/clojuredocs name-here)
(user/clojuredocs "ns-here" "name-here")
user=> (use 'overtone.live)
--> Loading Overtone...
--> Booting internal SuperCollider server...
Invalid memory access of location 0x160 rip=0x115d5b57c
java.net.SocketException: The transport's socket appears to have lost its connection to the nREPL server
transport.clj:95 clojure.tools.nrepl.transport/bencode[fn]
transport.clj:95 clojure.tools.nrepl.transport/bencode[fn]
transport.clj:42 clojure.tools.nrepl.transport/fn-transport[fn]
core.clj:1836 clojure.core/binding-conveyor-fn[fn]
AFn.java:18 clojure.lang.AFn.call
FutureTask.java:303 java.util.concurrent.FutureTask$Sync.innerRun
FutureTask.java:138 java.util.concurrent.FutureTask.run
ThreadPoolExecutor.java:895 java.util.concurrent.ThreadPoolExecutor$Worker.runTask
ThreadPoolExecutor.java:918 java.util.concurrent.ThreadPoolExecutor$Worker.run
Thread.java:680 java.lang.Thread.run
Bye for now!Exception in thread "Thread-2" clojure.lang.ExceptionInfo: Subprocess failed {:exit-code 139}

at clojure.core$ex_info.invoke(core.clj:4327)
at leiningen.core.eval$fn__1963.invoke(eval.clj:213)
at clojure.lang.MultiFn.invoke(MultiFn.java:231)
at leiningen.core.eval$eval_in_project.invoke(eval.clj:283)
at leiningen.repl$start_server.invoke(repl.clj:117)
at leiningen.repl$server$fn__4421.invoke(repl.clj:173)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:617)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1788)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:621)
at clojure.core$bound_fn_STAR_$fn__4102.doInvoke(core.clj:1810)
at clojure.lang.RestFn.invoke(RestFn.java:397)

sneilan commented May 11, 2013

I downloaded audio mate since OSX 10.7 removed the ability to change output device sampling rates.
http://audiomateapp.com/

I changed the sampling rate of the built-in output to 44.100 kHz from 48~kHz.
screen shot 2013-05-11 at 12 09 19 pm

This fixed the issue with the supercollider server starting up.

I figured I'd try this since when I booted the SuperCollider server from the SuperCollider app, it gave me some error message about sampling rates:
init_OSC
empty
compiling class library...
NumPrimitives = 688
compiling dir: '/Applications/SuperCollider/SuperCollider.app/Contents/Resources/SCClassLibrary'
pass 1 done
numentries = 784483 / 10926160 = 0.072
5012 method selectors, 2180 classes
method table size 11770072 bytes, big table size 87409280
Number of Symbols 11394
Byte Code Size 357382
compiled 326 files in 0.86 seconds
compile done
Help tree read from cache in 0.0029565509999999 seconds
Class tree inited in 0.02 seconds
Welcome to SuperCollider 3.6.5. For help press Cmd-D.
booting 57110
Number of Devices: 2
0 : "Built-in Microphone"
1 : "Built-in Output"

input and output sample rates do not match. 44100 != 48000
could not initialize audio.
RESULT = 1
ERROR: server failed to start
For advice: [http://supercollider.sf.net/wiki/index.php/ERROR:_server_failed_to_start]

Try downloading the supercollider server itself & booting it.
http://supercollider.sourceforge.net/

That also fixed it for me (though I used "Audio MIDI Setup", which is included with MacOS 10.8. So I think that it's due to the sample rate mismatch though Overtone really shouldn't be crashing instead of reporting the error (or even better – fixing it).

Owner

samaaron commented May 13, 2013

@sjmurdoch It's not Overtone that crashes with mismatched sample rates, but SuperCollider server. If you know how to check for the sample rate and modifiy it from a JVM process, then please do send a pull request.

Sorry for the confusion. The reason I thought it was Overtone is that starting scsynth from the command line is fine. Is the problem that scsynth is checking for the mismatch and refusing to initialise, whereas starting SuperCollider from within Overtone is initialising regardless?

And the best way I've found to access the sample rate of the default device is by parsing the XML output of system_profiler, which is clearly Mac specific and hardly nice.

To see the output, try system_profiler -xml SPAudioDataType

fwiw, I had the same problem and resolved it the same way (using Audio MIDI Setup to reset the sample rate).

saw the same error message as others did: Invalid memory access of location 0x160 rip=0x11f05c57c

I just ran into this with OS X 10.9 and Overtone 0.9.1, and can confirm the diagnosis and solution detailed above. In case it's helpful, here follow my notes about what happened. Perhaps it might be possible to add a note about this to the README? I don't recollect seeing anything, and only found this issue by googling. I haven't used SuperCollider before, so I think it would be useful to note the advice regarding it, even if it's not directly an Overtone issue.


I added the overtone dependency to project.clj, started a REPL, and got the following stacktrace (which also crashed the REPL and resulted in a stopped-working pop-up).

user=> (use 'overtone.live)
--> Loading Overtone...
--> Booting internal SuperCollider server...
Invalid memory access of location 0x160 rip=0x1119ad57c
SocketException The transport's socket appears to have lost its connection to the nREPL server
Exception in thread "Thread-5" clojure.lang.ExceptionInfo: Subprocess failed {:exit-code 139}
  at clojure.core$ex_info.invoke(core.clj:4327)
  at leiningen.core.eval$fn__3532.invoke(eval.clj:226)
  at clojure.lang.MultiFn.invoke(MultiFn.java:231)
  at leiningen.core.eval$eval_in_project.invoke(eval.clj:326)
  at clojure.lang.AFn.applyToHelper(AFn.java:167)
  at clojure.lang.AFn.applyTo(AFn.java:151)
  at clojure.core$apply.invoke(core.clj:619)
  at leiningen.repl$server$fn__7443.invoke(repl.clj:201)
  at clojure.lang.AFn.applyToHelper(AFn.java:159)
  at clojure.lang.AFn.applyTo(AFn.java:151)
  at clojure.core$apply.invoke(core.clj:617)
  at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1788)
  at clojure.lang.RestFn.invoke(RestFn.java:425)
  at clojure.lang.AFn.applyToHelper(AFn.java:163)
  at clojure.lang.RestFn.applyTo(RestFn.java:132)
  at clojure.core$apply.invoke(core.clj:621)
  at clojure.core$bound_fn_STAR_$fn__4102.doInvoke(core.clj:1810)
  at clojure.lang.RestFn.invoke(RestFn.java:397)
  at clojure.lang.AFn.run(AFn.java:24)
  at java.lang.Thread.run(Thread.java:695)
  clojure.tools.nrepl.transport/bencode/fn--4287/fn--4288 (transport.clj:95)
  clojure.tools.nrepl.transport/bencode/fn--4287 (transport.clj:95)
  clojure.tools.nrepl.transport/fn-transport/fn--4261 (transport.clj:42)
  clojure.core/binding-conveyor-fn/fn--4107 (core.clj:1836)
  java.util.concurrent.FutureTask$Sync.innerRun (FutureTask.java:303)
  java.util.concurrent.FutureTask.run (FutureTask.java:138)
  java.util.concurrent.ThreadPoolExecutor$Worker.runTask (ThreadPoolExecutor.java:895)
  java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:918)
  java.lang.Thread.run (Thread.java:695)

I downloaded SuperCollider-3.6.5-OSX-universal.dmg from http://supercollider.sourceforge.net and installed the SuperCollider application. When attempting to start a server by clicking bottom-right or CMD+B, the following error was reported (but the graphical SuperCollider application did not crash):

booting 57110
Number of Devices: 2
   0 : "Built-in Microph"
   1 : "Built-in Output"

input and output sample rates do not match. 96000 != 44100
could not initialize audio.
RESULT = 1
ERROR: server failed to start
For advice: [http://supercollider.sf.net/wiki/index.php/ERROR:_server_failed_to_start]

I used Audio MIDI Setup (installed by default) to change the input sample rate to match the output sample rate, and the SuperCollider server booted fine, as subsequently did Overtone.

mozinator added the scsynth label Jan 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment