Getting Started

GitHub release Discord

minidsp-rs is an alternative control software for certain MiniDSP products. It exposes most/all of the available configuration parameters in a command line package, with an optional HTTP API in order to integrate with custom DIY audio projects. It can run on a variety of systems with a minimal memory footprint.

Installation

Pre-built packages and binaries are available in the project's releases section.

Debian (.deb) packages are available for:

  • armhf: Tested on raspbian (Raspberry PI, including the rpi0)
  • x86_64 Debian / Ubuntu variants

Single binary builds are also provided for common operating systems:

  • Linux: minidsp.x86_64-unknown-linux-gnu.tar.gz
  • MacOS: minidsp.x86_64-apple-darwin.tar.gz
  • Windows: minidsp.x86_64-pc-windows-msvc.zip

Useful commands

# Set input source to toslink
minidsp source toslink

# Set master volume to -30dB
minidsp gain -- -30

# Activate the 2nd configuration setting (indexing starts at 0)
minidsp config 1

Building from source

If you don't have rust setup, the quickest way to get started is with rustup. This is preferred over install rust via your distro's package manager because these are often out of date and will have issues compiling recent code.

cargo build --release --bin minidsp
# The binary will then available as target/release/minidsp

# If you want to build a debian package
cargo install cargo-deb
cargo deb
# Then look under target/debian/

Supported devices

Depending on the device, two levels of support are available. Basic Support devices support a limited subset of features that are common across devices, whereas Full Support devices can be completely controlled.

This software can also control these devices if they are connected to a WI-DG.

Full support

These devices support the full feature set (input, output, routing, peqs, etc.)

Devices

  • miniDSP 2x4HD
  • miniDSP Flex
  • DDRC-24
  • DDRC-88A/D
  • miniSHARC series
  • miniDSP 2x8/8x8/4x10/10x10
  • nanoDIGI 2x8
  • SHD series
  • C-DSP 8x12

Basic support

For these devices, only the following settings can be changed:

  • Master Gain
  • Master Mute
  • Input Source
  • Active Configuration Presets
  • Dirac Live Status

Devices

  • C-DSP 6x8
  • nanoSHARC series
  • OpenDRC series
  • nanoAVR HD/HDA

Adding support for new devices

If you have a device that is on the Basic Support tier, you can help adding support by inspecting the commands sent by the plugin application.

TODO: Add guide for adding new devices

Integrations

minidsp-rs can be used with other software which help integrating MiniDSP devices within a broader ecosystem.

BEQ

Bass EQ is a long running tradition on avsforum where folks share EQ presets for movies, recovering bass that was reduced in publicly available editions, for home setups that have enough subwoofers to handle them.

EZBEQ

EZBEQ is a web application capable of loading predefined PEQ presets from a mobile phone and directly load them to a MiniDSP or HTP-1 device. They have a getting started guide with instructions on how to set it up on a raspberry pi.

BEQDesigner

BEQDesigner is a desktop application that helps creating PEQ presets for movies, based on an interactive UI feature spectral analysis. It supports loading presets through minidsp-rs.

Roomie Remote

Roomie Remote is a flexible remote control software capable of connecting to various devices. They support customizable presets which can be configured to work with minidspd's HTTP API.

These settings were contributed by Vince_B (avsforum) and add buttons to interface with the device's master controls.

plist file

<dict>
<key>brand</key>
<string>mrene</string>
<key>cat</key>
<string>minidsp-rs</string>
<key>codes</key>
<dict>
<key>CONFIG 1</key>
<string>POST /devices/0/config
Content-Type: application/json; charset=utf-8.

{"master_status":{"preset":0}}</string>
<key>CONFIG 2</key>
<string>POST /devices/0/config
Content-Type: application/json; charset=utf-8.

{"master_status":{"preset": 1}}</string>
<key>CONFIG 3</key>
<string>POST /devices/0/config
Content-Type: application/json; charset=utf-8.

{"master_status":{"preset": 2}}</string>
<key>CONFIG 4</key>
<string>POST /devices/0/config
Content-Type: application/json; charset=utf-8.

{"master_status":{"preset": 3}}</string>
<key>SOURCE ANALOG</key>
<string>POST /devices/0/config
Content-Type: application/json; charset=utf-8.

