Skip to content

Feature set cl message#3727

Draft
pljones wants to merge 3 commits into
jamulussoftware:mainfrom
dingodoppelt:feature-set-cl-message
Draft

Feature set cl message#3727
pljones wants to merge 3 commits into
jamulussoftware:mainfrom
dingodoppelt:feature-set-cl-message

Conversation

@pljones

@pljones pljones commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Short description of changes

Adds two new connection-less protocol messages, one to request and one to return server features.

CHANGELOG: Request and receive server features by connection-less message

Context: Fixes an issue?

Fixes 3710

Does this change need documentation? What needs to be documented and how?

Yes. See below. Will also need updates to Client and Server documentation.

Status of this Pull Request

Proof of concept. Needs:

  • Confirmation of solution
  • JSONRPC support
  • Connect Dialog support

What is missing until this pull request can be merged?

See above.

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

Comment thread src/server.cpp Outdated
Comment thread src/util.h Outdated
Comment thread src/util.h Outdated
FS_MULTITHREADING = 1,
FS_RECORDER_INIT = 2,
FS_DISABLE_RECORDING = 3,
FS_IS_RECORDING = 4,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need three flags:

  • FS_RECORDER_ENABLED - true if GetRecorderInitialised() && !GetDisableRecording()
  • FS_IS_RECORDING - true if JamController.GetRecorderState() == RS_RECORDING (you had !=?)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need three flags:

* `FS_RECORDER_ENABLED` - true if `GetRecorderInitialised() && !GetDisableRecording()`

* `FS_IS_RECORDING` - true if `JamController.GetRecorderState() == RS_RECORDING` (you had `!=`?)

From my understanding JamController.GetRecorderState() == RS_RECORDING is only true when GetRecorderInitialised() && !GetDisableRecording() is true (recorder may be actively recording or idling) while both are not transparently reflecting if the server is currently recording.
I think we need to know...

  • if the recorder is initialised -> a recording directory is set with -R
  • if recording will start automatically when a client joins the server -> recording is enabled by NOT using --norecord
  • if the server is currently recording which is currently not known in the jamController. @pljones Is there a way for CServer to know for sure if a recording is currently taking place on a server?

@pljones pljones Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think only two states need to be shown -- either the Server is recording or the Server could be recording. The reason why is not really relevant. So that's what I was trying to reflect.

I think you're right that I got the logic wrong, though.

(I mean, that --norecord is in use doesn't stop someone monitoring their server with JSONRPC and turning on recording automatically when a Client joins. It's just a different mechanism.)

Comment thread src/util.h
@ann0see

ann0see commented Jun 6, 2026

Copy link
Copy Markdown
Member

Could you please also check which protocol messages could be replaced by this?

Comment thread src/protocol.cpp
(standard re-registration timeout).


- PROTMESSID_CLM_SERVER_INFO: Bitmask of enabled server features

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially phrased it as "capabilities". FYI.

There were old versions which didn't support panning I think. Assuming this message was already implemented at this time, We would have used this message to advertise pan support.

In think we should make it very clear what this message can and cannot encode

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a new message being added for this new feature.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I know. But we should specify what this feature can and what it can't expose. I'm thinking of a specification/architectural viewpoint

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not exclusively checking for features available in newer versions. There are status flags like recording enabled and if there is a welcome message. Those aren't strictly capabilities so I think calling it a "feature set" makes more sense here. I'd therefore propose to call it PROTMESSID_CLM_SERVER_FEATURE_SET

Comment thread src/server.cpp Outdated

@ann0see ann0see left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add "has welcome message" also

@pljones

pljones commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator Author

My view is that it's exposing the operating state of the Server.

If you're running with the UI or using JSONRPC, some state can change (one day, it'll all be controllable, hopefully).

However, it's not for large blocks of data: client list, welcome message, etc.

I see it as providing answers to questions a Client user might have about Server capabilities (I also favour using that term) - so on/off states.

That's why I think it should be stuff that gets shown on the Connect Dialog (although I'm thinking of a "toggle extra connect info" option in Advanced Settings).

@ann0see

ann0see commented Jun 6, 2026

Copy link
Copy Markdown
Member

Ok. Can it be used by the client to to enable/disable certain features such as raw audio?
I would say yes.

@ann0see ann0see requested a review from dingodoppelt June 7, 2026 19:57
Comment thread src/server.cpp Outdated
Comment thread src/util.h Outdated
@softins

softins commented Jun 8, 2026

Copy link
Copy Markdown
Member

Maybe add "has welcome message" also

Yes, I agree. I plan to add a separate protocol request to fetch the welcome message. Would be useful for Explorer, and we could add a means within the Connect Dialog to right-click on a host and view the welcome message.

@softins

softins commented Jun 8, 2026

Copy link
Copy Markdown
Member

Ok. Can it be used by the client to to enable/disable certain features such as raw audio? I would say yes.

I'm not sure that's very useful, and may add significant complication for some features, which set up things at initialisation time. I would treat this PR as just a way of exposing information, and any means of control could be investigated and proposed as a subsequent PR.

@dingodoppelt dingodoppelt force-pushed the feature-set-cl-message branch from 2abdc4a to 6dd6cc4 Compare June 8, 2026 16:27
@dingodoppelt

