(Test wanted) EmulationStation suddenly terminates when displaying a lot of text
-
For those of use the official game name (in a kanji-using language such as Japanese) as the file name of ROM (ex: "光神話 パルテナの鏡.zip" instead of "Kid Icarus.zip"), have you ever experienced EmulationStation suddenly closing often?
(Especially if you using a high resolution display)I ran into this issue when I did something crazy like running RetroPie on a Raspberry Pi 4 connected to a 4K display.
After some trial and error, I think I've fixed it and would like you all to help test it.The repository is on GitHub, you can clone it with:
git clone --recursive https://github.com/o-p-a/EmulationStation.git --branch font_fix
To get your binaries, see the Building section in README.md.The sudden termination occurs when there are many different sorts of letters to be drawn.
Therefore, to reproduce this would require a game library that uses a lot of letters, which would probably be difficult for people from alphabetic countries to reproduce.
Therefore, I will also provide an explanation in Japanese later.This issue is caused by the process of handling EmulationStation textures.
For more details, please see this pull request.
(テスト希望) EmulationStationが大量の文字列を表示したときに突然終了する
ROMのファイル名に漢字(日本語など)で正式な名称をつけている(例:「Kid Icarus.zip」ではなく「光神話 パルテナの鏡.zip」)場合に、EmulationStationが突然終了してしまうことはありませんか?
(特に、高解像度ディスプレイを使用している場合)私は、4Kディスプレイに接続された Raspberry Pi 4 で RetroPie を実行するという酔狂なことをしたときに、この事象に悩まされました。
試行錯誤の末、問題を解決できたと思いますので、皆さんにテストに協力してほしいです。リポジトリはGitHub上にあり、次のコマンドでクローンできます。
git clone --recursive https://github.com/o-p-a/EmulationStation.git --branch font_fix
バイナリを取得するには、README.md の Building セクションを参照してください。突然の終了は、描画する文字の種類が多数ある場合に発生します。
したがって、これを再現するには、多くの文字を使用するゲームライブラリが必要になることから、アルファベット圏の国の人にとっては再現が難しい可能性があります。この問題は、EmulationStationのテクスチャ処理の処理に起因します。
詳細については、このプルリクエストを参照してください。 -
2 questions for the test:
- is the 4k display a pre-requisite or is just a coincidence because this resolution has a larger gamelist ?
- which theme and/or font should be used for testing ? I could be wrong, but I think the default theme doesn't reference a CJK enabled font.
-
@mitu Thank you for interest!
- 4K display is not required. I wrote "uses a lot of letters" above, but more accurately, this occurs when the accumulation of the area (pixels) of the drawn characters exceeds a threshold. Therefore, a 4K display is not required, but it is easier to reproduce than a 2K display.
carbon
should be fine. ES seems to reference/usr/share/fonts/truetype/droid/DroidSansFallbackFull.ttf
as a fallback for CJK. So havingDroidSansFallbackFull.ttf
installed should be enough. I'll try it on my pi when I get home.
-
My first test didn't cause a crash, but I think I don't have enough Kanji in my gamelist to cause an overflow to the glyphs texture cache. It probably has less than 300 Kanji and most of the Katakana alphabet, but I think I need more - I'll see how I can produce more.
-
OK, I can reproduce it with an 10+ Kanji populated gamelist. Had to do a bit of scrolling, but it crashed in
Font::renderTextCache
. I will try the fix you added in the PR to see how it behaves. -
The fix in the PR (https://github.com/RetroPie/EmulationStation/pull/882) prevents the crash and I can't reproduce the issue anymore.
One thing that it's perhaps related to the fix is the gradual increase in font memory, it grew from 35 Mb to approx 80+ Mb after I finished scrolling the entire game list (11.000+ entries consisting in Japanese sentences with Kanji/Katakana/Hiragana).
Thank you for the fix, it seems to be working.
-
@mitu Thank you for testing!
I'm happy to see results that my fix worked without breaking anything.
I also created a minimal dataset to make it easier for others to reproduce and test the problem.
Extract this and replace theemulationstation
folder with your~/.emulationstation
. (Backup is needed)
When you start EmulationStation, (if you haveDroidSansFallbackFull.ttf
installed,) it should look something like this:
There are 100 dummy ROM files, so try scrolling through them by pressing the down arrow key⬇.In my environment, the results were as follows, depending on the screen resolution:
emulationstation --resolution 720 480
→ no problememulationstation --resolution 1366 768
→ Scrolling through the game list works fine, but then the main menu appears brokenemulationstation --resolution 1920 1080
→ Crash when pressing ⬇ 43 timesemulationstation --resolution 2560 1440
→ Crash when pressing ⬇ 21 timesemulationstation --resolution 3840 2160
→ ES won't start
And when I included my fix in the binary, all of them were displayed without any problems.
We hope that this will encourage more people to test it and get good results.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.