{"master_status":{"source": "Analog"}}</string>
<key>SOURCE TOSLINK</key>
<string>POST /devices/0/config
Content-Type: application/json; charset=utf-8.

{"master_status":{"source": "Toslink"}}</string>
<key>SOURCE USB</key>
<string>POST /devices/0/config
Content-Type: application/json; charset=utf-8.

{"master_status":{"source": "Usb"}}</string>
<key>MUTE ON</key>
<string>POST /devices/0/config
Content-Type: application/json; charset=utf-8.

{"master_status":{"mute": true}}</string>
<key>MUTE OFF</key>
<string>POST /devices/0/config
Content-Type: application/json; charset=utf-8.

{"master_status":{"mute": false}}</string>
</dict>
<key>method</key>
<string>http</string>
<key>type</key>
<integer>1</integer>
</dict>

Command line interface

The CLI allows you to view and change DSP settings. If you've installed through the debian package, a local service has been enabled and will expose local and network devices through a unix socket. minidsp automatically detects and uses the local service if it is running

Use minidsp probe in order to list the detected device:

$ minidsp probe
Found 2x4HD with serial 91234 at ws://localhost/devices/0/ws [hw_id: 10, dsp_version: 100]

It's possible to use a specific device using the --url option, or by setting the MINIDSP_URL environment variable.

Status summary

Running the command without any parameters will return a status summary, in this form:

$ minidsp 
MasterStatus { preset: 0, source: Toslink, volume: Gain(-8.0), mute: false, dirac: false }
Input levels: -61.6, -57.9
Output levels: -67.9, -71.6, -120.0, -120.0

If calling this programmaticallly (and not using the HTTP API), the -o json and -o jsonline option will output a machine parsable status.

$ minidsp -o json
{
  "master": {
    "preset": 0,
    "source": "Toslink",
    "volume": -8.0,
    "mute": false
  },
  "input_levels": [
    -131.36298,
    -131.36298
  ],
  "output_levels": [
    -140.21962,
    -139.85617,
    -120.0,
    -120.0
  ]
}

Attention

The changes done through this command will not be visible from the minidsp app, as it cannot read the settings back from the device. The following settings will be visible after changing them from any source:

  • Master Gain
  • Master Mute
  • Configuration preset
  • Active Source
  • Dirac Live status

The rest of the settings (filters, delays, routing) will not be reflected in the app.

Running multiple commands at once

For the purposes of organizing configurations, a file can be created with commands to run sequentially. It's an easy way to recall a certain preset without changing the device config preset.

Lines are using the same format at the command line, without the minidsp command.

Example:

# Comments are allowed and skipped
# So are empty lines

mute on
config 3
input 0 peq all bypass off
output 0 peq all bypass off
gain -- -30
mute off

The command list can be ran using minidsp -f ./file.txt

Usage

$ minidsp --help
Usage: minidsp [OPTIONS] [COMMAND]

Commands:
  probe   Try to find reachable devices
  status  Prints the master status and current levels
  gain    Set the master output gain [-127, 0]
  mute    Set the master mute status
  source  Set the active input source
  config  Set the current active configuration,
  dirac   Sets whether Dirac Live is enabled
  input   Control settings regarding input channels
  output  Control settings regarding output channels
  server  (deprecated) Launch a server usable with `--tcp`, the mobile application, and the official client
  debug   Low-level debug utilities
  help    Print this message or the help of the given subcommand(s)

Options:
  -v, --verbose...
          Verbosity level. -v display decoded commands and responses -vv display decoded commands including readfloats -vvv display hex data frames
  -o, --output <OUTPUT_FORMAT>
          Output response format (text (default), json, jsonline) [default: text]
      --log <LOG>
          Log commands and responses to a file [env: MINIDSP_LOG=]
      --all-local-devices
          Apply the given commands to all matching local usb devices
  -d, --device-index <device-index>
          Use the given device 0-based index (use minidsp probe for a list of available devices) [env: MINIDSP_INDEX=]
      --usb <usb>
          The USB vendor and product id (2752:0011 for the 2x4HD) [env: MINIDSP_USB=]
      --tcp <tcp>
          The target address of the server component [env: MINIDSP_TCP=]
      --force-kind <force-kind>
          Force the device to a specific product instead of probing its hardware id. May break things, use at your own risk
      --url <URL>
          Directly connect to this transport url [env: MINIDSP_URL=]
      --daemon-url <DAEMON_URL>
          Discover devices that are managed by the remote instance of minidspd [env: MINIDSPD_URL=]
      --daemon-sock <DAEMON_SOCK>
          Discover devices that are managed by the local instance of minidspd [env: MINIDSP_SOCK=]
  -f <FILE>
          Read commands to run from the given filename (use - for stdin)
  -h, --help
          Print help information
  -V, --version
          Print version information

