Running mpv in isolated core. #17200
tramchamploo
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to run mpv in Linux with isolated cores for jitter free playback. I'm using realtime kernel and isolate mpv with nohz_full and rcu_nocbs then cpuset to make it exclusive on specific cores. I'm only playing audio, the playback went smoothly at first but cpu usage went high every few seconds leading to a device underrun. I don't want to make buffer large because small buffer and period helps with my dac's PLL circuit for lowest jitter.
I noticed cpu goes high at the moment that playback time updates. On a tickless core, playback time hardly updates but once it does, it blocks the playback. I suspected it's time retrieval that causes the lag. I did some code digging and found mpv already uses CLOCK_MONOTONIC_RAW as clocksource. . So I make tsc=reliable and tsc=nowatchdog for system to only get timestamp via tsc instead of trying to sync with other clocksource like hpet every now and then. I also tried osd-level=0 to suspend UI updates. It went no luck and the issue persist.
So it can be other operations near the time retrieval that causes blocking. Another thing is I use very long tap resampling with libavfilter in my mpv config, after disabling threading of filtering, things got better but not completely resolved. I know rt threads tend to run exclusively without giving timeslice to other tasks but how can I improve the situation?
Beta Was this translation helpful? Give feedback.
All reactions