[SOLVED] Setting Resolution at boot for live usb environment

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
ugly
Level 5
Level 5
Posts: 592
Joined: Thu Nov 24, 2016 9:17 pm

[SOLVED] Setting Resolution at boot for live usb environment

Post by ugly »

I have a Kaby Lake microPC that I use as an HTPC. I connect it to a 4K TV.

The issue is that there are two 4K resolution options available for the TV. By default, Linux Mint selects a resolution that is out of range for the TV. So when I boot from a live USB (or on a clean install) everything will boot, but my TV will just show 'No Signal'. The TV will work fine if I can select the other 4K option, or 1920x1080 (I usually just run it at 1920x1080). But I can't set the resolution because I can't see anything.

My usual workaround is just to hook up a monitor to install, set up SSH and then connect it to the TV, SSH from another computer and set the resolution to 1920x1080. After that one-time setup everything works. But it's a bit inconvenient. I'd like to be able to just install things when connected to the TV.

When I boot from a USB, I can see the grub menu to select the live environment. Is there any way I can set the resolution at that point so that the live USB will boot to 1920x1080?

Edit - For the solution see This post in this thread
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
SMG
Level 25
Level 25
Posts: 31914
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Setting Resolution at boot for live usb environment

Post by SMG »

ugly wrote: Sun Oct 17, 2021 6:34 pmBy default, Linux Mint selects a resolution that is out of range for the TV.
Normally, the resolution selected is a combination of the graphics driver and how that driver recognizes the screens attached to it. There is not a specific "default" value that Mint selects. The graphics driver has to be installed and X Server running so xrandr sets the resolution. That happens after the operating system starts.
ugly wrote: Sun Oct 17, 2021 6:34 pmMy usual workaround is just to hook up a monitor to install, set up SSH and then connect it to the TV, SSH from another computer and set the resolution to 1920x1080. After that one-time setup everything works. But it's a bit inconvenient. I'd like to be able to just install things when connected to the TV.
If you install Mint on the computer, you would only be doing this once and saving the resolution. Then on subsequent boots it should automatically go to the saved resolution.

If, for some reason, you can not install Mint on the microPC, you could install Mint to a usb stick--not as an ISO but as a complete Mint install. There is a tutorial posted on the forum to do that. Then you would set up your SSH, get in the one time to save the resolution to the usb stick.

What is the scenario that you would have to keep booting from a live usb? I did not understand how this would be a repeating situation with the same PC and TV so I wasn't sure what might be the most appropriate solution to suggest.

Are you connecting the TV to the computer with HDMI?
Image
A woman typing on a laptop with LM20.3 Cinnamon.
User avatar
ugly
Level 5
Level 5
Posts: 592
Joined: Thu Nov 24, 2016 9:17 pm

Re: Setting Resolution at boot for live usb environment

Post by ugly »

SMG wrote: Tue Oct 19, 2021 10:06 pm Normally, the resolution selected is a combination of the graphics driver and how that driver recognizes the screens attached to it. There is not a specific "default" value that Mint selects. The graphics driver has to be installed and X Server running so xrandr sets the resolution. That happens after the operating system starts.
Thanks for the response.

When I first started using the MicroPC and connected it to the same TV it worked without the out of range issue. Then about two years ago the out or range issue started. Unfortunately, I forget exactly when, but I think it was when upgrading from Mint 18 to 19 because it would have been on a clean install.
SMG wrote: Tue Oct 19, 2021 10:06 pm If you install Mint on the computer, you would only be doing this once and saving the resolution. Then on subsequent boots it should automatically go to the saved resolution.

If, for some reason, you can not install Mint on the microPC, you could install Mint to a usb stick--not as an ISO but as a complete Mint install. There is a tutorial posted on the forum to do that. Then you would set up your SSH, get in the one time to save the resolution to the usb stick.

What is the scenario that you would have to keep booting from a live usb? I did not understand how this would be a repeating situation with the same PC and TV so I wasn't sure what might be the most appropriate solution to suggest.
Sorry, if I wasn't clear. It's not a problem that I continually run into. It's basically an issue that pops up once a year (doing a clean install, wanting to test something in a live environment, try another distro, doing a Timeshift restore from a live environment if something really gets messed up, etc.). You're right, it's mainly a one-time setup, and I do have the workaround for it.

