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

Apply rt kernel patch to linux 4 4 2 #401

Merged
merged 2 commits into from
Jun 11, 2016

Conversation

larskj
Copy link

@larskj larskj commented Jun 11, 2016

The motivation of this pull request is to decrease controller input latency of RetroArch running on Lakka.

The pull request is split into two commits:

  1. Apply real time kernel patch to linux 4.4.2 used by the generic targets
  2. Update the x64 linux config file to utilize the real time kernel (fully preemptible)

This cuts away a full frame of delay on my NUC setup by being able to increase the "Frame Delay" setting all the way to the max value of 15 for nes.

For now only x64 generic is configured to utilize the RT functionality of the kernel.

See commit messages for additional info:

  1. Added rt patch for linux kernel 4.4.2
  2. Enable RT configs for Generic x64.
    • We have previously patched the kernel with the real time patch,
      we now want to utilize it.
    • The goal here is to decrease scheduler latency through
      changing the configs in linux.x86_64.conf:
    • Setting preemption model to 'Fully Preemptible Kernel (RT)'
    • Setting tick rate to 1000Hz.
    • Setting cpu governor to performance.
    • The above should make it possible to significantly increase
      the "Frame Delay" setting in RetroArch since we now have less
      scheduler latency and a more consistently running system
    • With the above changes, I am now able to set "Frame Delay"
      to the max value of 15 for nes, which cuts away a full
      frame of input latency from controller input to screen update.

- We have previously patched the kernel with the real time patch,
  we now want to utilize it.

- The goal here is to decrease scheduler latency through
  changing the configs in linux.x86_64.conf:

- Setting preemption model to 'Fully Preemptible Kernel (RT)'
- Setting tick rate to 1000Hz.
- Setting cpu governor to performance.

- The above should make it possible to significantly increase
  the "Frame Delay" setting in RetroArch since we now have less
  scheduler latency and a more consistently running system

- With the above changes, I am now able to set "Frame Delay"
  to the max value of 15 for nes, which cuts away a full
  frame of input latency from controller input to screen update.
@kivutar kivutar merged commit fac545f into libretro:lakka Jun 11, 2016
@kivutar
Copy link
Member

kivutar commented Jun 11, 2016

Ok thanks, I merged this for test purposes, I will build the image and we will test it together.

@larskj
Copy link
Author

larskj commented Jun 12, 2016

Ok I will test it when it is ready.

@kivutar
Copy link
Member

kivutar commented Jun 12, 2016

@larskj
Copy link
Author

larskj commented Jun 13, 2016

Can I ask you to upload the system and kernel file instead so I don't have to wipe my SD card with the full image?

@larskj
Copy link
Author

larskj commented Jun 13, 2016

Nevermind, I will just flash another SD card...

@larskj
Copy link
Author

larskj commented Jun 13, 2016

Hi, I tried your modified image now and using NES I can increase the Frame Delay all the way to 15 as I could with my own modified version, so looks good.

I would however have liked to update Lakka to the latest unmodified nightly and verify that I now can only set Frame Delay to around 5 as I would expect, but it will not let me update. I'm getting md5/size check fails after the tar-extraction after reboot.

Probably a separate issue - I think I saw you changed the partition size recently, could that be the cause?

Anyway, the patch seems to work although I can't downgrade/upgrade a couple of times easily and verify the difference as I would have liked.

@kivutar
Copy link
Member

kivutar commented Jun 13, 2016

I'm not sure where this error comes from. The image I gave you already have the 512Mb partition, so have the latest unmodified nightly. Maybe the file got corrupted during download?

Anyway, does the RT patch have an impact on emulation performance?

@larskj
Copy link
Author

larskj commented Jun 13, 2016

Yes I was able to set the frame delay to the max value of 15 which cuts away almost a full frame of delay and is not possible to do with the regular builds. Same as what I saw on my own modified rt patched builds.

@kivutar
Copy link
Member

kivutar commented Jun 13, 2016

Ok. Can you make the same patch for the i386 build please?

Does this patch make sense on ARM boards where we are not using DRM/KMS?

@larskj
Copy link
Author

larskj commented Jun 14, 2016

Ok I will fix the i386 build as well.

It should make sense for ARM boards too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants