You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: linux-v4l2: frame rate truncated to int, wrong fps and restarts on every settings change (upstream #13388, #13896) #201
Reproduced headlessly with the real linux-v4l2.so on a v4l2loopback device fed at 640x480, 30 fps, picking "30.00" and then changing an unrelated setting three times:
list value for "30.00"
device ends up at
restarts for 3 unrelated changes
master
30
1000/1 fps (the loopback driver's maximum), select timed out floods
RED test (cmocka, test_v4l2_framerate), with the list entry and the framerate part of v4l2_settings_changed moved into v4l2-framerate.[ch] (behaviour unchanged):
picked_framerate_requests_that_interval: fails today ("picked 1/30 s per frame, setting 30 requests 0/30")
Cause: the frame-rate list stored the packed 64-bit (numerator, denominator) interval in an int, so the picked rate was truncated (1/30 became 0/30, an infinite rate the driver clamps to its maximum), and the saved setting never matched what the device reports, so every settings change (zoom, focus, anything) restarted the capture.
Workaround on stock OBS: leave the source's Frame Rate on "Leave Unchanged" and set the camera's rate outside OBS (e.g. v4l2-ctl --set-parm=30).
obs-rust is an AI-assisted fork of OBS; on Arch it's obs-studio-rust-git in the AUR.
If you get a chance to try it, a short reply here on whether it fixes it for you would really help, especially if it does not. Your camera model and the frame rate you pick are the useful details.
Activity
rdoupe commentedon Oct 11, 2026
Claiming: this issue.
test_v4l2_framerate(2 of 3 failing), framerate handling moved intov4l2-framerate.[ch]with no behaviour change.int64_t), credited.PR within the hour.
linux-v4l2: Keep packed framerate in list values
linux-v4l2: Add RED framerate list tests
rdoupe commentedon Oct 11, 2026
@acscd @shanefagan you reported this in obsproject/obs-studio#13388 / obsproject/obs-studio#13896, so a heads-up: it's fixed here in obs-rust by #202, which is acscd's upstream fix (obsproject/obs-studio#13808) with a regression test.
Cause: the frame-rate list stored the packed 64-bit (numerator, denominator) interval in an
int, so the picked rate was truncated (1/30 became 0/30, an infinite rate the driver clamps to its maximum), and the saved setting never matched what the device reports, so every settings change (zoom, focus, anything) restarted the capture.Workaround on stock OBS: leave the source's Frame Rate on "Leave Unchanged" and set the camera's rate outside OBS (e.g.
v4l2-ctl --set-parm=30).obs-rust is an AI-assisted fork of OBS; on Arch it's
obs-studio-rust-gitin the AUR.If you get a chance to try it, a short reply here on whether it fixes it for you would really help, especially if it does not. Your camera model and the frame rate you pick are the useful details.
linux-v4l2: Map framerates saved truncated to the device's interval (o…