Repository navigation
BOTWRecompAndroid 0.4.8 (beta 40): caçando o travamento, e texturas sem esperas
Pre-releaseBeta 40. Correções para threads do jogo que podiam ficar esperando para sempre, um relatório de travamento que mostra onde a thread principal do jogo está, e trocas de textura sem esperar a thread de render em toda GPU.
O travamento depois de alguns minutos (#401, #489)
Os primeiros logs da 0.4.7 mostraram que não é a GPU: quando trava, a thread principal do jogo segura o "núcleo 0" (o app faz as threads desse núcleo se revezarem, como no Switch) e não larga, enquanto as outras esperam. Uma delas pediu para dormir 100 ms e ficou 10 s esperando atrás dela.
- Relatório de travamento: além da lista de threads, o log agora diz quem segura o núcleo 0, há quanto tempo, quem está na fila, e onde a thread que o segura está naquele momento. Quem tem o travamento: espere uns 15 s depois de travar, feche o app e mande o
botwrecomp-log-previous.txt(Configurações > Arquivos). - Três correções que podiam deixar uma thread do jogo esperando para sempre:
- as esperas com prazo (como um "durma 100 ms") usavam o relógio do sistema: se o Android acertasse a hora para trás, a espera durava até o relógio alcançar. Agora usam um relógio que não volta (ideia do peanuts-native);
- um cancelamento de espera terminava também esperas por uma trava, e a thread seguia como se tivesse a trava. Agora só termina o tipo de espera certo, como no Switch;
- algumas esperas pela thread de render (ao destruir ou registrar uma textura) seguravam o núcleo 0 enquanto esperavam. Agora o liberam.
- O relatório não acusa mais travamento durante um reinício do jogo.
Desempenho
- Trocas de slots de textura sem esperar a thread de render em toda GPU (antes só na Mali e com pouca RAM). No POCO F7 Ultra, de 1254 esperas para 0 no Platô. Contribuição do HallanBR (#454).
- Mali (e o modo cópia): trabalho de compute encadeado sem barreiras a mais, e uma barreira que podia se perder agora é feita. Contribuição do Propinbo (#508).
Não precisa compilar o código do jogo de novo: é só instalar por cima.
Problemas conhecidos
- O jogo pode travar depois de alguns minutos (#401 na Mali-G1, #489 numa Adreno 710): as correções acima podem ajudar, e o novo relatório deve mostrar a causa.
- Mali-G720 / G615: o app pode fechar depois de ~35 min porque os mapeamentos de memória crescem (#496).
- 4 GB de RAM: perto de 20 fps no mundo, e o fps cai quando o aparelho esquenta.
- RADV no Xclipse 530: o jogo cai dentro do driver RADV ao entrar no mundo (#383). PanVK ainda não é suportado (#497, #503).
- 1.0.0 em combate: os inimigos podem deixar linhas pretas ao morrer. Use a 1.8.2 ou a 1.9.0.
- A chuva cai mais devagar que no console. A grama baixa ao longe só aparece de perto. No driver de fábrica da Qualcomm, o fundo do menu de pausa fica preto.
Nenhum arquivo do jogo vem incluído. Testada no POCO F7 Ultra (Adreno 830, Turnip). Para instalar e configurar: 0.1.0-beta. Créditos no README.
Beta 40. Fixes for game threads that could wait forever, a freeze report that shows where the game's main thread is, and texture swaps without waiting for the render thread on every GPU.
The freeze after a few minutes (#401, #489)
The first 0.4.7 logs showed that it isn't the GPU: when it freezes, the game's main thread holds "core 0" (the app makes that core's threads take turns, as on the Switch) and never lets go, while the others wait. One of them asked to sleep 100 ms and waited 10 s behind it.
- Freeze report: besides the thread list, the log now says who holds core 0, for how long, who is queued for it, and where the holding thread is at that moment. If you get the freeze: wait about 15 s after it freezes, close the app, and send
botwrecomp-log-previous.txt(Settings > Files). - Three fixes for ways a game thread could wait forever:
- timed waits (like "sleep 100 ms") used the system clock: if Android set the time back, the wait lasted until the clock caught up. They now use a clock that never goes back (an idea from peanuts-native);
- a cancelled wait also ended waits for a lock, and the thread went on as if it held the lock. Now it only ends the right kind of wait, as on the Switch;
- some waits for the render thread (when a texture is destroyed or registered) kept core 0 while waiting. They now let it go.
- The report no longer calls an in-game restart a freeze.
Performance
- Texture slot swaps without waiting for the render thread on every GPU (before: only on Mali and low RAM). On the POCO F7 Ultra, from 1254 waits to 0 on the Plateau. Contributed by HallanBR (#454).
- Mali (and copy mode): compute work chained without extra barriers, and a barrier that could be lost is now made. Contributed by Propinbo (#508).
No need to build the game's code again: just install over the previous version.
Known issues
- The game can freeze after a few minutes (#401 on Mali-G1, #489 on an Adreno 710): the fixes above may help, and the new report should show the cause.
- Mali-G720 / G615: the app can close after ~35 min because memory mappings grow (#496).
- 4 GB RAM: close to 20 fps in the world, and fps drops as the device heats up.
- RADV on Xclipse 530: the game crashes inside the RADV driver when entering the world (#383). PanVK isn't supported yet (#497, #503).
- 1.0.0 in combat: enemies can leave black lines when they die. Please use 1.8.2 or 1.9.0.
- Rain falls slower than on the console. Short grass in the distance only appears up close. On Qualcomm's stock driver, the pause menu's background is black.
No game files are included. Tested on the POCO F7 Ultra (Adreno 830, Turnip). To install and set up: 0.1.0-beta. Credits in the README.