Master Settings

These settings applies to the entire device and are unrelated to the current configuration preset. Most of these options are supported by devices in the Basic Support tier.

Config

Sets the current active configuration preset. This command usually takes a few seconds to complete as the device performs a partial reset while activating the new configuration.

Examples

Activate configuration preset 0

minidsp config 0

Usage

$ minidsp config --help
Set the current active configuration,

Usage: minidsp config <VALUE>

Arguments:
  <VALUE>  0-indexed configuation preset value (0, 1, 2, 3)

Options:
  -h, --help  Print help information

Source

Sets the current input source. The type of supported sources depend on the device's supported sources. The argument to this command sould be lowercase.

Examples

Set input source to usb

minidsp source usb

Usage

$ minidsp source --help
Set the active input source

Usage: minidsp source <VALUE>

Arguments:
  <VALUE>  The source to use: analog, toslink, spdif, usb, aesebu, rca, xlr, lan, i2s, bluetooth

Options:
  -h, --help  Print help information

Gain

Sets the master volume

Note: Because most gain values are negative, a prefix of -- is required to pass values.

Examples

Set master gain to -20dB

minidsp gain -- -20

Usage

$ minidsp gain --help
Set the master output gain [-127, 0]

Usage: minidsp gain [OPTIONS] <VALUE>

Arguments:
  <VALUE>  Gain in decibels, between -127 and 0 inclusively

Options:
  -r, --relative  Specify the value as a relative increment on top of the current gain
  -h, --help      Print help information

Mute

Mutes or unmutes the entire device

Examples

mute

minidsp mute on

unmute

minidsp mute off

toggle

minidsp mute toggle

Usage

$ minidsp mute --help
Set the master mute status

Usage: minidsp mute <VALUE>

Arguments:
  <VALUE>  on, off, toggle

Options:
  -h, --help  Print help information

Dirac

Activates or deactivates Dirac Live.

Examples

Activate Dirac Live

minidsp dirac on

Dectivate Dirac Live

minidsp dirac off

Toggle Dirac Live

minidsp dirac toggle

Usage

$ minidsp dirac --help
Sets whether Dirac Live is enabled

Usage: minidsp dirac <VALUE>

Arguments:
  <VALUE>  on, off, toggle

Options:
  -h, --help  Print help information

Inputs

This is where you'd configure routing, gain settings and PEQ for each input. The device needs to be part of the Full Support tier.

Usage

$ minidsp input --help
Control settings regarding input channels

Usage: minidsp input <INPUT_INDEX> <COMMAND>

Commands:
  gain     Set the input gain for this channel
  mute     Set the master mute status
  routing  Controls signal routing from this input
  peq      Control the parametric equalizer
  help     Print this message or the help of the given subcommand(s)

Arguments:
  <INPUT_INDEX>  Index of the input channel, starting at 0

Options:
  -h, --help  Print help information

inputs [channel] routing [output channel]

Each output matrix entry has to be enabled in order for audio to be routed. The gain can then be set (in dB) for each entry.

Input and output indices always start at 0.

Example

Route input channel 0 to output channel 0, boost gain by 6dB

minidsp input 0 routing 0 enable on
minidsp input 0 routing 0 gain 6

Usage

$ minidsp input 0 routing --help
Controls signal routing from this input

Usage: minidsp input <INPUT_INDEX> routing <OUTPUT_INDEX> <COMMAND>

Commands:
  enable  Controls whether the output matrix for this input is enabled for the given output index
  gain    
  help    Print this message or the help of the given subcommand(s)

Arguments:
  <OUTPUT_INDEX>  Index of the output channel starting at 0

Options:
  -h, --help  Print help information

input [channel] gain

Sets the input gain for the given channel

Note: Because most gain values are negative, a prefix of -- is required to pass values.

Example

Sets input channel 0's gain to -10dB

minidsp input 0 gain -- -10

Usage