But, for example, I just picked up a new SSD and I was thinking of doing a clean install. I can unhook everything and bring the PC to my monitor, but it's a bit of a pain to feed the wiring through my home theatre setup. This just seems like a big pitfall that there should be a more straightforward solution to. If I didn't have access to extra hardware, I'd be stuck.
SMG wrote: Tue Oct 19, 2021 10:06 pm Are you connecting the TV to the computer with HDMI?
Yes HDMI to HDMI.
User avatar
SMG
Level 25
Level 25
Posts: 31914
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Setting Resolution at boot for live usb environment

Post by SMG »

ugly wrote: Wed Oct 20, 2021 3:39 amWhen I first started using the MicroPC and connected it to the same TV it worked without the out of range issue. Then about two years ago the out or range issue started. Unfortunately, I forget exactly when, but I think it was when upgrading from Mint 18 to 19 because it would have been on a clean install.
Let's get some data on your hardware. What is the output of inxi -SMGCx and xrandr and what is the make and model of the TV?
ugly wrote: Wed Oct 20, 2021 3:39 amThis just seems like a big pitfall that there should be a more straightforward solution to.
Are there any setting changes you can make to your TV so this does not happen (or maybe a different port you could use)?

Also, are you unable to get a screen if you boot in compatibility/recovery mode?
Image
A woman typing on a laptop with LM20.3 Cinnamon.
User avatar
ugly
Level 5
Level 5
Posts: 592
Joined: Thu Nov 24, 2016 9:17 pm

Re: Setting Resolution at boot for live usb environment

Post by ugly »

SMG wrote: Wed Oct 20, 2021 3:14 pm Let's get some data on your hardware. What is the output of inxi -SMGCx and xrandr and what is the make and model of the TV?
The TV is a Vizio M60-C3. I believe this is the link to the product page: https://support.vizio.com/s/article/M60 ... uage=en_US

From inxi -SMGCx --display

Code: Select all

System:
  Host: media-ZBOX-CI527 Kernel: 5.11.0-37-generic x86_64 bits: 64 
  compiler: N/A Desktop: Cinnamon 5.0.6 Distro: Linux Mint 20.2 Uma 
  base: Ubuntu 20.04 focal 
Machine:
  Type: Laptop Mobo: ZOTAC model: ZBOX-CI527/CI547NANO v: XX 
  serial: <superuser/root required> UEFI: American Megatrends v: B331P208 
  date: 06/26/2018 
CPU:
  Topology: Dual Core model: Intel Core i3-7100U bits: 64 type: MT MCP 
  arch: Amber Lake rev: 9 L2 cache: 3072 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 19200 
  Speed: 666 MHz min/max: 400/2400 MHz Core speeds (MHz): 1: 666 2: 2147 
  3: 1504 4: 724 
Graphics:
  Device-1: Intel HD Graphics 620 driver: i915 v: kernel bus ID: 00:02.0 
  Display: server: X.Org 1.20.11 driver: modesetting 
  resolution: 1920x1080~60Hz 
  OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) 
  v: 4.6 Mesa 21.2.4 - kisak-mesa PPA direct render: Yes 
From xrandr:

Code: Select all

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
DP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 1330mm x 750mm
   3840x2160     30.00 +  25.00    24.00    29.97    23.98  
   4096x2160     24.00    23.98  
   1920x1080     60.00*   60.00    59.94    24.00    23.98  
   1920x1080i    60.00    59.94  
   1280x720      60.00    59.94  
   720x480       60.00    59.94  
   640x480       60.00    59.94  
DP-2 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
The 3840x2160 is the "Recommended" resolution in the Mint settings and is the one that causes the issue.
SMG wrote: Wed Oct 20, 2021 3:14 pm Are there any setting changes you can make to your TV so this does not happen (or maybe a different port you could use)?

Also, are you unable to get a screen if you boot in compatibility/recovery mode?
I tried a different port with an easily accessible cable and it did the same thing. I'm not sure if I tried every single port (unfortunately, this would likely take a bit of re-routing cables).

I should also mention that this is not an Linux Mint issue. I tried a recent Manjaro live USB and it does the same thing.

I tried the compatibilty mode and it does seem to work at 1024x768. I could have sworn I checked that before and it didn't work. But that might be a viable solution.

Compatibility mode might be sufficient to resolve the issue. I don't know the details of compatibility mode. But I should be able to the install, then at least get as far as SSH to correct things from there. Not the best solution, but better than unplugging everything.
User avatar
SMG
Level 25
Level 25
Posts: 31914
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Setting Resolution at boot for live usb environment

