Rawaudio dev#3653
Conversation
|
I'd prefer not to check for the Jamulus version number but rather based on capabilities - we don't have 4.0.0 out yet and it might break during the dev process. |
I wanted to reuse information already available as much as possible so I just added the code where there were version checks already implemented. (For sequence number and pan feature) |
|
Tested it and yes, the noise would be unacceptable. What is our fallback if max is selected but the server doesn't support it? |
I just noticed that if you connect to a server with Max selected you get the noise unless you switch audio quality again while connected. The server code is fine and doesn't need changes, I misplaced the check for my introduced bRawAudioSupported in the client code. I'll have a closer look |
|
Adding a slot to the client to reinit when it receives the server version seems to have fixed the noise issue. |
|
We still get crashes on windows, especially when using more coplex setups including audio routing software. Linux, Mac and android builds work fine so far. Sounds great but still needs more testing and fixes |
|
The last commits fixed the crash on windows and make the client fall back to opus reliably. This is now ready to be tested thoroughly. |
|
A buffersize of 256 on Max quality setting gives garbled audio and the packet sizes seem wrong and contain blocks of zeroes. Only that particular setting is affected. Opus still works |
I plan to try out this enhancement over the next few days. I've had a look through the diffs so far. Could you specify exactly the steps to produce this error? |
This is reproducible with a buffersize of 256 samples only. Edit: The packets become bigger than the MTU allows for on 256 samples buffersize and get fragmented once I corrected the calculation of the packet sizes. Does this mean we need to disable raw audio for buffersizes of 256 or is there some mechanism to receive fragmented packets? |
|
I've just tried a build of Using a buffer size of 10.67ms (256) results in each packet containing two frames of audio, each with its own sequence number. In that setting, I was seeing one packet every 10.67ms coming from the Windows client, but still one packet every 5.33ms coming back from the server. They alternated between having zeros in the first frame and zeros in the second frame. So it could possibly be some issue in Note that the client will encode according to the settings in the Client Settings dialog, but the server will encode according to the information in received in the Talking of which, the codec field in the Lines 484 to 492 in 849e823 So when sending props for raw encoding, it should either use |
This build is not taking into account |
|
Ah, so the issue is that the client is not sending enough data to satisfy the server, and the server is therefore adding in packets of zeros to maintain the data rate. Fragmentation should not be an issue, at least with IPv4, as fragmentation and re-assembly happens transparently at the IP layer. In fact, I don't think it will occur anyway, as the traffic from the server is not fragmented. We should just get packets from the client at 5.33ms instead of 10.67ms. In fact, I've been doing some tests with Wireshark of all the various data rates, qualities and mono/stereo, and it seems that the packet interval is normally half the buffer time specified in the Client Settings. Except when "Small buffers" is not checked, and then 2.67 (64) is exactly the same as 5.33 (128). |
Yes please - I'm building directly from your |
|
I think in I don't have any more time today to try it... |
| } | ||
|
|
||
| const int iOffset = iB * SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[iChanCnt]; | ||
| // Recognise a raw audio packet by its size |
There was a problem hiding this comment.
I think it would be better to recognise the audio frame by a sentinel byte. Protocol frames begin with 00 00 and must have a good checksum. Otherwise they are considered to be audio. Opus frames always begin with 00 for mono and 04 for stereo. So maybe for raw audio, the audio data could be prepended with a byte of f0 for mono and f4 for stereo? Then it could be recognised unambiguously. Both client and server need to recognise the format of a received frame correctly without relying on an out-of-band context.
There was a problem hiding this comment.
As far as I understood these sentinel bytes come from the opus codec itself and are not deliberately set by Jamulus as a message ID of sorts. I'd have to overwrite actual audio bytes for that to work with my code. Or am I wrong here?
|
I had misunderstood the packet size calculation and it seems fixed with the last commit. |
I think OPUS and OPUS64 only refer to the setting of small network buffers. It isn't related to the actual opus coding. |
Maybe - I hadn't got around to examining how the value was used in the code. It just felt wrong for the message to state OPUS when it wasn't, and maybe a specific value could also be useful to the server. |
The server isn't aware of the opus quality setting. It is only being sent the packet size and feeds that into the opus codec. There is currently no other way for the server than to determine the codec (or none) by the expected packet sizes for rawaudio. OPUS and OPUS64 refer to 128 or 64 samples internal buffering, no relations to audio quality settings. |
|
Just tried the latest build. It's looking good in Wireshark and sounding good too. No fragmentation either, as the max packet size is only 1068 for stereo, max quality, 10.67ms(256). |
|
Have you guys also tested with small network buffers? This seems to work as well for me and with a huge improvement on latency as well (as expected). Tested on arm64 ubuntu server side and win11 for the client. |
|
Hi @dingodoppelt, Jamulus 3.12.1 has been released -- could you rebase, please. Thanks, -- Peter |
27d1bfc to
7587c97
Compare
|
How do you all feel of this PR? Can we soon get it in? |
I can't say anything bad about these dev builds. Raw audio works well for me, apart from the now more audible jitter glitches, which is acceptable. Have been using this build since the early -rawaudio versions on macOS and several Linux distros and never ran into stability or quality issues. The only thing that haunts me from time to time is the already reported malloc() crash on macOS when exiting the app. So far, i have not been able to reproduce it reliably nor track down the root cause or if it is even related to this PRs code. |
|
I think it needs squashing to three commits -- original commit (as is), single commit for the new protocol message, single commit (as is) for the new command line option. |
3ddf099 to
03c1fd2
Compare
Did that. @softins I hope the commit message is fine for you, otherwise I'll change it to your liking. |
|
Curious about this. Does this happen with the dmg Mac installer or is it
the legacy installer for Mac? Would be good to know.
…On 19/05/2026 18:05, Ralf Barth wrote:
*foobarth* left a comment (jamulussoftware/jamulus#3653)
<#3653 (comment)>
How do you all feel of this PR? Can we soon get it in?
I can't say anything bad about these dev builds. Raw audio works well
for me, apart from the now more audible jitter glitches, which is
acceptable. Have been using this build since the early -rawaudio
versions on macOS and several Linux distros and never ran into
stability or quality issues.
The only thing that haunts me from time to time is the already
reported malloc() crash on macOS when exiting the app. So far, i have
not been able to reproduce it reliably nor track down the root cause
or if it is even related to this PRs code.
—
Reply to this email directly, view it on GitHub
<#3653 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BMOHOHHSQ43GCSGV3NA363L43SH4NAVCNFSM6AAAAACX5OYMPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DIOJQGE2DGOBTHA>.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this
thread.Message ID:
***@***.***>
|
Yes, that's fine. Thank you for asking and for all the hard work! |
03c1fd2 to
6516459
Compare
Default DMG installer on macOS 26.4/5, M1 Pro. |
pljones
left a comment
There was a problem hiding this comment.
I'd like an issue raised for some refactoring of the names to be more meaningful throughout the audio code. I think that's part of what makes it hard to understand: the names distract from what's actually going on.
|
It's in now... I would not yet tag a beta - I'd like to get the .app changes in and potentially TCP. |
|
Messages that are not The server informs the client of its ability to do raw audio at the first opportunity. There is no way for the client to know this before that message. Although I'm surprised that in your example the Also, although Any breaking changes in this should be made between 3.12.1dev and 4.0.0. We will need to maintain compatibility between versions, servers and clients more strictly once we release 4.0.0, so it's worth taking the time to get it right now. |




Add a new "raw" audio quality setting
This PR adds uncompressed audio ("raw") to the quality settings so there is no Opus compression along the way
Discussion in #3654
This feature improves latency as well. I gained 2ms by using uncompressed audio while having a better audio quality.
CHANGELOG: Add uncompressed audio transmission - dedicated to the memory of Hans Petter Selasky (1982 - 2023)
Does this change need documentation? What needs to be documented and how?
Corresponding PR in jamulussoftware/jamuluswebsite #1133[EDIT: pljones] Note the above was closed unmerged.
Checklist