obsproject / obsproject/obs-studio
Inconsistent volume meter size when using display scaling
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 76.4k
- Forks
- 10.2k
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 12
Description
Operating System Info
Windows 10
Other OS
No response
OBS Studio Version
30.2.3
OBS Studio Version (Other)
No response
OBS Studio Log URL
https://obsproject.com/logs/8WFn4zPiVtUhkJzv
OBS Studio Crash Log URL
No response
Expected Behavior
Volume meter thickness and gap should remain consistent and static between channels and different sources with same channel count, regardless of scale.
These screenshots were taken in 100% scaling:
Current Behavior
Volume meter thickness varies between sources with the same channel number, sometimes even between channels in the same source. It also tends to flicker when scrolling within the dock or moving it around.
I may be going crazy but after staring at them for long enough, I also feel like the different sections (clip, warn, regular) are not aligned. Each seems to be offset to the right by one pixel, from the top down (using vertical meters). I was not able to see this on the screenshots though ... maybe a subpixel thing.
https://github.com/user-attachments/assets/71bb1b6c-230f-4928-85a9-eabf85735028
https://github.com/user-attachments/assets/2c6a0a2a-c68a-482d-b0a7-d3cd1ea764af
Steps to Reproduce
- Move OBS window to a display with 125% scaling (in OS)
- Add at least one audio source with at least 4 channels (the issue becomes more visible, the more channels a source has) - This might be hard without an actual surround setup. If there is an ASIO device present, I can recommend the ASIO plugin which can be configured to display any common channel layout.
- Slowly move the OBS window (or scroll inside the audio mixer) and observe the size and gap of the channel meters
- Switch to the vertical meter layout
- Take a close look at the alignment of the different meter sections within the same channel - this one is equally visible for me on any channel count, even mono
Anything else we should know?
The issue happens in both sample peak and true peak mode.
Based on my own experience "manually" drawing items on the screen, this is almost certainly a rounding issue. Due to the scaling, pixel values will have fractions during internal calculations which eventually get truncated down to integers. This results in weird behavior when the value was something like 12.8 which should be rounded up, often compounded e.g. when an item's position (which itself could already have a fraction) is combined with an item's size (also including a fraction).
I reckon other scaling factors are affected as well to varying degrees. Something like 200% is probably fine as it's a "clean" x2.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the mixer behavior on Windows 10 with 125% display scaling, a multi-channel audio source, and both horizontal and vertical meter layouts. Trace the volume-meter rendering entry point from the mixer UI, then verify that channel thickness, gaps, and section alignment remain consistent while scrolling or moving the window at non-integer scaling factors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- audio-video-rtc, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100