ScinServerOptions

Encapsulates command line and other options for the Scintillator synthesis server.
See also: ScinServer

Description


This class is intended to be analogous to the ServerOptions class used to boot the SuperCollider audio synthesis server. Like that object, every ScinServer has an instance of ScinServerOptions created for it if one is not provided to it by the options argument on ScinServer creation.

Also like ServerOptions , these parameters are translated into command line arguments for the server boot, so changing the options after the server has booted will take no effect until the server is restarted.

Class Methods


ScinServerOptions.new

Creates a new ScinServerOptions instance with all default options.

Instance Methods


Server Boot Options

.portNumber

.portNumber = value

An integer, default 5511. ScinServer binds both TCP and UDP ports at the provided port number.

.dumpOSC

.dumpOSC = value

A boolean, default false. If true, ScinServer will log all received OSC message at the informational log level. This can also be changed at runtime with the ScinServer dumpOSC method.

.createWindow

.createWindow = value

A boolean, default true. If true, ScinServer will create a window onscreen for rendering. If false, it will not, and all rendering will occur offscreen.

.swiftshader

.swiftshader = value

A boolean, default false. If true, ScinServer will ignore any installed graphics hardware and instead will use the open-source software renderer SwiftShader.

.frameRate

.frameRate = value

An integer, default -1. If a negative number, the server will run in interactive mode, optimized to reduce latency from render to presentation. If zero the server will run in snapshot mode, and will only render a new frame when instructed by an advanceFrame call. If a positive number the server will run in throughput mode, will render frames as quickly as possible, updated the onscreen window (if present) at the provided refresh rate. For more information see Guides/ScinServer-Recording

.logLevel

.logLevel = value

An integer, default 3. Sets the initial logging level of the server. The values range from most verbose at 0 to disabling logging entirely at 6. All level values are inclusive of the higher-level values, meaning that 0 will include all higher levels, and 5 will only show cirtical errors. The values for the log level are as follows:

0

Trace

1

Debug

2

Informational

3

Warnings

4

Errors

5

Critical Errors

6

Disable Logging

.deviceName

.deviceName = value

A string, default empty. If empty, this argument is ignored. If non-empty, the server will attempt to match the fragment of the name in the argument against the names of the available devices and choose the first matching device name it encounters, or exit if no match can be made. The synth logs on startup at the Informational level all the Vulkan-supported devices available on the computer it is running on, so the log can be consulted as a source to pick names from. For example this code boots the server with the right log level to see the supported devices:

(
var options = ScinServerOptions.new;
options.logLevel = 2;
~v = ScinServer.new(options).boot;
)

Which on my laptop produces in the log stream (among other things) the following console log entry:

[1586121895.197] 9593357 [info] found 3 Vulkan devices:
  name: AMD Radeon Pro 5500M, type: Discrete GPU, vendorID: 1002, deviceID: 7340
  name: Intel(R) UHD Graphics 630, type: Integrated GPU, vendorID: 8086, deviceID: 3e9b
  name: SwiftShader Device (LLVM 7.0.0), type: CPU, vendorID: 1ae0, deviceID: c0de

[1586121895.197] 9593357 [info] Choosing fastest device class Discrete GPU, device AMD Radeon Pro 5500M

From a performance standpoint Discrete GPUs are typically faster than Integrated GPUs, which are typically much faster than CPU (or software) renderers, and by default the server will pick the highest-performing device by category, so in this case the AMD Radeon Pro 5500M, but if I wanted ensure that the Intel integrated GPU got picked I could provide the (note: case-sensitive) following string in options:

(
var options = ScinServerOptions.new;
options.logLevel = 2;
options.deviceName = "Intel";
~v = ScinServer.new(options).boot;
)

Which when run produces the following logstream:

[1586122278.866] 9595542 [info] Device name Intel match, selecting Intel(R) UHD Graphics 630

.width

.width = value

An integer, default 800. The width of the window (or framebuffer, in the case of offscreen rendering) to create in pixels.

.height

.height = value

An integer, default 600. The height of the window (or framebuffer, in the case of offscreen rendering) to create in pixels.

.alwaysOnTop

.alwaysOnTop = value

A boolean, default true. Just like the Window method of the same name, if true the server will create a window that floats on top of other windows. If false, the window will allow other windows to layer on top of it. If createWindow is false this value is ignored.

.audioInputChannels

.audioInputChannels = value

An integer, default 2. For interactive mode only, determines the number of audio input channels the Scintillator server should open up and monitor for audio input.

.crashReporting

.crashReporting = value

A boolean, default true. If true the server will collect a crash report in the event that the synthesis server crashes. The crash reports are saved locally and can be manually specified for upload to the crash report collection server. Scintillator will never automatically upload a crash report. Setting this flag to false will disable the entire crash reporting system, meaning that if the server crashes a report won’t be collected.

.vulkanValidation

.vulkanValidation = value

A boolean, default false. Useful for debugging, will load a library that checks every graphics call for validity and reports errors to the console log. This comes at the cost of speed, so the validation is normally disabled.

Other Methods

.asOptionsString

Returns a string reflecting the current options and which can be passed to the command line of the ScinServer binary on boot. Used primarily by ScinServer code on server boot.

.onServerError

.onServerError = value

A function, default empty. This function will be called if the ScinServer object detects an abnormal server exit code.