flesniak / python-prodj-link

A python interface to Pioneer ProDJ Link
Apache License 2.0
134 stars 26 forks source link

XDJ-XZ #26

Closed JonasFocke01 closed 1 year ago

JonasFocke01 commented 1 year ago

Hello flesniak, first of all THANK YOU for this repository! I learned more than one handy thing about python by looking at your code. As you can see in the Headline, i have a XDJ-XZ at home and try to get it to sync with a lightingsetup of my own. (I could not think about a better Headline) I tried to analyse your code and got some results by that, but that really wont bring me any closer to my goal, and i hope, that you could help me with that. The link-ethernet output from my controller does not get recognized by the propiatary software from pioneer, but it seems fine with the beat-link-trigger(https://github.com/Deep-Symmetry/beat-link-trigger) project here on github, by what i got pointed to your project. The output from the pythoncode of yours is somewhere between that. Every 20ish seconds (this varies alot) there seems to be an update and the correct bpm and modifier (which im after) gets displayed in console. For that i tried the monitor-simple.py example. I tried to dig deeper and figured out, that about 1 times a second there comes a ping of some sort to the port 50000 with something. Ports 50001 and 50002 seem to be completely silent. From a simpler script i wrote, that hooks into the port 50000, i get this output (Some parts also seem to varies allot except of the ip): Listening on 0.0.0.0:50000 for beat packets b'Qspt1WmJOL\x06\x00XDJ-XZ\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x03\x006\x02\x01\xca=\xfc\x10\xdb\x13\xc0\xa8\x02\x85\x01\x00\x00\x00\x01\x00' ('192.168.2.133', 36175) b'Qspt1WmJOL\x06\x00XDJ-XZ\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x03\x006!\x01\xca=\xfc\x10\xdb\x14\xc0\xa8\x02\x85\x01\x00\x00\x00\x02\x01' ('192.168.2.133', 58548) b'Qspt1WmJOL\x06\x00XDJ-XZ\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x03\x006\x01\x01\xc8=\xfc\x10\xdb\x12\xc0\xa8\x02\x85\x01\x00\x00\x00\x01\x00' ('192.168.2.133', 41738) b'Qspt1WmJOL\x06\x00XDJ-XZ\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x03\x006\x02\x01\xca=\xfc\x10\xdb\x13\xc0\xa8\x02\x85\x01\x00\x00\x00\x01\x00' ('192.168.2.133', 44426) b'Qspt1WmJOL\x06\x00XDJ-XZ\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x03\x006!\x01\xca=\xfc\x10\xdb\x14\xc0\xa8\x02\x85\x01\x00\x00\x00\x02\x01' ('192.168.2.133', 33137) Every second there come two new blocks of data. (binary + ip). Here i hit the roadblock, that i realy cant dig any deeper as my skills do not allow me to. The only thing i can read is, that my controller got assigned to 192.168.2.133.

It would be great if i could support this project by giving you the needed output of my controller AND it would be great if you could help me with my problem.

flesniak commented 1 year ago

Hi,

sorry for the late reply, your mail got lost. I'm not really sure what your issue actually is, can you describe that in more detail? This is what I understood: The original pioneer software (rekordbox i guess) does not recognize your console. This is the primarily weird thing, I suppose that should work in any case. To the contrary, beat-link-trigger correctly detects your console and displays updates quickly. However, python-prodj-link (you tested the monitor-simple.py) only gets an update every ~20 seconds.

Here is some background info that could help you: Commonly Pioneer players (at least the CDJ models) only broadcast their status seldomly (the ~20 seconds you mentioned). To get more status packets, it is necessary to broadcast a "hello" packet on port 50000 - this is what the vcdj.py job in this codebase does. From there on, we get unicast status information from a player. If for some reason that does not happen on your console, I guess a wireshark dump of communication with rekordbox, beat-link-trigger and monitor-qt.py (the only well-maintained monitor script).

Cheers Fabian

brunchboy commented 1 year ago

The biggest issue I had to deal with in adding support for the XDJ-XZ in my Beat Link library is the fact that it violated an assumption I had made: I had expected that every player on the network would have a unique IP address. In the case of the XZ, there are multiple devices (two CDJs and a mixer) built in which are all sharing the same network jack and the same IP address. So I had to update some of my data structures to index things by both device number and IP address, which I tracked in this issue: https://github.com/Deep-Symmetry/beat-link/issues/39

I can’t explain why the original poster would be having issues with Pioneer’s own rekordbox, however; it works fine with my own XDJ-XZ, perhaps the version being attempted was too old?

flesniak commented 1 year ago

Hmm, I see. Not really sure how my code handles this - I need to look into it in detail. Thanks for the hint!