Copy link
Copy Markdown
Member
--- ./src/server.cpp	(original)
+++ ./src/server.cpp	(reformatted)
@@ -479,15 +479,15 @@
 {
     uint32_t iFeatures = 0;
 
-    iFeatures |= ( !bUseDoubleSystemFrameSize                            << FS_FAST_UPDATE );
-    iFeatures |= ( bUseMultithreading                                    << FS_MULTITHREADING );
-    iFeatures |= ( GetRecorderInitialised() && !GetDisableRecording()    << FS_RECORDER_ENABLED );
-    iFeatures |= ( (JamController.GetRecorderState() == RS_RECORDING)    << FS_IS_RECORDING );
-    iFeatures |= ( bDelayPan                                             << FS_DELAY_PAN );
-    iFeatures |= ( IsIPv6Available()                                     << FS_IPV6_AVAILABLE );
-    iFeatures |= ( bDisableRaw                                           << FS_RAW_AUDIO );
-    iFeatures |= ( bDisconnectAllClientsOnQuit                           << FS_DISCONONQUIT );
-    iFeatures |= ( !strWelcomeMessage.isEmpty()                          << FS_HAS_WELCOME_MESSAGE );
+    iFeatures |= ( !bUseDoubleSystemFrameSize << FS_FAST_UPDATE );
+    iFeatures |= ( bUseMultithreading << FS_MULTITHREADING );
+    iFeatures |= ( GetRecorderInitialised() && !GetDisableRecording() << FS_RECORDER_ENABLED );
+    iFeatures |= ( ( JamController.GetRecorderState() == RS_RECORDING ) << FS_IS_RECORDING );
+    iFeatures |= ( bDelayPan << FS_DELAY_PAN );
+    iFeatures |= ( IsIPv6Available() << FS_IPV6_AVAILABLE );
+    iFeatures |= ( bDisableRaw << FS_RAW_AUDIO );
+    iFeatures |= ( bDisconnectAllClientsOnQuit << FS_DISCONONQUIT );
+    iFeatures |= ( !strWelcomeMessage.isEmpty() << FS_HAS_WELCOME_MESSAGE );
 
     ConnLessProtocol.CreateCLServerInfoMes ( RecHostAddr, iFeatures );
 }

I don't know if the style check is right this time...

@dingodoppelt

Copy link
Copy Markdown
Member

I'd suggest adding two flags to see if the server

  1. is using a log file !strLoggingFileName.isEmpty()
  2. will show a licence agreement dialog after connection eLicenceType != LT_NO_LICENCE

any objections?

@softins

softins commented Jun 8, 2026

Copy link
Copy Markdown
Member

I don't know if the style check is right this time...

What OS do you do your dev on? If you have clang-format version 14 installed, you can just do make clang_format before committing and it will format all the style to the same standard as the CI expects.

@dingodoppelt dingodoppelt force-pushed the feature-set-cl-message branch from 8caf060 to 139c0fc Compare June 8, 2026 17:49
@dingodoppelt

Copy link
Copy Markdown
Member

I don't know if the style check is right this time...

What OS do you do your dev on? If you have clang-format version 14 installed, you can just do make clang_format before committing and it will format all the style to the same standard as the CI expects.

I use kate on arch. I just used the "format" feature of the built-in LSP-client for the first time 👍

@softins

softins commented Jun 8, 2026

Copy link
Copy Markdown
Member

Would be good if you can install clang-format. The Jamulus tree has a file with all the correct format rules. Unless that LSP format feature uses the same file of rules?

@dingodoppelt

Copy link
Copy Markdown
Member

Would be good if you can install clang-format. The Jamulus tree has a file with all the correct format rules. Unless that LSP format feature uses the same file of rules?

Yes, that file is used by kate. I just ran clang-format --dry-run --style=file:.clang-format src/* manually for a test and it wants to change lots of comments and some code. Is that expected and why doesn't the auto style check complain?

@softins

softins commented Jun 8, 2026

Copy link
Copy Markdown
Member

Yes, that file is used by kate. I just ran clang-format --dry-run --style=file:.clang-format src/* manually for a test and it wants to change lots of comments and some code. Is that expected and why doesn't the auto style check complain?

It may depend on which version of clang-format you have. When I had 13, it used to make some unexpected changes. When I moved to 14 it was fine. I don't know about versions newer than that.

@dingodoppelt

Copy link
Copy Markdown
Member

It may depend on which version of clang-format you have. When I had 13, it used to make some unexpected changes. When I moved to 14 it was fine. I don't know about versions newer than that.

Ah, I'm on clang-format version 22.1.6

@dingodoppelt

Copy link
Copy Markdown
Member

The .clang-format file says:

# Style for Clang-Format version 10
# https://releases.llvm.org/10.0.0/tools/clang/docs/ClangFormatStyleOptions.html

Could that become an issue when not updated or is only the comment outdated?

@pljones

pljones commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

I'd suggest adding two flags to see if the server

  1. is using a log file !strLoggingFileName.isEmpty()
  2. will show a licence agreement dialog after connection eLicenceType != LT_NO_LICENCE

any objections?

Both make sense to me. I'd actually thought of the licence one myself and forgot to add it!

Comment thread src/server.cpp
{
uint32_t iFeatures = 0;

iFeatures |= ( !bUseDoubleSystemFrameSize << FS_FAST_UPDATE );

@ann0see ann0see Jun 9, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to have comments which describe exactly which feature is enabled - especially if it's non obvious like the recorder. Yes, we do have FS_* but that may get ambiguous for non trivial features in future.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While writing these I came to the conclusion that the recorder flags need a makeover and I'll push the comments once I figured out how to handle recording state properly.

@dingodoppelt

Copy link
Copy Markdown
Member

How about:

  1. Is the server a directory?
  2. Is the server registered with a directory?

@pljones

pljones commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

How about:

  1. Is the server a directory?
  2. Is the server registered with a directory?

I don't think these are relevant to the use case.

  • "Is a Server a Directory?" -- a Client is not affected by this directly. They can go to explorer.jamulus.app and check, if they want to find out. There's no need to add it.
  • "Is the server registered with a directory?" -- This doesn't help the Client at all, on its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants