Server: compute the fade-in gain once per channel per frame, not once per channel pair
Maintainer thường phản hồi trong vòng 5 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c
- Lĩnh vực
- audio-video-rtc, performance
Hướng nghiên cứu
Bắt đầu trong src/server.cpp tại vòng lặp xây dựng vecChanIDsCurConChan và kiểm tra DecodeReceiveData, sau đó đọc GetFadeInGain() trong src/channel.h. Xác minh rằng gain của mỗi kênh đã kết nối được lấy một lần cho mỗi frame và được dùng lại cho cả hai phép tính cặp, trong khi đầu ra vẫn không thay đổi; sử dụng benchmark được liên kết để so sánh hình dạng của các vòng lặp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🤖 AI: Follow-up to ann0see/jamulus#293, opened at @ann0see's request.
What is the current behaviour and why should it be changed?
The gain loop in DecodeReceiveData calls GetFadeInGain() twice per channel pair, once for the source channel (line 909) and once for the target (line 915): 2N²−N int-to-float conversions and float divisions per frame, 44850 at N=150. The N values behind them are constant for the frame. Both counters are written only in PutAudioData and OnNetTranspPropsReceived, reached under CServer::Mutex from PutAudioData and OnProtocolMessageReceived, and OnTimer holds that mutex for the whole decode phase, single- or multithreaded.
Describe possible approaches
Read each connected channel's fade-in gain once into a CVector<float> in the loop that builds vecChanIDsCurConChan, and multiply by vecfFadeInGains[j] and vecfFadeInGains[iChanCnt] at lines 909 and 915 — #293's one-read-per-channel pattern applied to the remaining per-pair accessor, independent of that PR. The output is unchanged: a benchmark of the two loop shapes with a lock-free gain read produces byte-identical matrices at N=50, 100 and 150, and times the fade-in term alone (Raspberry Pi 4 Model B, g++ 14.2 -O2, median of 5 batches, 64-sample frame):
| N | per pair | per frame | saving | share of a 1.33 ms frame |
|---|---|---|---|---|
| 50 | 15.4 µs | 5.4 µs | 10.0 µs | 0.75% |
| 100 | 59.4 µs | 21.3 µs | 38.1 µs | 2.9% |
| 150 | 136.3 µs | 40.6 µs | 95.7 µs | 7.2% |
At the default 128-sample frame the microseconds are the same and the shares halve.
Has this feature been discussed and generally agreed?
Requested by @ann0see on #293; no PR until the design is agreed here.
🤖 This message was written by AI and reviewed by @mcfnord.
- Ngôn ngữ chính
- C
- Star
- 1.1k
- Fork
- 248
- Merge trung bình
- 7 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jamulussoftware/jamulus
-
Move translation checker (and potentially other runners) to ARM runnerCó thể đã có người làm @ann0see đã nhận 22 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
jamulussoftware/jamulus#3953 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Reused channel slot records the previous occupant's audioCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởAI bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
jamulussoftware/jamulus#3901 · 4 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 5 ngày
-
AI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jamulussoftware/jamulus#3846 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Qt6 moving towards cmakeĐang mởfeature request
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
jamulussoftware/jamulus#3964 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
jamulussoftware/jamulus#3961 ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của jamulussoftware/jamulus
Issue tương tự
-
[P2] Workspace updates silently ignore forbidden assignments while staging the rowCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 4 ngày
-
sdl3-image update to 3.4.8Đang mởcategory:port-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/vcpkg#54338 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:http-gateway good first issue priority:low type:docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
crazy-goat/php-fpm-ng#828 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
SunDevilRocketry/Flight-Computer-Firmware#347 ·
Maintainer thường phản hồi trong vòng 3 ngày