This document describes all currently understood parts of the Dynaudio Connect API. This API gives control and feedback of devices linked with the Connect (e.g. Xeo 4/6, Focus-XD). It has been reverse engineered by studying the TCP traffic of the official iPhone application with Wireshark, raw output of which can be found in the "TCP Streams" folder for the overly interested.
All command and feedback messages have the following structure:
0xFF 0x55 0x'payload size (PS)' [payload of PS bytes] 0x'checksum'
The API allows for control of the volume level and the functions mute, input, and power. The payload size (PS) has a length of 5 bytes.
Most commands carry a status value (SV). This value carries current zone (Z) and input (I) information. This byte is calculated as follows: 0x'I'*16+0x'Z'.
The following commands can be identified:
type | Command Code (CC) | Command Value (CV) | payload structure | payload example |
---|---|---|---|---|
volume | 0x13 / 0x14 | 0x00 - 0x11 | 0x2F 0xA0 0x'CC' 0x'CV' 0x'SV' | 0x2F 0xA0 0x13 0x04 0x42 |
mute (off/on) | 0x12 | 0x00 / 0x01 | 0x2F 0xA0 0x'CC' 0x'CV' 0x'SV' | 0x2F 0xA0 0x12 0x01 0x42 |
input | 0x15 | 0x01 - 0x07 | 0x2F 0xA0 0x'CC' 0x'CV' 0x'SV' | 0x2F 0xA0 0x15 0x04 0x42 |
power on | 0x01 | 0x00 | 0x2F 0xA0 0x01 0x'CV' 0xF'Z' | 0x2F 0xA0 0x01 0x00 0xF2 |
power off | 0x02 | 0x00 | 0x2F 0xA0 0x02 0x'CV' 0xF'Z' | 0x2F 0xA0 0x02 0x00 0xF2 |
Notice that volume has two commands codes. The CC for volume up is 0x13 and for volume down 0x14.
The Dynaudio Connect has 7 inputs. Their 'Command Values' are as follows:
input type | Command Value (CV) |
---|---|
Minijack | 0x01 |
Line | 0x02 |
Optical | 0x03 |
Coax | 0x04 |
USB | 0x05 |
Bluetooth | 0x06 |
Stream | 0x07 |
Devices linked with the Dynaudio Connect can be set to one of three zones. Their numeric values are:
zone colour | zone value |
---|---|
Red | 0x01 |
Green | 0x02 |
Blue | 0x03 |
Not all that is specified is necessary. While volume commands have a specific command code for volume up and down, when specifying absolute volume commands (is there another way?), this distinction can be ignored.
The status value supplied with most commands is only partially processed. It is necessary to specify the correct zone. However, the input part of the status value is ignored.
The API also contains two commands that will list some information about the device currently connected with, most notably the hub configuration (A, B or C). Responses are in ASCII-format:
type | Command Code (CC) | description | ASCII feedback payload example (Dynaudio Connect) |
---|---|---|---|
zones | 0x1e | responds with a list of all available zones on the Dynaudio device | Red_Green_Blue |
device properties | 0x01 | responds with a string containing the device name, currently used hub configuration and available sources of/on the Dynaudio device | Dynaudio Connect | A_1MiniJack_1Line_1Optical_1Coax_1USB_1Bluetooth_1*Stream |
Feedback is slightly different and carries a payload of 8 bytes instead of 5. A number of examples follow:
type | Command Code (CC) | Command Value (CV) | payload structure | feedback example |
---|---|---|---|---|
volume | 0x04 / 0x05 | 0x00 - 0x11 | 0x2E 0xA0 0x'CC' 0x'CV' 0x'SV' 0x00 0x00 0xD9 | 0x2E 0xA0 0x05 0x04 0x42 0x00 0x00 0xD9 |
mute | 0x03 | 0x00 / 0x01 | 0x2E 0xA0 0x'CC' 0x'CV' 0x'SV' 0x00 0x00 0xD9 | 0x2F 0xA0 0x12 0x01 0x42 0x00 0x00 0xD9 |
input | 0x?? | ?? | ?? | ?? |
power on | 0x01 | 0x00 | 0x2E 0xA0 0x01 0x'CV' 0x'SV' 0x00 0x00 0xD9 | 0x2F 0xA0 0x01 0x00 0xF2 0x00 0x00 0xD9 |
power off | 0x02 | 0x00 | 0x2E 0xA0 0x02 0x'CV' 0x'SV' 0x00 0x00 0xD9 | 0x2F 0xA0 0x02 0x00 0xF2 0x00 0x00 0xD9 |
Notice again the differential CC for volume up and down. While the feedback on input changes is still uncertain, it can be extracted from other commands, notice the SV on the commands.
See 2.1.
Besides any possible feedback, every 4 or so seconds a speaker status payload of length 0A is sent to the open connection (if any) for every speaker connected to the connect box. As per technical TCP limitations, it is possible for this status to be sent in between the sending of a command and the broadcast of its associated feedback. This can be used to derive status information without sending a command to the Dynaudio Connect. An example of speaker status payload would be: 0x31 0x52 0x7F 0x01 0x02 0x05 0x01 0x00 0x00 0x01. The payload has the following structure:
bit no | description | possible values |
---|---|---|
1 | constant | 0x31 |
2 | constant | 0x52 |
3 | speaker identifier, changing on a power loop of the Connect Box and/or Speaker | 0x00 - 0xFF |
4 | zone | See section 2 |
5 | volume | See section 2 |
6 | input | See section 2 |
7 | power on/off | 0x00 = off; 0x01 = on |
8 | mute | 0x00 = not muted; 00x1 = muted |
9 | power off/on | 0x00 = on; 00x1 = off |
10 | channel | 0x01 = left; 0x02 = center; 0x03 = right |
The checksum can be calculated as follows:
ROUNDUP(SUM(payload)/255)*255-SUM(payload)-([Payload N]-ROUNDUP(SUM(payload)/255))
If the result is negative add 256 or alternatively extract the 8 least significant bits.
Connect through port 1901. Only one connection is allowed at a time.
Questions and request can be submitted via GitHub.
For an example in C check this file.
- PS - Payload Size [in bytes]
- Z - current Zone
- I - Input number
- CC - Command Code
- CV - Command Value
- SV - Status Value [zone and input]
- Ch - Checksum