Post by SMG »

ugly wrote: Thu Oct 21, 2021 6:52 pmThe TV is a Vizio M60-C3. I believe this is the link to the product page: https://support.vizio.com/s/article/M60 ... uage=en_US
I've worked with one other person with a Vizio (Vizio M65-E0) and they were having issues with LM20 versus what had happened with LM19. It was also a 'no signal' problem and the user decided to just leave the system on LM19. The same exact resolution which did not work on that person's Vizio did work on their computer monitor when attaching the miniPC to the monitor.

Oddly enough, that computer also indicated the HDMI connection was DP (just like is showing with yours) even though it was a different computer. I've pulled out two resolutions from your xrandr so you can see + = preferred resolution of the monitor, while * = current resolution.

Code: Select all

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
DP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 1330mm x 750mm
   3840x2160     30.00 +  25.00    24.00    29.97    23.98  
   1920x1080     60.00*   60.00    59.94    24.00    23.98  
The operating system is going to do its best to use the preferred resolution of the monitor. That is why it is listed as "Recommended" and why Mint and Manjaro are using it as the default.
ugly wrote: Thu Oct 21, 2021 6:52 pm I tried a different port with an easily accessible cable and it did the same thing. I'm not sure if I tried every single port (unfortunately, this would likely take a bit of re-routing cables).
The M60-C3 Manual does have some diagrams and I can see there are five HDMI options, but they are not all the same capabilities. It might not make any difference in relation to this issue.
ugly wrote: Thu Oct 21, 2021 6:52 pmI tried the compatibilty mode and it does seem to work at 1024x768. I could have sworn I checked that before and it didn't work. But that might be a viable solution.
While you can install in compatibility mode, and then you could boot in Recovery Mode (which would use nomodeset and should give the same visuals as compatibility mode), I do not think it will let you change the resolution in recovery mode. I believe the graphics driver needs to be installed to change the resolution.

But if getting it installed is the major hurdle and you could SSH in afterwards, then you could boot normally on the installed version and the driver would be loaded so you could change resolutions.

Normally, we are trying to get the monitor to use the preferred resolution, so a situation where the preferred does not work and is not desired is one I'm not used to addressing.

Edited to add missing word.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
User avatar
SMG
Level 25
Level 25
Posts: 31914
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Setting Resolution at boot for live usb environment

Post by SMG »

ugly wrote: Thu Oct 21, 2021 6:52 pmI tried the compatibilty mode and it does seem to work at 1024x768. I could have sworn I checked that before and it didn't work. But that might be a viable solution.

Compatibility mode might be sufficient to resolve the issue. I don't know the details of compatibility mode. But I should be able to the install, then at least get as far as SSH to correct things from there. Not the best solution, but better than unplugging everything.
I helped someone over the past few days that was getting an out-of-range message while booting the usb. Turns out their monitor was not relaying EDID information to the system which seems like it may be a slightly different issue that what you had, but it reminded me enough of your situation that I figured I'd pass along what worked in that case in the slight chance it might help your situation.

We added a kernel parameter with the EDID information during the system boot. This can be done both for the live session and for an installed version of Mint, but the directions are slightly different.

If you want to see if the kernel parameter would work on the installation usb, the directions on this page explain how to replace quiet splash with nomodeset when booting the usb. Instead of adding nomodeset you would add drm_kms_helper.edid_firmware=edid/1920x1080.bin.

If that does work, you can use the following information How to add a kernel parameter to temporarily add the drm_kms_helper.edid_firmware=edid/1920x1080.bin parameter so it works for the first boot cycle where you can hopefully permanently save that resolution in the Display app. If the parameter does not work and something goes wonky, all you'll need to do is reboot to clear it.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
User avatar
ugly
Level 5
Level 5
Posts: 592
Joined: Thu Nov 24, 2016 9:17 pm

Re: Setting Resolution at boot for live usb environment

Post by ugly »

SMG wrote: Thu Nov 25, 2021 8:38 pm I helped someone over the past few days that was getting an out-of-range message while booting the usb. Turns out their monitor was not relaying EDID information to the system which seems like it may be a slightly different issue that what you had, but it reminded me enough of your situation that I figured I'd pass along what worked in that case in the slight chance it might help your situation.

We added a kernel parameter with the EDID information during the system boot. This can be done both for the live session and for an installed version of Mint, but the directions are slightly different.

If you want to see if the kernel parameter would work on the installation usb, the directions on this page explain how to replace quiet splash with nomodeset when booting the usb. Instead of adding nomodeset you would add drm_kms_helper.edid_firmware=edid/1920x1080.bin.

If that does work, you can use the following information How to add a kernel parameter to temporarily add the drm_kms_helper.edid_firmware=edid/1920x1080.bin parameter so it works for the first boot cycle where you can hopefully permanently save that resolution in the Display app. If the parameter does not work and something goes wonky, all you'll need to do is reboot to clear it.
Thanks for circling back on this. That is the exact type of solution I was hoping for.

As an aside, I did manage to follow your previous advice using the compatibility mode to get it installed and running and get as far as using SSH to change the resolution. So that was a good workaround.

I did your test with drm_kms_helper.edid_firmware=edid/1920x1080.bin on a live USB. It worked. I was able to boot into the live environment at 1920x1080 following those instructions. Since I already have it installed from the previous workaround, I did not test after a clean install, but the process seems similar.

Thanks again, I'll mark this as solved.
User avatar
SMG
Level 25
Level 25
Posts: 31914
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Setting Resolution at boot for live usb environment

Post by SMG »

ugly wrote: Fri Nov 26, 2021 5:02 pmI did your test with drm_kms_helper.edid_firmware=edid/1920x1080.bin on a live USB. It worked. I was able to boot into the live environment at 1920x1080 following those instructions. Since I already have it installed from the previous workaround, I did not test after a clean install, but the process seems similar.

Thanks again, I'll mark this as solved.
Your situation had enough differences that I wasn't sure it would work so I appreciate you testing it and letting us know it did work. That may help others in the future.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
User avatar
ugly
Level 5
Level 5
Posts: 592
Joined: Thu Nov 24, 2016 9:17 pm

Re: Setting Resolution at boot for live usb environment

Post by ugly »

SMG wrote: Fri Nov 26, 2021 6:32 pm
ugly wrote: Fri Nov 26, 2021 5:02 pmI did your test with drm_kms_helper.edid_firmware=edid/1920x1080.bin on a live USB. It worked. I was able to boot into the live environment at 1920x1080 following those instructions. Since I already have it installed from the previous workaround, I did not test after a clean install, but the process seems similar.

Thanks again, I'll mark this as solved.
Your situation had enough differences that I wasn't sure it would work so I appreciate you testing it and letting us know it did work. That may help others in the future.
Since I had the day off, I did decide to test after a clean install. Unfortunately, the fix wasn't permanent.

With the instructions you provided, I was able to add the kernel parameter and run the clean install with the 1920x1080 resolution (worked just as well as the live USB environment). The only problem is that I was unable to keep that resolution without the parameter.

When I go to the Cinnamon settings with drm_kms_helper.edid_firmware=edid/1920x1080.bin, there were no options for changing the resolution. Only 1920x1080 was available.

So, when I rebooted without drm_kms_helper.edid_firmware=edid/1920x1080.bin, then it defaulted back to the out of range resolution. I was not able to keep the 1920x1080 setting from when drm_kms_helper.edid_firmware=edid/1920x1080.bin was set.

Could I just add drm_kms_helper.edid_firmware=edid/1920x1080.bin to grub? I assume I wouldn't be able to change resolutions, but I don't plan to. If it would just always be 1920x1080, then that would work fine.
User avatar
SMG
Level 25
Level 25
Posts: 31914
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Setting Resolution at boot for live usb environment

Post by SMG »

ugly wrote: Fri Nov 26, 2021 8:20 pmWhen I go to the Cinnamon settings with drm_kms_helper.edid_firmware=edid/1920x1080.bin, there were no options for changing the resolution. Only 1920x1080 was available.
I thought that was the resolution you were using and you would be going in the first time to save that resolution in the Display app so it would be used on subsequent boots. I thought that was what you were doing when you SSH'd in. Were you not given the option to click Apply for that 1920x1080 resolution in the Display app?

I thought you could save that resolution so on the next boot it would be at that resolution and you would get the rest of the options your screen should have because the kernel parameter would not be blocking them from loading. However, that is a guess on my part.