$ minidsp input 0 gain --help
Set the input gain for this channel

Usage: minidsp input <INPUT_INDEX> gain <VALUE>

Arguments:
  <VALUE>  Gain in dB

Options:
  -h, --help  Print help information

input [channel] mute

Examples

Mute input channel 0

minidsp input 0 mute on

Unmute input channel 0

minidsp input 0 mute off

Usage

$ minidsp input 0 mute --help
Set the master mute status

Usage: minidsp input <INPUT_INDEX> mute [VALUE]

Arguments:
  [VALUE]  on | off

Options:
  -h, --help  Print help information

input [channel] peq

The peq commands supports broadcasting an operation on multiple peqs. If specifying an index, the command will only affect a single filter.

When using the import subcommand, any imported PEQs automatically unbypassed.

Examples

Bypass the first peq

minidsp input 0 peq 0 bypass on

Bypass all peqs

minidsp input 0 peq all bypass on

Importing filters should use the all target if the unused filter should also be cleared.

minidsp input 0 peq all import ./file.txt

Usage

$ minidsp input 0 peq --help
Control the parametric equalizer

Usage: minidsp input <INPUT_INDEX> peq <INDEX> <COMMAND>

Commands:
  set     Set coefficients
  bypass  Sets the bypass toggle
  clear   Sets all coefficients back to their default values and un-bypass them
  import  Imports the coefficients from the given file
  help    Print this message or the help of the given subcommand(s)

Arguments:
  <INDEX>  Parametric EQ index (all | <id>) (0 to 9 inclusively)

Options:
  -h, --help  Print help information

Outputs

This is where you'd configure the output gain settings, crossovers, PEQs, FIR filters, compressors, phase inversion and delay for each output channel. The device needs to be part of the Full Support tier.

Usage

$ minidsp output --help
Control settings regarding output channels

Usage: minidsp output <OUTPUT_INDEX> <COMMAND>

Commands:
  gain        Set the output gain for this channel
  mute        Set the master mute status
  delay       Set the delay associated to this channel
  invert      Set phase inversion on this channel
  peq         Control the parametric equalizer
  fir         Control the FIR filter
  crossover   Control crossovers (2x 4 biquads)
  compressor  Control the compressor
  help        Print this message or the help of the given subcommand(s)

Arguments:
  <OUTPUT_INDEX>  Index of the output channel, starting at 0

Options:
  -h, --help  Print help information

output [channel] gain

Examples

Set output channel 0's gain to -20dB

minidsp output 0 gain -- -20

Note: -- is used to distinguish negative values from another option

Usage

$ minidsp output 0 gain --help
Set the output gain for this channel

Usage: minidsp output <OUTPUT_INDEX> gain <VALUE>

Arguments:
  <VALUE>  Output gain in dB

Options:
  -h, --help  Print help information

output [channel] mute

Mutes or unmutes an output channel

Examples

Mute output channel 0

minidsp output 0 mute on

Unmute output channel 0

minidsp output 0 mute off

Usage

$ minidsp output 0 mute --help
Set the master mute status

Usage: minidsp output <OUTPUT_INDEX> mute [VALUE]

Arguments:
  [VALUE]  on | off

Options:
  -h, --help  Print help information

output [channel] peq

Importing filters from Room Eq Wizard (REW)

The minidsp output n peq and minidsp input n peq commands both support importing from a REW-formatted file. If there are less filters on the device, the remaining PEQs will be cleared.

When using the import subcommand, any imported PEQs automatically unbypassed.

Here is how you would import a series of biquad filter to output channel 3:

$ minidsp output 3 peq all import filename.txt
PEQ 0: Applied imported filter: biquad1
PEQ 1: Applied imported filter: biquad2
PEQ 2: Applied imported filter: biquad3
...

If you were to select a single peq, only one filter would have been imported:

$ minidsp output 3 peq 1 import filename.txt
PEQ 0: Applied imported filter: biquad1
Warning: Some filters were not imported because they didn't fit (try using `all`)

Usage

$ minidsp output 0 peq --help
Control the parametric equalizer

Usage: minidsp output <OUTPUT_INDEX> peq <INDEX> <COMMAND>

Commands:
  set     Set coefficients
  bypass  Sets the bypass toggle
  clear   Sets all coefficients back to their default values and un-bypass them
  import  Imports the coefficients from the given file
  help    Print this message or the help of the given subcommand(s)

