Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hovered cursor is slow to scroll with non-latin characters #131

Closed
tupo2 opened this issue Nov 18, 2023 · 7 comments
Closed

Hovered cursor is slow to scroll with non-latin characters #131

tupo2 opened this issue Nov 18, 2023 · 7 comments

Comments

@tupo2
Copy link

tupo2 commented Nov 18, 2023

Playlist to test:

#EXTM3U
#EXTINF:,Oliver Anthony - Rich Men North Of Richmond
https://www.youtube.com/watch?v=sqSA-SY5Hro
#EXTINF:,【オリジナル楽曲】粛聖!! ロリ神レクイエム☆ / しぐれうい(9さい)
https://www.youtube.com/watch?v=Ci_zad39Uhw
#EXTINF:,Linda Remix - Marka Akme, Lautygram, Migrantes, Peipper, DJ Tao
https://www.youtube.com/watch?v=jRn_jPySTmI
#EXTINF:,The Beatles - Now And Then (Official Audio)
https://www.youtube.com/watch?v=AW55J2zE3N4

Does not happen when paused.

@jonniek
Copy link
Owner

jonniek commented Nov 22, 2023

I cannot reproduce. Can you share some more information like operating system and mpv version?

After removing the files with non-latin characters it works faster?

@tupo2
Copy link
Author

tupo2 commented Nov 22, 2023

Debian Sid and mpv 0.36.0.
If I remove line 5 (...Ci_zad39Uhw), it' smooth.

@jonniek
Copy link
Owner

jonniek commented Nov 22, 2023

If you make filename_replace setting null does it change anything?

Or can you try if it gets faster if you change parse_filename function to this:

function parse_filename(string, name, index)
  local base = tostring(plen):len()
  return string:gsub("%%pos", string.format("%0"..base.."d", index+1))
               :gsub("%%name", name)
end

I'm wondering if the gsubs are causing some performance issues with some characters.

Also can you try using this title:

#EXTINF:,【オリジナル楽曲】粛聖!! ロリ神レクイエム/ しぐれうい(9さい)

I wonder if it's the character causing the issue.

Also could you try using another font if that solves the issue? Then it could be some issue in font rendering rather than in this script.

@tupo2
Copy link
Author

tupo2 commented Nov 23, 2023

If you make filename_replace setting null does it change anything?

Or can you try if it gets faster if you change parse_filename function to this:

function parse_filename(string, name, index)
  local base = tostring(plen):len()
  return string:gsub("%%pos", string.format("%0"..base.."d", index+1))
               :gsub("%%name", name)
end

I'm wondering if the gsubs are causing some performance issues with some characters.

Also can you try using this title:

#EXTINF:,【オリジナル楽曲】粛聖!! ロリ神レクイエム/ しぐれうい(9さい)

I wonder if it's the character causing the issue.

Same issue.

Also could you try using another font if that solves the issue? Then it could be some issue in font rendering rather than in this script.

The default font I'm using for OSD is sans-serif. Tested with others fonts and it's much better.
I did not notice before, this message spam in the terminal when I display the playlist:
[osd/libass] fontselect: failed to find any fallback with glyph 0xFF09 for font: (sans-serif, 400, 0)

@jonniek
Copy link
Owner

jonniek commented Nov 23, 2023

I think 0xFF09 is the character. FULLWIDTH RIGHT PARENTHESIS. It could be that causing the slowness in the rendering.

Maybe this discussion has some solutions https://www.reddit.com/r/archlinux/comments/8ciooy/support_for_fullwidth_latin_letters/

I'm not sure if there is anything I can do on the script level to fix this issue. It might be also useful to report to mpv repository, as they could probably do some caching and more performant fallbacks on missing characters.

@tupo2
Copy link
Author

tupo2 commented Nov 24, 2023

I think 0xFF09 is the character. FULLWIDTH RIGHT PARENTHESIS. It could be that causing the slowness in the rendering.

0xFF09, is not the only character displayed in a loop in the terminal:

[osd/libass] fontselect: failed to find any fallback with glyph 0x30AA for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30EA for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30B8 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30CA for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30EB for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x697D for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x66F2 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x7C9B for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x8056 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30ED for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30EA for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x795E for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30EC for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30AF for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30A4 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30A8 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30E0 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3057 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3050 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x308C for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3046 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3044 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0xFF08 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3055 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3044 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0xFF09 for font: (sans-serif, 400, 0)

I think this cause performance issues, do you know how to stop it (except to close the playlist)?

Maybe this discussion has some solutions https://www.reddit.com/r/archlinux/comments/8ciooy/support_for_fullwidth_latin_letters/

Thanks for the info, I tested fonts-noto-cjk and it's OK too.

@jonniek
Copy link
Owner

jonniek commented Nov 24, 2023

Here is a thread about similar topic, mentioning the slowdown as well. mpv-player/mpv#8919

I think the solution is either in the system or optimizations in mpv/libass. I recommend opening or looking for an issue in those repositories if you cannot resolve the issue.

I'll close this as there is not really anything this script can do to avoid this issue, and my knowledge on the topic is limited.

@jonniek jonniek closed this as completed Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants