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

🐛 [BUG] - The system uses 60hz instead of using the highest refresh rate the monitor provides (mine is 100hz) #106

Open
AchIrsHam opened this issue Nov 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@AchIrsHam
Copy link

Description

Yes, i don't know if something necessary like this has to be reported to GitHub, but this is very annoying for me and I can't find a solution to my personal problem

Reproduction steps

1. Install a new fresh copy of BlissOS
2. Activate developer mode
3. Turn on 'Show refresh rate' options

Screenshots

I don't know how to take a screenshot by default in Bliss, the important thing is that a red number appears on the screen and says '60' (I know this is trivial, but I just followed the instructions)

Logs

why?

Category

Display

OS Version

16.x

@AchIrsHam AchIrsHam added the bug Something isn't working label Nov 6, 2024
@AchIrsHam
Copy link
Author

I just want to enjoy BlissOS with a high refresh rate

@Xtr126
Copy link

Xtr126 commented Nov 8, 2024

The issue is that the default mode your monitor advertises to the OS (Bliss in this case) is the one with lower refresh rate.
Then hwcomposer picks it first and stuck with it.
It’s possible to tell drm_minigbm_celadon hwcomposer to use a specific mode by using kernel parameters, but this requires figuring out mode id and connector id which you can do only if you are familiar with linux terminal and kernel (graphics) drm subsystem in sysfs/dev.

For celadon hwc you can “select monitor” with these experimental flags, MODE_ID and CONNECTOR_ID https://github.com/BlissRoms-x86/device_generic_common/blob/6017b7d8071e148623efca41531fc1c5ff2a6092/init.sh#L498
This is how I got it to work long ago
Run this command cd /sys/class/drm; for i in card*; do echo $i; cat $i/modes; done
And get an output:

console:/sys/class/drm # cd /sys/class/drm; for i in card*; do echo $i; cat $i/modes; done 
card0
cat: card0/modes: No such file or directory
card0-Virtual-1
5120x2160
4096x2160
3840x2160
3840x2160
3840x2160
1920x1440
2560x1080
1856x1392
1792x1344
2048x1152
1920x1200
1920x1080
1920x1080
1600x1200
1680x1050
1400x1050
1280x1024
1440x900
1280x960
1360x768
1280x768
1024x768
800x600
640x480
640x480
console:/sys/class/drm # 

I used QEMU for this demo but it also works on physical devices.
If you want the second resolution, 4096x2160
then MODE_ID=2
Then obtain CONNECTOR_ID from logcat | grep hwc (as soon as android boots before logs are erased)
For example from here it would be CONNECTOR_ID=34

130|console:/ # logcat | grep hwc                                              
11-14 06:45:28.412   659   659 D hwc-drm-device: The property 'vendor.hwcomposer.preferred.mode.limit' value is 1
11-14 06:45:28.412   659   659 D hwc-drm-device: The property 'vendor.hwcomposer.planes.enabling' value is 0, only support primary plane
11-14 06:45:28.412   659   659 D hwc-drm-device: The property 'vendor.hwcomposer.planes.num' value is 99
11-14 06:45:28.413   659   659 I hwc-buffer-info-getter: Using CrOS Gralloc gralloc module: Chrome OS
11-14 06:45:28.413   659   659 D hwc-drm-connector: The property 'vendor.hwcomposer.connector.id' value is -1
11-14 06:45:28.413   659   659 D hwc-drm-connector: The property 'vendor.hwcomposer.mode.id' value is -1
11-14 06:45:28.413   659   659 D hwc-drm-connector: CONNECTOR:34 select one mode, id = 1, name = [email protected], refresh = 59.993221
11-14 06:45:28.413   659   659 D hwc-drm-connector: CONNECTOR:34 preferred mode found, set preferred mode id = 1, name = [email protected], refresh = 59.993221
11-14 06:45:28.413   659   659 D hwc-drm-connector: The property 'vendor.hwcomposer.connector.multi_refresh_rate' value is -1
11-14 06:45:28.413   659   659 I hwc-resource-manager: Attaching connector Virtual-1
11-14 06:45:28.413   659   659 I hwc-drm-two: Attaching pipeline 'Virtual-1' to the display #0 (Primary)
11-14 06:45:28.413   659   659 D hwc-drm-connector: The property 'vendor.hwcomposer.connector.id' value is -1
11-14 06:45:28.413   659   659 D hwc-drm-connector: The property 'vendor.hwcomposer.mode.id' value is -1
11-14 06:45:28.413   659   659 D hwc-drm-connector: CONNECTOR:34 select one mode, id = 1, name = [email protected], refresh = 59.993221
11-14 06:45:28.413   659   659 D hwc-drm-connector: CONNECTOR:34 preferred mode found, set preferred mode id = 1, name = [email protected], refresh = 59.993221
11-14 06:45:28.413   659   659 D hwc-drm-connector: The property 'vendor.hwcomposer.connector.multi_refresh_rate' value is -1
11-14 06:45:28.414   659   659 I hwc-backend: Backend 'generic' for 'Virtual-1' and driver 'virtio_gpu' was successfully set

On my laptop MULTI_REFRESH_RATE=1 in kernel cmdline was also sufficient to let me switch between different refresh rates from Android settings > display.

Switching to gbm_gralloc might work as an alternative if you cannot find modes/connector, however it may cause other issues.

GRALLOC=gbm HWC=drm_gbm_cros drm_mode=1920x1080@100 video=1920x1080@100

TL;DR: You have find out the mode id and connector id for 100hz and supply them in kernel cmdline with MODE_ID= and CONNECTOR_ID= and use HWC=drm_minigbm_celadon GRALLOC=minigbm.

Another solution is to use edid_override feature of Linux kernel, it must be triggered before Android starts to use the GPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants