glKarin / com.n0n3m4.diii4a

idTech4A++, idTech engine game For Android, DOOM III/Quake 4/Prey(2006)/DOOM3 BFG 1&2/The Dark Mod/RTCW/Quake 3/Quake 2/Quake 1
GNU General Public License v3.0
233 stars 15 forks source link

What we know about The Dark Mod BlackScreen Issue #171

Closed keepChatAlive closed 1 month ago

keepChatAlive commented 2 months ago

I know it is not really a good idea to post duplicated issues but the original issue is cluttered and I want to play this, so What we know: 1.According to report, at least both lower and higher-end (MTK/Google) Mali GPU, and lower end Qualcomm Adreno GPU has this issue. Higher end Qualcomm Adreno GPU seems to work as author seems to have tested the game on them 2.Wait, manually edit shader files by moving OpenGLES Version line to the top of the file(commit c42c175b0f2bf8be402918768b186a8b41c9388b), or edit that "use precompressed texture" variable in config file won't work on Mali 3.There is no obvious error message in stdout.txt except for a window resize of 0x0 and some OpenGL shader program stub (and we don't know if it is really errors or would output these in any circumstances) 4.I viewed the logcat message on my phone (ColorOS 13, 12G RAM, Mali G610 MC6-Dimensity 8100)(I am willing to provide debugging help and my phone is rooted) and I found this log spam 04-21 08:37:26.118 7619 12890 E GED : ged_gpu_timestamp: GED_ERROR_FAIL eErr = 0, -2 04-21 08:37:26.127 7619 12890 E GED : ged_gpu_timestamp: GED_ERROR_FAIL eErr = 0, -2 also we got this mtkpower@impl: [setMode] unknown type don't know if this is important

from the static int ged_init(void) function in https://android.googlesource.com/kernel/mediatek/+/android-mtk-3.18/drivers/misc/mediatek/gpu/ged/src/ged_main.c this error would be thrown when if (NULL == proc_create(GED_DRIVER_DEVICE_NAME, 0644, NULL, &ged_fops)) failing to create some process, don't know what that mean did it mean the driver is lost due to some unsupported operations?

5.I tested the game with (ColorOS13, 8G RAM, Snapdragon 695 With Adreno 619) It would blackscreen like Mali when using original shader package It would crash to desktop immediately when using modified shader package (commit c42c175b0f2bf8be402918768b186a8b41c9388b) Editing the var(image_usePrecompressedTextures to 0), but do not replace the shader package. make the game display the menu correctly on Adreno, but not Mali

@segas75 at bare minimum we know how to make low end Qualcomm device work now

keepChatAlive commented 2 months ago

analysis of that line powered by google bard: Absolutely, let's analyze the error "proc_create(GED_DRIVER_DEVICE_NAME, 0644, NULL, &ged_fops) returns NULL" from a Linux kernel perspective:

Understanding the Code Snippet:

proc_create: This function is used to create a new entry in the /proc filesystem. The /proc filesystem provides a way for user-space programs to interact with the kernel.

GED_DRIVER_DEVICE_NAME: This is likely a constant string that defines the name of the proc entry being created. The name typically reflects the functionality it represents (e.g., "ged_driver").

0644: This octal number represents the permission settings for the proc entry. In this case, it grants read (4) permissions to all users (0) and no write (0) permissions.

NULL: This argument is likely intended to be a pointer to a struct file_operations structure. This structure defines the callback functions that handle various operations (read, write, open, etc.) associated with the proc entry.

&ged_fops: This is likely a pointer to a variable named ged_fops of type struct file_operations. It presumably contains the actual callback functions that handle interactions with the GED driver through the proc entry.

Why it Might Return NULL:

There are several reasons why proc_create might return NULL:

Insufficient Privileges: Creating entries in the /proc filesystem often requires root privileges. If the process attempting to call proc_create doesn't have these privileges, the kernel will return NULL.

Resource Limitation: The kernel maintains a limited number of available proc entries. If the maximum number of entries has already been created, proc_create will fail and return NULL.

Memory Allocation Failure: The kernel might be unable to allocate the necessary memory for the new proc entry structure. This could happen due to low memory availability.

Invalid Arguments:  If there's an issue with the arguments passed to proc_create, such as an invalid permission setting or an incorrect pointer, the function could return NULL.

Troubleshooting Steps:

Here's how you could approach troubleshooting this error:

Check Privileges:  Ensure the process calling proc_create has root privileges.

Verify Available Entries:  Use commands like ls /proc or sysctl fs.proc.nr_files to check how many proc entries are currently in use. If the limit is reached, consider cleaning up unused entries.

Review Kernel Logs:  The kernel logs might provide more details about the failure reason. Look for messages related to proc_create or memory allocation failures.

Double-Check Arguments:  Ensure the arguments passed to proc_create are valid, including the name, permissions, and pointers to the callback functions.

Additional Considerations:

Kernel Version: The specific behavior of proc_create might vary slightly depending on the Linux kernel version. Consult the kernel documentation for your specific version.

GED Driver Implementation:  It's important to understand the intended functionality of the GED driver and how it interacts with the /proc filesystem. Consulting the driver's documentation or source code might provide valuable insights.

By analyzing the potential causes and exploring the troubleshooting steps, you can gain a better understanding of why proc_create is failing and how to potentially resolve the issue with the GED driver in the Linux kernel.

keepChatAlive commented 1 month ago

Mali black screen fixed and can enter the game now