Skip to main content

A Python implementation of a StagelinQ protocol

Project description

Overview

This Python module decodes part of the StageLinQ protocol used by Denon DJ equipment. In its current state it is possible to read out information like track information, fader position (Crossfader, channel volume, pitchfader), BPM etc. The project also includes a description of how StageLinQ works taking from my findings as well as other code available.

This module can be used to receive this information from a device via a callback when data is available.

There is also a Wireshark Dissector that I made during my trials.

Status

An initial implementation of parts of the protocol has been done, but there is still much left to do. As the code should be at least somewhat functional I've decided to release this as is and add functionality along the way. Since I'm unsure where this is heading there is a possibility that there will be a future (major) version that will reimagine the functions completely.

The next few versions will probably be patched to bring the documentation up to date.

Example usage

Here follow an example of how PyStageLinQ can be used, and

from PyStageLinQ import EngineServices, PyStageLinQ
PrimeGo = None

# Callback for when PyStageLinQ as found a StageLinQ device. This will print out information about the found device
# and if lets the user decide if they want to subscribe to a service or not.

def new_device_found_callback(ip, discovery_frame, service_list):
    # Print device info and supplied services
    print(
        f"Found new Device on ip {ip}: Device name: {discovery_frame.device_name}, ConnectionType: {discovery_frame.connection_type}, SwName: {discovery_frame.sw_name}, "
        f"SwVersion: {discovery_frame.sw_version}, port: {discovery_frame.Port}")

    if len(service_list) > 0:
        print("Services found in device:")
    else:
        print("No services found")

    for service in service_list:
         print(f"\t{service.service} on port {service.port}")


    # Request StateMap service
    for service in service_list:
        if service.service == "StateMap":
            PrimeGo.subscribe_to_statemap(service, EngineServices.prime_go, state_map_data_print)

            
# Callback for when data has arrived from a StageLinQ device. It is up to the user what to do with this information.
            
def state_map_data_print(data):
    for message in data:
        print(message)

# Example main function, starting PyStageLinQ.
if __name__ == "__main__":
    global PrimeGo
    PrimeGo = PyStageLinQ.PyStageLinQ(new_device_found_callback, name="Jaxcie StagelinQ")
    PrimeGo.start()

Wireshark dissector

When I developed this code I made a WireShark Dissector, it is included in this repo. Do note that this dissector isn't properly tested and may cause unexpected issues. As this file is not part of the Pythoncode in PyStageLinQ it can be found on GitHub

Compatability

PyStageLinQ has been tested with a Denon DJ Prime Go on Windows 10 and Linux (Mint 20.3) with Python 3.10.

Acknowledgements

Big thanks to icedream for his implementation of StageLinQ in go: https://github.com/icedream/go-stagelinq

Change log

Here follows a log of released versions of PyStageLinQ.

[0.1.0] Inital release

Basic functionality done, but documentation needs to be done. I expect the API to change when I write this, so this is a pre-release until Documentation is in place.

Added

Everything

Changes

Yes

Fixed

Some things

Security

No

Knows issues

There are currently one known issue:

PyStageLinq cannot connect to device

For some reason that I cannot figure out PyStageLinQ cannot connect to my Prime Go sometimes. This seems to be completely random and is because the device does not send a table of services when requested

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyStageLinQ-0.1.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file PyStageLinQ-0.1.0.tar.gz.

File metadata

  • Download URL: PyStageLinQ-0.1.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for PyStageLinQ-0.1.0.tar.gz
Algorithm Hash digest
SHA256 74279285295d84d31de4f91864e5c733ce834bfc947ae636559c129c830721f9
MD5 ddcdcac089303ba4da00cb0cc14f9759
BLAKE2b-256 fb839024afe9bcab1fe11a1a6ec4635adcb9db53dff30f0da3fecc6a7e21df7e

See more details on using hashes here.

File details

Details for the file PyStageLinQ-0.1.0.tar.gz-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for PyStageLinQ-0.1.0.tar.gz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef99b4c28893732f060e23b5e678289e8b4ed0e3611fa41b5de07c37d2eb5fc2
MD5 d5d77c9ad4accb6da67e99d3fe07ef20
BLAKE2b-256 53be86a777210c8ffc523ec86d329adec672f0729f5f320d52b2b2b2064b292c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page