Arguments:
  <INDEX>  Parametric EQ index (all | <id>) (0 to 9 inclusively)

Options:
  -h, --help  Print help information

output [channel] crossover

Crossovers are implemented as series biquad filters. There are two groups of 4 biquads per channel. Each group can be bypassed individually.

The command follows the same syntax as the peq command, for the exception that you have to specify the group index (0 or 1) in addition to the peq index (0, 1, 2, 3)

Examples

Import crossovers in REW format

minidsp output 0 crossover 0 all import ./file.txt
minidsp output 0 crossover 1 all import ./file2.txt

Import all crossover groups at once (such as using an export file from Multi Sub Optimizer). Would be up to 8 with MiniDSP 2x4 HD

minidsp output 0 crossover all all import ./file.txt

Usage

$ minidsp output 0 crossover --help
Control crossovers (2x 4 biquads)

Usage: minidsp output <OUTPUT_INDEX> crossover <GROUP> <INDEX> <COMMAND>

Commands:
  set     Set coefficients
  bypass  Sets the bypass toggle
  clear   Sets all coefficients back to their default values and un-bypass them
  import  Imports the coefficients from the given file
  help    Print this message or the help of the given subcommand(s)

Arguments:
  <GROUP>  Group index (0 or 1)
  <INDEX>  Filter index (all | 0 | 1 | 3)

Options:
  -h, --help  Print help information

output [channel] compressor

Dynamic range compression (DRC) or simply compression is an electronic effect unit that reduces the volume of loud sounds or amplifies quiet sounds by narrowing or "compressing" an audio signal's dynamic range

The command allows any number of options to be specified. Unspecified arguments remain at the last set value.

When using the import subcommand, any imported crossover group is automatically unbypassed.

Examples

minidsp output 0 compressor -b off -k 50 -a 15 -r 30 -t 0

Limit the dynamic range of a tactile transducer or bass shaker. This would allow them to turn on more often but not be driven too hard.

minidsp output 3 gain -- 12
minidsp output 3 compressor -b off -k 50 -a 15 -r 30 -t -- -36

Usage

$ minidsp output 0 compressor --help
Control the compressor

Usage: minidsp output <OUTPUT_INDEX> compressor [OPTIONS]

Options:
  -b, --bypass <BYPASS>        Bypasses the compressor (on | off)
  -t, --threshold <THRESHOLD>  Sets the threshold in dBFS
  -k, --ratio <RATIO>          Sets the ratio
  -a, --attack <ATTACK>        Sets the attack time in ms
  -r, --release <RELEASE>      Sets the release time in ms
  -h, --help                   Print help information

output [channel] delay

$ minidsp output 0 delay --help
Set the delay associated to this channel

Usage: minidsp output <OUTPUT_INDEX> delay <DELAY>

Arguments:
  <DELAY>  Delay in milliseconds

Options:
  -h, --help  Print help information

output [channel] fir

Importing FIR filters can be done using a wav file. The file's sampling rate MUST match the device's internal rate.

Examples

Import FIR filter from impulse.wav

minidsp output 0 fir import ./impulse.wav

Unbypass fir filter

minidsp output 0 fir bypass off

Usage

$ minidsp output 0 fir --help
Control the FIR filter

Usage: minidsp output <OUTPUT_INDEX> fir <COMMAND>

Commands:
  set     Set coefficients
  bypass  Sets the bypass toggle
  clear   Sets all coefficients back to their default values and un-bypass them
  import  Imports the coefficients from the given file
  help    Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help information

output [channel] invert

Examples

Invert output channel 0's phase

minidsp output 0 invert on

Do not invert output channel 0's phase

minidsp output 0 invert off

Usage

$ minidsp output 0 invert --help
Set phase inversion on this channel

Usage: minidsp output <OUTPUT_INDEX> invert [VALUE]

Arguments:
  [VALUE]  on | off

Options:
  -h, --help  Print help information

Daemon

An optional service is packaged in order to help with applications requiring constant access to devices.

Architecture

A list of local and remote (WI-DG) devices is maintained. Upon discovering a device, it is probed for its type and model, then made available to applications.

Static devices

Remote devices that are advertised are usually discovered, but if running into some issue it's possible to add a static device and make it always available.

minidsp probe --net will output the urls for the devices it finds.

