CurryKitten / CurryKitten-Sim

FPV quad simulator
70 stars 7 forks source link

Missing resolution - 3840*1600 #78

Closed howels closed 3 years ago

howels commented 3 years ago

My monitor's native resolution is 3840x1600 but this is missing. Other 21:9 resolutions are available like 3440x1440, but for some reason the native resolution is missing.

CurryKitten commented 3 years ago

Hmmm, that's weird. I'm kind of held hostage by what Unity thinks is available from your graphics card/monitor I ask it for all the supported resolutions and stick them in a drop down menu for you to choose. If there's any chance you have the Unity engine on your system, then you could generate the same with -

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ResolutionCheck : MonoBehaviour
{
    void Start()
    {
        Resolution[] resolutions = Screen.resolutions;

        // Print the resolutions
        foreach (var res in resolutions)
        {
            Debug.Log(res.width + "x" + res.height + " : " + res.refreshRate);
        }
    }
}
howels commented 3 years ago

Which Unity release should I use?

CurryKitten commented 3 years ago

I'm using 2018.4.24f1 (for max compatibility for people running 32 bit) But it would be interesting to see if it got different results on a later version. Sorry, I would test this myself, but I'm missing the necessary hardware that would actually give the right results

howels commented 3 years ago

I tried adding this script to a blank Unity project using the LTS release but although I see a blank 3D scene, nothing is sent to the console. Could you build the linux binary and send it to me please?

CurryKitten commented 3 years ago

I can do if it's not working, but just to be certain you are doing the same. What you need to do is add an empty GameObject to the scene, and then drop the script into it in the inspector, then when you run you should see console output similar to the attached pic

Screenshot 2021-01-27 at 15 17 57

howels commented 3 years ago

I've got the closest available version shown on Unity Hub - 2018.4.31f1 and imported the script

image

However when I import the script nothing is shown on the console image

CurryKitten commented 3 years ago

@howels Sorry, if this is obvious, but just to double-check - did you hit the play button icon to run that project?

howels commented 3 years ago

@howels Sorry, if this is obvious, but just to double-check - did you hit the play button icon to run that project?

My first attempt at running Unity ever so apologies cos I'm probably making dumb mistakes but I can't see any output. I also thought that I'd see debug output if I built the project and ran it from a terminal, but I got nothing there either. image

CurryKitten commented 3 years ago

Ok, bear with me and I'll build a version of this. I just need to get my Linux VM running so I can check where the debug stuff goes... I think it logs to a text file in Linux.

howels commented 3 years ago

After looking at the -vulkan flag I found the -screen-height and -screen-width parameters. When I specify 3840x1600 at the command line your resolution picker thinks I'm at 640x480 but the game is definitely running at the higher resolution.

Also I tested using Wine (Proton) to run the Windows version of the game under Steam and whilst it insisted on sticking to one monitor I was able to see all the available resolutions in that version. So it might be a deficiency of this Linux version of Unity, which is sad but not entirely unexpected.

CurryKitten commented 3 years ago

Ok, a workaround at least.... although you do get used to a certain number of those running Linux. I'm still interested to see what the results of the script are, and I can potentially build it in the 2018 version of Unity as well as a more up to date 2019 version just to see if it's something that's been "fixed" in Unity, or if they blame the Linux driver.

howels commented 3 years ago

Nvidia driver should be ok - it's that same driver that is able to supply the list of resolution to the Windows version of the game I run under Wine on Linux. Seems like the Unity runtime is reading my resolution too - it's printed in the log file. So where the data is disappearing is interesting.

howels commented 3 years ago

@CurryKitten something else that might interest you on GitHub - https://github.com/harlab/CM4Ext_Nano/issues/3 a carrier board for the Pi4 Compute Module which is being designed to fit the needs of OpenHD.

CurryKitten commented 3 years ago

Ok, so I've written a little standalone thing to generate all the resolutions and refresh rates that will show it in a window.... as well as writing to a file (as far as Unity on Linux goes anyway) and I've also created a build based on both Unity 2018 (which is what the Sim uses) and 2019.

It should draw up a little window that will look something like this

Screenshot 2021-01-29 at 16 40 53

I did try running it in my VM, but VMware doesn't seem to be passing on the fact it has any resolutions at all, so erm... pass. It should be the same code everywhere though.

@howels here are the links to executables to grab (they are too big to live as files here)

https://drive.google.com/file/d/1XnJsgN8M9b0jljAc9XUajb4aKXhNehJJ https://drive.google.com/file/d/1rf7YzbvGQp_wJL9yJ_4FV1NCjHZcgvwM

EDIT: If we ever get to go outside again, I'm looking forward to picking up my Open.HD stuff and getting more stuff done :)

howels commented 3 years ago

Unfortunately despite Unity clearly supporting this resolution and even logging it at startup it is not appearing in the list. I'm also running this on my 2nd monitor which should show full 4K 3840x2160 as well but that is also missing.

Unity 2018: image

Unity 2019: image

CurryKitten commented 3 years ago

@howels I'm not sure I can do much with this. Given that when you run the Sim on a Windows VM it recognises the available resolutions, there seems to be something between the graphics driver in Linux and Unity that aren't speaking. I did look for any reported bugs here that Unity is working on, but couldn't see the same symptoms. I did see lots of workarounds for different games doing the same as you've already done using the -screen_hieght & -screen_width overrides. So I'll update the wiki with some extra info for anyone else suffering the same issues.