librespot-org / librespot-java

The most up-to-date open source Spotify client
Apache License 2.0
386 stars 95 forks source link

Implement a DACP control interface #318

Open aleszczynskig opened 3 years ago

aleszczynskig commented 3 years ago

Is your feature request related to a problem? Please describe. When using forked-daapd, it can connect via a DACP interface to the source device to enable hardware control of the source (playback controls/ volume controls). It is particularly useful when using spocon with a pipe connecting forked-daapd. Can you implement a DACP interface so that playback controls and volume can be controlled. The control details will need to be send to forked-daapd over the metadata pipe. I have included the command in the bottom section.

Describe the solution you'd like Implement a DACP interface and share the details over the metadata pipe.

Describe alternatives you've considered Nothing. I do not believe there are any other options currently.

Additional context

Taken from https://github.com/mikebrady/shairport-sync-metadata-reader

daid -- this is the source's DACP-ID (if it has one -- it's not guaranteed), useful if you want to remotely control the source. Use this string to identify the source's remote control on the network. acre -- this is the source's Active-Remote token, necessary if you want to send commands to the source's remote control (if it has one). dapo -- the payload is the port number (as text) of the source's remote control, to which commands should be sent. It is 3689 for iTunes but varies for iOS devices.

devgianlu commented 3 years ago

@aleszczynskig Do you have a capture (like piping the data from the DACP controller to a file) of what the input data would look like? I am struggling to understand what the device being controlled receives.

aleszczynskig commented 3 years ago

@devgianlu - sorry for the delay. Super busy at the moment. Unfortunately I do not have a capture. This project seems to offer an implementation though. I appreciate it is not in written in java however maybe this repo would provide some useful insight?

https://github.com/melloware/dacp-net

devgianlu commented 3 years ago

Wait a second, is the control interface a pipe or an HTTP server? I thought it was a pipe and the stuff I found on the internet didn't make sense, but they do if it's HTTP.

aleszczynskig commented 3 years ago

It's an HTTP interface. You provide the details of that interface over the metadata pipe so that forked-daapd or similar can establish a connection back to it.