Example

Add a WI-DG device while bypassing auto-discovery

[[static_device]]
url = "tcp://192.168.1.2:5333"

Configuration

The following default configuration file is installed in /etc/minidsp/config.toml:

#
# A configuration file can define many components that share the same underlying devices
#
# A default HTTP server is exposed via a unix socket at /tmp/minidsp.sock

# If set, the daemon will ignore network broadcasts for discovering devices, which can be inconvenient when dealing with complex multi-device setups
# The desired remote devices can then be manually added using `[[static_device]]` sections
# ignore_advertisements = true


# If desired, an api can be exposed over the local network
[http_server]
bind_address = "127.0.0.1:5380"
# Replace the previous line by this one in order to allow connections from other hosts
# bind_address = "0.0.0.0:5380"

# TCP servers can be setup to support using the native "plugin" apps to manage the device
[[tcp_server]]
bind_address = "127.0.0.1:5333"
# Replace the previous line by this one in order to use the plugin app from another machine
# bind_address = "0.0.0.0:5333"

# If multiple minidsp devices are used, the following options can be used to expose multiple 
# plugin-compatible servers for each devices.
# device_index = 0 # Use the first device available
# device_serial = 912345 # Use the device with this serial number

# Advertise the following address for the official minidsp mobile app
# advertise = { ip = "192.168.1.100", name="Living Room Pi" }

# More servers can be declared with different bind addresses and device bindings
# Since the official apps don't support setting the port number, different addresses must be used
# for different devices.
#[[tcp_server]]
#bind_address = "192.168.1.128:5333"

# Devices can be added statically instead of being automatically discovered 
# Use `minidsp probe` to find the correct URL
# [[static_device]]
# url = "usb:0001%3A0005%3A04?vid=2752&pid=0011"

# If a wi-dg isn't auto-discovered, it can be added with
# url = "tcp://192.168.1.2:5333"

# It's possible to declare mock devices for testing purposes, and give them different serial numbers
# A `response_delay` needs to be specified if connecting with the minidsp plugin, as it doesn't appreciate fast replies.
# The `serial` parameter has to be betwen `900000` and `965535`
#
# [[static_device]]
# url = "mock:?serial=911111&response_delay=50"
#
# [[static_device]]
# url = "mock:?serial=922222"

HTTP API

On unix platform, the service exposes this though /tmp/minidsp.sock automatically. Accessing through the network must be enabled through the configuration file.

The full OpenAPI specification is available online, and from the service's /api endpoint, loading the spec from /openapi.json.

Configuration

A single bind address can be set, note that there is currently no authentication mechanisms in place.

[http_server]
bind_address = "127.0.0.1:5380"
# Uncomment to allow websites from certain domains to access your devices
# allowed_origins = "*"

Quick start

There are a few useful endpoints to get started, the first one in /devices and returns a list of available devices, along with their product type and the URL to which the transport is connected (via usb,tcp,etc.)

1. List available devices

$ curl http://localhost:5380/devices
[
  {
    "url": "tcp://192.168.1.242:5333?name=Living%20Room%20Pi",
    "version": {
      "hw_id": 10,
      "dsp_version": 100,
      "serial": 965535
    },
    "product_name": "2x4HD"
  }
]

2. Retrieve master status

$ curl http://localhost:5380/devices/0 -d "{ "master_status": { preset: 0 } }"
{
  "master": {
    "preset": 1,
    "source": "Toslink",
    "volume": -8.0,
    "mute": false
  },
  "input_levels": [
    -131.38994,
    -131.38994
  ],
  "output_levels": [
    -105.435165,
    -139.5934,
    -105.435165,
    -139.59183
  ]
}

3. Set active preset to 0

curl http://localhost:5380/devices/0/config \
    -H 'Content-Type: application/json' \
    -d '{ "master_status": { "preset": 0 } }'

WebSocket Streaming

Asynchronous updates to the master status are provided through websocket. Upon upgrading, the full current status is provided, followed by updates to properties that have changes. Note that this currently only returns changes done through the IR remote, in order to get more regular updates it's possible to poll the device for changes by passing poll=true in the query string. This requests updates every 2 seconds and sends a message if the status summary has changed.

Here is an example of the master volume being changed via the IR remote:

$ websocat ws://127.0.0.1:5380/devices/0
{
    "master":{"preset":0,"source":"Toslink","volume":-19.5,"mute":false},
    "input_levels":[-44.400307,-42.08899],
    "output_levels":[-54.93488,-56.41222,-120.0,-120.0]
}
{"master":{"volume":-19.0,"mute":false}}
{"master":{"volume":-18.5,"mute":false}}
{"master":{"volume":-18.0,"mute":false}}

Here is example which polls the device for changes, in order to reflect changes done through the plugin, or other applications.

$ websocat 'ws://127.0.0.1:5380/devices/0?poll=true'
{
    "master":{"preset":0,"source":"Toslink","volume":-19.5,"mute":false},
    "input_levels":[-44.400307,-42.08899],
    "output_levels":[-54.93488,-56.41222,-120.0,-120.0]
}
{"master":{"preset":0,"source":"Toslink","volume":-19.5,"mute":true}}

Streaming input and output levels

If the levels query string param is set, the current input and output levels will be polled from the device at most every 250ms.

$ websocat 'ws://127.0.0.1:5380/devices/0?levels=true' | jq
{
  "master": {
    "preset": 0,
    "source": "Toslink",
    "volume": -8,
    "mute": false
  },
  "input_levels": [
    -131.50832,
    -131.50832
  ],
  "output_levels": [
    -140.54817,
    -140.1521,
    -120,
    -120
  ]
}
{
  "master": {},
  "input_levels": [
    -131.44533,
    -131.44533
  ],
  "output_levels": [
    -140.41307,
    -140.02238,
    -120,
    -120
  ]
}
{
  "master": {},
  "input_levels": [
    -131.3853,
    -131.3853
  ],
  "output_levels": [
    -140.26598,
    -139.90532,
    -120,
    -120
  ]
}

Updating settings

The main structure of this is in the OpenAPI specifications, every object is optional and only the objects that are set will trigger a change on the device. For this reason, an index field is present (on inputs, outputs, peqs) to indicate which entry should change - all of these are 0-index so inputs on the 2x4HD are [0, 1], outputs [0, 1, 2, 3] and PEQs go from 0 to 9.

Note that the master_status object is applied before any other setting. It's therefore safe to send a current preset change followed by PEQ updates in the same call.

Example

Here is an example to change the current config preset to 0, set the first PEQ on inputs 0 and 1, and bypass the 2nd PEQ on both inputs.

POST /devices/0/config

{
  "master_status": {
    "preset": 1
  },
  "inputs": [
    {
      "index": 0,
      "peq": [
        {
          "index": 0,
          "coeff": { "b0": 1, "b1": 0, "b2": 0, "a1": 0, "a2": 0 },
          "bypass": false
        },
        { "index": 1, "bypass": true }
      ]
    },
    {
      "index": 1,
      "peq": [
        {
          "index": 0,
          "coeff": { "b0": 1, "b1": 0, "b2": 0, "a1": 0, "a2": 0 },
          "bypass": false
        },
        { "index": 1, "bypass": true }
      ]
    }
  ]
}

Compat TCP Server

This application provides a tcp server compatible with the official apps by forwarding USB HID frames over a TCP connection. Since they operate at the frame level, they do not require the device type to be supported in order to work with the existing applications.

Multiple devices

When working with multiple devices, it's necessary to bind to different ip addresses because the official apps do not support specifying a port number in the address field.

Multiple [[tcp_server]] blocks can be defined, the device_serial option can be used to map each server to a specific device. If you'd rather trust the order at which USB devices are found, then device_index can be set to the 0-based index.

Certain minidsp apps can discover devices on the local network, enabling the advertise option makes these apps find this server instance. Note that to keep OS-specific details to a minimum, the ip address of the server needs to be included in the advertisement config.

advertise = { ip = "192.168.1.100", name="Living Room Pi" }

Configuration

[[tcp_server]]
bind_address = "127.0.0.1:5333"
# Replace the previous line by this one in order to 
# use the plugin app from another machine
# bind_address = "0.0.0.0:5333"

# If multiple minidsp devices are used, the following options 
# can be used to expose multiple plugin-compatible 
# servers for each devices.
# device_index = 0 # Use the first device available
# device_serial = 912345 # Use the device with this serial number

# Advertise the following address for the official minidsp mobile app
# advertise = { ip = "192.168.1.100", name="Living Room Pi" }