问题
I am just beginning to learn audio programming using supercollider. When I play a sound I am able to hear it on speakers but not headphone.
I get the following message on starting server -
booting 57110
localhost
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 48000.000000, driver's block size = 1024
JackDriver: connected system:capture_1 to SuperCollider:in_1
JackDriver: connected system:capture_2 to SuperCollider:in_2
JackDriver: connected SuperCollider:out_1 to system:playback_1
JackDriver: connected SuperCollider:out_2 to system:playback_2
SuperCollider 3 server ready.
JackDriver: max output latency 42.7 ms
Receiving notification messages from server localhost
Shared memory server interface initialized
I went through some forums and they suggested to look for output devices options and set them, I did a -
ServerOptions.devices;
to look for device list but I got the following error in the post window -
ERROR: A primitive was not bound. 0 676
Instance of Method { (0x21199c0, gc=01, fmt=00, flg=11, set=04)
instance variables [15]
raw1 : Float 0.000000 00000000 0080000C
raw2 : Float 0.000000 00000300 03020003
code : instance of Int8Array (0x2119cc0, size=4, set=2)
selectors : nil
constants : nil
prototypeFrame : instance of Array (0x2119c00, size=3, set=2)
context : nil
argNames : instance of SymbolArray (0x2119b40, size=3, set=2)
varNames : nil
sourceCode : nil
ownerClass : class Meta_ServerOptions (0x21113c0)
name : Symbol 'prListDevices'
primitiveName : Symbol '_ListAudioDevices'
filenameSymbol : Symbol '/usr/share/SuperCollider/SCClassLibrary/Common/Control/Server.sc'
charPos : Integer 4025
}
ERROR: Primitive 'none' failed.
Failed.
RECEIVER:
nil
CALL STACK:
MethodError:reportError 0x3601498
arg this =
Nil:handleError 0x1f730f8
arg this = nil
arg error =
Thread:handleError 0x35fcfd8
arg this =
arg error =
Object:throw 0x3980c58
arg this =
Object:primitiveFailed 0x33395a8
arg this = nil
Interpreter:interpretPrintCmdLine 0x3d061e8
arg this =
var res = nil
var func =
var code = "ServerOptions.devices;"
var doc = nil
var ideClass =
Process:interpretPrintCmdLine 0x3443c08
arg this =
^^ The preceding error dump is for ERROR: Primitive 'none' failed.
Failed.
RECEIVER: nil
booting 57110
localhost
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 48000.000000, driver's block size = 1024
JackDriver: connected system:capture_1 to SuperCollider:in_1
JackDriver: connected system:capture_2 to SuperCollider:in_2
JackDriver: connected SuperCollider:out_1 to system:playback_1
JackDriver: connected SuperCollider:out_2 to system:playback_2
SuperCollider 3 server ready.
JackDriver: max output latency 42.7 ms
Receiving notification messages from server localhost
Shared memory server interface initialized
ERROR: A primitive was not bound. 0 676
Instance of Method { (0x21199c0, gc=01, fmt=00, flg=11, set=04)
instance variables [15]
raw1 : Float 0.000000 00000000 0080000C
raw2 : Float 0.000000 00000300 03020003
code : instance of Int8Array (0x2119cc0, size=4, set=2)
selectors : nil
constants : nil
prototypeFrame : instance of Array (0x2119c00, size=3, set=2)
context : nil
argNames : instance of SymbolArray (0x2119b40, size=3, set=2)
varNames : nil
sourceCode : nil
ownerClass : class Meta_ServerOptions (0x21113c0)
name : Symbol 'prListDevices'
primitiveName : Symbol '_ListAudioDevices'
filenameSymbol : Symbol '/usr/share/SuperCollider/SCClassLibrary/Common/Control/Server.sc'
charPos : Integer 4025
}
ERROR: Primitive 'none' failed.
Failed.
RECEIVER:
nil
CALL STACK:
MethodError:reportError 0x35be518
arg this =
Nil:handleError 0x1ee0b78
arg this = nil
arg error =
Thread:handleError 0x3470ab8
arg this =
arg error =
Object:throw 0x3636a78
arg this =
Object:primitiveFailed 0x3cd86c8
arg this = nil
Interpreter:interpretPrintCmdLine 0x3d44b98
arg this =
var res = nil
var func =
var code = "ServerOptions.devices;"
var doc = nil
var ideClass =
Process:interpretPrintCmdLine 0x37c8708
arg this =
^^ The preceding error dump is for ERROR: Primitive 'none' failed.
Failed.
RECEIVER: nil
I am new to supercollider and I having a hard time figuring the reason for the error. Please suggest me how to resolve this.
Thanks in Advance.
回答1:
I had the same problem. I discovered the solution by using Catia from KXStudio. See Catia Catia is a JACK Patchbay. (Other patchbays are available. QJackctl and Patchage are examples). On my system (Ubuntu 14.04 on a Dell Studio laptop), SuperCollider maps its first 4 outputs to the 4 system playbacks. The first 2 system playbacks are the speakers, system playbacks 3 and 4 are the headphones. By remapping out1 and out2 from SC to playback_3 and playback_4, I hear it through the headphones. So, get hold of a patchbay for JACK, and see what you see. Hope this helps.
回答2:
I was having a similar problem (no output from supercollider at all, just complete and total silence), and this post ultimately led me to the right solution. I think it will be helpful to you and others.
From the ServerOptions documentation, I found that I could configure how SC talks to jack with environment variables.
In my case, I start scsynth with the relevant environment variables like so:
SC_JACK_DEFAULT_INPUTS="system:capture_1" SC_JACK_DEFAULT_OUTPUTS="system" scsynth -u 57110 &
It seems this can also be done from within sclang like so:
"SC_JACK_DEFAULT_INPUTS".setenv("system:capture_1");
"SC_JACK_DEFAULT_OUTPUTS".setenv("system");
In your case, where you are connecting to the wrong outputs, you might want to start scsynth like this:
SC_JACK_DEFAULT_OUTPUTS="system:playback_3,system:playback_4" scsynth -u 57110 &
Another alternative that will let you play with these connections and find what works for you is to use the jack_lsp, jack_connect, and jack_disconnect commands.
To see all of the ins/outs of your jack server as well as the current connections, run
jack_lsp -c
From your post, I think you will see something like
system:capture_1
SuperCollider:in_1
system:capture_2
SuperCollider:in_2
system:playback_1
SuperCollider:out_1
system:playback_2
SuperCollider:out_2
system:playback_3
system:playback_4
SuperCollider:out_1
system:playback_1
SuperCollider:out_2
system:playback_2
To make SuperCollider output to your headphones and speakers, you could conect out_1 and out_2 to playback_3 and playback_4 (assuming those are your headphones) like so:
jack_connect SuperCollider:out_1 system:playback_3
jack_connect SuperCollider:out_2 system:playback_4
To disconnect from the speakers, you could do
jack_disconnect SuperCollider:out_1 system:playback_1
jack_disconnect SuperCollider:out_2 system:playback_2
Run jack_lsp -c
again to see if your system is setup how you want!
回答3:
After struggling countless times with this issue I managed to get it working with:
- Add your user to the
audio
linux group. - Use
cadence
to start jack
Additional resource that could be helpful: https://wiki.archlinux.org/index.php/JACK_Audio_Connection_Kit
回答4:
Firstly: the big long error message saying "A primitive was not bound
" is unpleasant but in this case it just means you typed the wrong command. I don't know where you got that command ServerOptions.devices
from but it's just wrong. Maybe the message was intended to tell you to type s.options.device
which is more sensible but it's NOT what you need to do. Forget that and forget that long error message.
Secondly: the message you see when you boot the server is good, it tells you that the server has booted and connected to jack. SuperCollider is happy. If you hear sound out of the speakers but not from the headphones (I take it you mean when you plug the headphones in!), this is NOT a supercollider problem but just a standard operating-system issue about setting the volume on your headphones.
It appears that you're using linux so run the command alsamixer
in a terminal, that's a good way to check whether the headphone output is muted. Use man alsamixer
to understand how to use it, if it's not familiar to you.
来源:https://stackoverflow.com/questions/25044345/supercollider-not-audible-on-headphone