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
  • miniSHARC series
  • DDRC-24 (experimental)
  • SHD series (experimental)

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

  • miniDSP 2x8/8x8/4x10/10x10
  • nanoDIGI 2x8
  • C-DSP 6x8
  • C-DSP 8x12
  • nanoSHARC series
  • OpenDRC series
  • DDRC-88A/D
  • 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
minidsp 0.1.2
Mathieu Rene <mathieu.rene@gmail.com>

USAGE:
    minidsp [FLAGS] [OPTIONS] [SUBCOMMAND]

FLAGS:
        --all-local-devices    Apply the given commands to all matching local usb devices
    -h, --help                 Prints help information
    -v, --verbose              Verbosity level. -v display decoded commands and responses -vv
                               display decoded commands including readfloats -vvv display hex data
                               frames
    -V, --version              Prints version information

OPTIONS:
        --daemon-sock <daemon-sock>    Discover devices that are managed by the local instance of
                                       minidspd [env: MINIDSP_SOCK=]
        --daemon-url <daemon-url>      Discover devices that are managed by the remote instance of
                                       minidspd [env: MINIDSPD_URL=]
    -f <file>                          Read commands to run from the given filename (use - for
                                       stdin)
        --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
        --log <log>                    Log commands and responses to a file [env: MINIDSP_LOG=]
    -o, --output <output-format>       Output response format (text (default), json, jsonline)
                                       [default: text]
        --tcp <tcp>                    The target address of the server component [env:
                                       MINIDSP_TCP=]
        --url <url>                    Directly connect to this transport url [env: MINIDSP_URL=]
        --usb <usb>                    The USB vendor and product id (2752:0011 for the 2x4HD) [env:
                                       MINIDSP_USB=]

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

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
minidsp-config 
Set the current active configuration,

USAGE:
    minidsp config <value>

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

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version 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
minidsp-source 
Set the active input source

USAGE:
    minidsp source <value>

ARGS:
    <value>    The source to use: analog, toslink, spdif, usb, aesebu, rca, xlr, lan, i2s

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version 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
minidsp-gain 
Set the master output gain [-127, 0]

USAGE:
    minidsp gain <value>

ARGS:
    <value>    Gain in decibels, between -127 and 0 inclusively

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

Mute

Mutes or unmutes the entire device

Examples

mute

minidsp mute on

unmute

minidsp mute off

Usage

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

USAGE:
    minidsp mute <value>

ARGS:
    <value>    on | off

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

Dirac

Activates or deactivates Dirac Live.

Examples

Activate Dirac Live

minidsp dirac on

Dectivate Dirac Live

minidsp dirac off

Usage

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

USAGE:
    minidsp dirac <value>

ARGS:
    <value>    on | off

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version 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
minidsp-input 
Control settings regarding input channels

USAGE:
    minidsp input <input-index> <SUBCOMMAND>

ARGS:
    <input-index>    Index of the input channel, starting at 0

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

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

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
minidsp-input-routing 
Controls signal routing from this input

USAGE:
    minidsp input <input-index> routing <output-index> <SUBCOMMAND>

ARGS:
    <output-index>    Index of the output channel starting at 0

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

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

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
minidsp-input-gain 
Set the input gain for this channel

USAGE:
    minidsp input <input-index> gain <value>

ARGS:
    <value>    Gain in dB

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version 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
minidsp-input-mute 
Set the master mute status

USAGE:
    minidsp input <input-index> mute <value>

ARGS:
    <value>    on | off

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version 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.

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
minidsp-input-peq 
Control the parametric equalizer

USAGE:
    minidsp input <input-index> peq <index> <SUBCOMMAND>

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

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

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

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
minidsp-output 
Control settings regarding output channels

USAGE:
    minidsp output <output-index> <SUBCOMMAND>

ARGS:
    <output-index>    Index of the output channel, starting at 0

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

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

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 delay --help
minidsp-output-delay 
Set the delay associated to this channel

USAGE:
    minidsp output <output-index> delay <delay>

ARGS:
    <delay>    Delay in milliseconds

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version 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
minidsp-output-mute 
Set the master mute status

USAGE:
    minidsp output <output-index> mute <value>

ARGS:
    <value>    on | off

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version 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.

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
minidsp-output-peq 
Control the parametric equalizer

USAGE:
    minidsp output <output-index> peq <index> <SUBCOMMAND>

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

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

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

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

Usage

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

USAGE:
    minidsp output <output-index> crossover <group> <index> <SUBCOMMAND>

ARGS:
    <group>    Group index (0 or 1)
    <index>    Filter index (all | 0 | 1 | 3)

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

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

output [channel] compressor

$ minidsp output 0 compressor --help
minidsp-output-compressor 
Control the compressor

USAGE:
    minidsp output <output-index> compressor [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -a, --attack <attack>          Sets the attack time in ms
    -b, --bypass <bypass>          Bypasses the compressor (on | off)
    -k, --ratio <ratio>            Sets the ratio
    -r, --release <release>        Sets the release time in ms
    -t, --threshold <threshold>    Sets the threshold in dBFS

output [channel] delay

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

USAGE:
    minidsp output <output-index> delay <delay>

ARGS:
    <delay>    Delay in milliseconds

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version 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
minidsp-output-fir 
Control the FIR filter

USAGE:
    minidsp output <output-index> fir <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

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

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
minidsp-output-invert 
Set phase inversion on this channel

USAGE:
    minidsp output <output-index> invert <value>

ARGS:
    <value>    on | off

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version 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 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"

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" }