It's my understanding that kernel parameter setting is getting loaded before the kernel sets up so there are not other options available.
ugly wrote: Fri Nov 26, 2021 8:20 pmCould I just add drm_kms_helper.edid_firmware=edid/1920x1080.bin to grub? I assume I wouldn't be able to change resolutions, but I don't plan to. If it would just always be 1920x1080, then that would work fine.
Yes, you could do that. The link How to add a kernel parameter gives instructions both for making the parameter temporary and permanent.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
User avatar
ugly
Level 5
Level 5
Posts: 592
Joined: Thu Nov 24, 2016 9:17 pm

Re: Setting Resolution at boot for live usb environment

Post by ugly »

SMG wrote: Fri Nov 26, 2021 8:40 pm I thought that was the resolution you were using and you would be going in the first time to save that resolution in the Display app so it would be used on subsequent boots. I thought that was what you were doing when you SSH'd in. Were you not given the option to click Apply for that 1920x1080 resolution in the Display app?

I thought you could save that resolution so on the next boot it would be at that resolution and you would get the rest of the options your screen should have because the kernel parameter would not be blocking them from loading. However, that is a guess on my part.

It's my understanding that kernel parameter setting is getting loaded before the kernel sets up so there are not other options available.
To clarify, booting to a clean install using the parameter does successfully boot at 1920x1080. Since the 1920x1080 is already applied with the kernel parameter, in the Cinnamon Display settings, there is nothing more to apply. The issue is that the 1920x1080 resolution is not saved on subsequent reboots without the kernel parameter.

Just to provide additional information this is the xrnadr output without the kernel parameter:

Code: Select all

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
DP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 1330mm x 750mm
   3840x2160     30.00 +  25.00    24.00    29.97    23.98  
   4096x2160     24.00    23.98  
   1920x1080     60.00*   60.00    59.94    24.00    23.98  
   1920x1080i    60.00    59.94  
   1280x800      59.91  
   1280x720      60.00    59.94  
   1024x768      75.03    70.07    60.00  
   800x600       72.19    75.00    60.32  
   720x480       60.00    59.94  
   640x480       75.00    60.00    59.94  
   720x400       70.08  
DP-2 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
And these are the options in the Cinnamon Display settings:
Screenshot from 2021-11-28 16-43-45.png
And this is the output of xrandr with the kernel parameter:

Code: Select all

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
DP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 500mm x 281mm
   1920x1080     60.00*+
DP-2 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
And these are the options in the Cinnamon Display settings:
Screenshot from 2021-11-28 16-49-14.png
Maybe the reason the selection of 1920x1080 does not survive the reboot without the kernel parameter is because it appears as a different monitor.

In the screenshots, without the parameter, the monitor is listed as VIZIO, Inc 60" (and in xrandr as DP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 1330mm x 750mm

And with the parameter, the monitor is listed as LNX 23" (and in xrandr as DP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 500mm x 281mm
User avatar
SMG
Level 25
Level 25
Posts: 31914
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Setting Resolution at boot for live usb environment

Post by SMG »

ugly wrote: Sun Nov 28, 2021 6:25 pmTo clarify, booting to a clean install using the parameter does successfully boot at 1920x1080. Since the 1920x1080 is already applied with the kernel parameter, in the Cinnamon Display settings, there is nothing more to apply. The issue is that the 1920x1080 resolution is not saved on subsequent reboots without the kernel parameter.
Unless you click "Apply", there would be no reason it would be saved. When one clicks "Apply", the cinnamon-monitors.xml file is created and saved. If that file does not exist, the system essentially reads on the fly what is connected and thus what resolution to use.

However, I did not realize the system might show a different vendor when using the kernel parameter. I just checked my cinnamon-monitors.xml file (which I had saved a while ago while testing the Apply button :mrgreen: ) and I see it does list the vendor (manufacturer) and serial number. That probably means even if you had clicked the Apply button that the correct resolution would not have come up because the vendors would be different.

When you use the kernel parameter, that tells the system to use a specific file which is included in a Mint install. Apparently that file precludes the system from picking up specifics from the hardware. I learn something new all the time.

However, another possible workaround is to copy the ~/.config/cinnamon-monitors.xml file, which is saved after you SSH'd in and set up the Display app and clicked Apply, and then use that file in a new installation. You could boot using the kernel parameter so you can see. Transfer a copy of that file from an old install into the new one and then it should work. On the next boot the system will see the cinnamon-monitors.xml file and use it. Since it would be from your previous install using the Vizio, it should work.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
Locked

Return to “Graphics Cards & Monitors”