-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Protocol documentation #2337
Add Protocol documentation #2337
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/ folder now it's there, I think. It's probably something only someone writing code is going to use, so I think it's best left in the code repo. Ideally, we'd have the API description in some meta-language that could generate source in C++ or PHP or whatever... |
I’ll move it in a moment |
The docs folder still needs to be created by my PR |
Ah |
Ok. The docs folder is now created. You can now move your file into the folder (after a rebase) |
47b0a49
to
025e6f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- | ||
The OPUS codec is used to compress the audio over the network and the packets are documented [here](https://datatracker.ietf.org/doc/html/rfc6716). | ||
|
||
Jamulus uses a custom OPUS encoder / decoder, giving some different frame sizes, but always uses a 48kHz sample rate. OPUS and OPUS64 codecs are the only supported options currently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPUS and especially OPUS64 sound like official modes, somehow. But I think it's just the names which Jamulus gave to these encoder configurations, right? So maybe that could be clarified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've just looked through the code, and the only difference between them is that OPUS
configures the Opus codec to use 128 samples per frame, and OPUS64
configures it to use 64 samples per frame. But it's the same codec, just two different Jamulus modes.
Typo fix Co-authored-by: Christian Hoffmann <christian@hoffie.info>
Typo fix Co-authored-by: Christian Hoffmann <christian@hoffie.info>
Is this ready to be merged after r 3.8.2 and a review? |
Yes, I'm planning to review it, but life is rather busy right now, and it hasn't come to the top of the pile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not into the protocol, but it's good to have a brief intruduction here. I'm not entirely sure, but I think Jamulus handles all packages with a specific size as audio packages and all others as control message packages?
Approving either way since the document is not critical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document is a good start, and a descriptive "what happens" is definitely needed and useful.
I do have some comments, though, noted down as I read through:
-
In the message packet structure, it needs to be specified that 2-byte numeric items are sent in little-endian order. So a length of 300, for example, would be a byte of 0x2C (44) followed by a byte of 0x01 (for 256).
-
Related to the above point, the message types should be expressed as native numbers, e.g.
CLIENT_ID (32, 0x0020)
,CLM_DISCONNECTION (1010, 0x03f2)
. These numbers then correspond to those insrc/protocol.h
, and those displayed in the Wireshark dissector. But in the packet, for example, theCLM_DISCONNECTION
ID would be 0xf2 followed by 0x03. -
"Some ... need to be acknowledged, some do not." could be elaborated to say that all connected-state messages (ID < 1000) need to be acknowledged, except for ACK itself, and connectionless messages (CLM_xxx, ID >= 1000) do not need to be acknowledged.
I'm happy either to make and push these changes myself, or to leave it to @emlynmac.
Specify byte order as little-endian Clarify which packets must be acknowledged.
Thanks for the review @softins. I've added the decimal values to the hex in the flows. |
Yes, the time limit is 400ms, which is defined in Lines 94 to 95 in 7f9f039
Thanks. I think the hex versions should have their bytes swapped in the descriptions too, so they match the decimal. It would have been nice if the protocol had used network byte order, but we're years beyond that now, for Jamulus! |
I deliberately put them in this way around, so that the hex values match the Wireshark dissector trace values. It made it easier to see |
@softins is this now ready? |
Not sure, but I have no time to review again until Friday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subject to a couple of comments, I'm happy to approve it. It would be good as time permits to expand it, but I don't think there's a reason to keep it languishing as a PR.
-- | ||
The OPUS codec is used to compress the audio over the network and the packets are documented [here](https://datatracker.ietf.org/doc/html/rfc6716). | ||
|
||
Jamulus uses a custom OPUS encoder / decoder, giving some different frame sizes, but always uses a 48kHz sample rate. OPUS and OPUS64 codecs are the only supported options currently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've just looked through the code, and the only difference between them is that OPUS
configures the Opus codec to use 128 samples per frame, and OPUS64
configures it to use 64 samples per frame. But it's the same codec, just two different Jamulus modes.
Co-authored-by: Tony Mountifield <tony@mountifield.org>
* Start of high-level protocol documentation * Add message diagram for connection * Base protocol documentation * More updates * Details of the audio transport * Move to docs directory * Update docs/JAMULUS_PROTOCOL.md Typo fix Co-authored-by: Christian Hoffmann <christian@hoffie.info> * Update docs/JAMULUS_PROTOCOL.md Typo fix Co-authored-by: Christian Hoffmann <christian@hoffie.info> * Update style * Add decimal values for message IDs in addition to the hex values Specify byte order as little-endian Clarify which packets must be acknowledged. * Mention the retransmit timeout. * Clarify Buffer size not Packet size Co-authored-by: Tony Mountifield <tony@mountifield.org> Co-authored-by: Christian Hoffmann <christian@hoffie.info> Co-authored-by: ann0see <20726856+ann0see@users.noreply.github.com> Co-authored-by: Tony Mountifield <tony@mountifield.org>
CHANGELOG: Documentation: Add high-level technical documentation for the Jamulus protocol |
Short description of changes
Added high-level protocol documentation of the client-server UDP interface.
Context: Improve documentation for contributors
Status of this Pull Request
Ready for peer review
What is missing until this pull request can be merged?
No functional code changes; just needs reviewing for accuracy.