Jump to content
LaunchBox Community Forums

marquee monitor problem in bigbox


twobucks

Recommended Posts

On 9/20/2020 at 4:19 AM, Mr. RetroLust said:

What if you turn off (uncheck boxes) all windows dpi override settings and only make sure both screens are set to the same dpi percentage < This worked for me in the past to be able to have 4K running plus marquee monitor.

So your answer has the key. What I discovered is Windows 10 sets hard limits on the DPI scaling for low resolution marquee monitors and will ignore the custom DPIs even when you set it. I noticed this when I thought about it more closely. My monitor is the 14.9” LTA149B780F and it supports a native resolution of 1280x390. DPI scaling is grayed out in the settings app with 100% preselected. This is likely a safeguard in Windows 10 so users still access the UI on the secondary display, or else setting a 200% scaling would render the start menu useless on that display. How do I know this? When I attempt to change to a custom scaling setting in the Settings app (it is supposed to apply to both monitors), the size or scale of screen elements do not change on the marquee display. That means Windows is only applying DPI settings to displays it deems large enough to still display its UI. The workaround to this whole mess is ugly: it means setting the DPI for both monitors to 100%. That may not be much of a big deal on a 1080p screen, but it means on my 4K 15.6” tabletop cabinet’s screen, everything becomes an eye exam and next to impossibly hard to read. However, BigBox with its 10-foot interface ignores the DPI settings and works just fine with nice large font. I really wish there was a way to set the DPI settings to switch to 100% scaling but only when I am running BigBox.

  • Like 1
Link to comment
Share on other sites

I found this PowerShell script (link: https://www.reddit.com/r/PowerShell/comments/9ukhye/runezoom_a_simple_script_to_automatically_scale/) and adapted it below. I gave it a whirl but still no dice. :(

 

# VARIABLES

# You can find the registry setting we are targeting in regedit under HKCU\Control Panel\Desktop\PerMonitorSettings
#  
# - This is not in the registry until you have run it at least once already.
# - It defines which monitor are you targeting if there is more than one.
# - In versions of Windows prior to Windows 10, it appears that the DPI value is stored in HKCU:\Control Panel\Desktop with the value LogPixels.
# - Versions of Windows prior to Windows 10 also require a restart.
# - There is useful information here: https://www.reddit.com/r/Batch/comments/4665jq/how_to_change_windows_10_display_scaling_via/d03gt72/
#
# To find the MonitorID for your marquee display, go to Device Manager and under Monitors, right click the Monitor You Want to Change the DPI on.
# Select "Properties" under the dropdown menu. Go the Details tab and under properties, select "Hardware Ids". Note the 7 digit alphanumeric code (e.g.
# ROW00000). You will need this later on.
# Now run regedit and go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\ScaleFactors. Under this section, find the key/folder
# that begins with the same 7-digit alphanumeric code you noted earlier. Copy that entire MonitorID and replace it with the one below.
$MonitorID = "ROW00000_19_07E0_E1^9AEC406B952C6F1BB1AD2DC261E55418"  

# Restart the video driver
function Restart-VideoDriver
{
    param
    (
        [Parameter(Mandatory)][string]$GPUID
    )

    # Enables then disables GPU driver.
    Get-PnpDevice -FriendlyName $GPUID | Disable-PnpDevice -Confirm:$False
    Get-PnpDevice -FriendlyName $GPUID | Enable-PnpDevice -Confirm:$False
}

# Set the DPI scaling
function Set-DPIScaling
{
    param
    (
        [Parameter(Mandatory)][string]$MonitorID,
        [Parameter(Mandatory)][int]$ScalingLevel
    )

    <#
        Scaling levels:

        These change dependent on the screen. My Surface Pro 7's built-in screen has its default or recommended scaling level as 200%.
        0 is the default or recommended setting. Whole number increments correspond with 25% increases in scaling level. In the case of my Surface,
		this would be some of the scaling levels:
		0 = 200%
		1 = 225%
		2 = 250%
		3 = 275%
		4 = 300%

        This article has interesting information on DPI: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-8.1-and-8/dn528846(v=win.10)#Anchor_3
		
		For a standard monitor with a default scaling factor of 100%, this would be some of the scaling levels:
		
        0 = 100%
        1 = 125%
        2 = 150%
        3 = 175%
		4 = 200%

    #>

    Set-ItemProperty -Path "HKCU:Control Panel\Desktop\PerMonitorSettings\$MonitorID" -Name "DpiValue" -Value $ScalingLevel
}

function Get-VideoCard {
    
    $videoDevices = Get-PnpDevice -Class Display

    if ($videoDevices.Count -gt 1) {

        # From my testing, additional GPU's show up first in the object
        return $videoDevices[0].Name

    } else { return $videoDevices.Name }

}

function Main
{
    $GPUID = Get-VideoCard

    # Set scaling to 200%.
    Set-DPIScaling -MonitorID $MonitorID -ScalingLevel 4

    # Restart device driver.
    Restart-VideoDriver -GPUID $GPUID

}

Main

This PowerShell script should work in theory but it does not because of some hard limitation in Windows 10 that prevents increasing the DPI scaling on low resolution monitors (e.g. 1280x390 resolution as in my case).  I changed the MonitorID to match my monitor's, which I found under HardwareIds in the device properties in Device Manager as I describe in the code comments. It still refuses to work. Maybe @Jason Carr might have some ideas.

Edited by Hifihedgehog
Link to comment
Share on other sites

OK. This updated version of the script does the trick! Save it as a .ps1 file (call it BigBox.ps1). It switches the DPI scaling on the primary display to 100%, matching the marquee's 100% setting that Windows 10 vigorously enforces. This does everything you should need to get a marquee to work and will automatically activate and deactivate, enabling the DPI right before launching BigBox and disabling itself after closing BigBox. You will need to modify a few things in line in the script, but it is pretty self explanatory.

# VARIABLES

# You can find the registry setting we are targetting in regedit under HKCU\Control Panel\Desktop\PerMonitorSettings
#  
# - This is not in the registry until you have run it at least once already.
# - It defines which monitor are you targeting if there is more than one.
# - In versions of Windows prior to Windows 10, it appears that the DPI value is stored in HKCU:\Control Panel\Desktop with the value LogPixels.
# - Versions of Windows prior to Windows 10 also require a restart.
# - There is useful information here: https://www.reddit.com/r/Batch/comments/4665jq/how_to_change_windows_10_display_scaling_via/d03gt72/
#
# To find the MonitorID for your primary display, go to Device Manager and under Monitors, right click the Monitor You Want to Change the DPI on.
# Select "Properties" under the dropdown menu. Go the Details tab and under properties, select "Hardware Ids". Note the 7 digit alphanumeric code (e.g.
# ROW00000). You will need this later on.
# Now run regedit and go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\ScaleFactors. Under this section, find the key/folder
# that begins with the same 7-digit alphanumeric code you noted earlier. Copy that entire MonitorID and replace it with the one below.
$MonitorID = "LGD0555268435617_00_07E3_3C^09AE1E606A1EC8EDE92BB1BEA71708CE" 

# Location on your computer of BigBox.exe
$EXEPath = "C:\Users\sonic\LaunchBox\Core\BigBox.exe"

# Restart the video driver
function Restart-VideoDriver
{
    param
    (
        [Parameter(Mandatory)][string]$GPUID
    )

    # Enables then disables GPU driver.
    Get-PnpDevice -FriendlyName $GPUID | Disable-PnpDevice -Confirm:$False
    Get-PnpDevice -FriendlyName $GPUID | Enable-PnpDevice -Confirm:$False
}

# Set the DPI scaling
function Set-DPIScaling
{
    param
    (
        [Parameter(Mandatory)][string]$MonitorID,
        [Parameter(Mandatory)][int]$ScalingLevel
    )

    <#
        Scaling levels:

        These change dependent on the screen. My Surface Pro 7's built-in screen has its default or recommended scaling level as 200%.
        0 is the default or recommended setting. Whole number increments correspond with 25% increases in scaling level. In the case of my Surface,
		this would be some of the scaling levels:
		-4 = 100%
		-3 = 125%
		-2 = 150%
		-1 = 175%
		0 = 200%
		1 = 225%
		2 = 250%
		3 = 275%
		4 = 300%

        This article has interesting information on DPI: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-8.1-and-8/dn528846(v=win.10)#Anchor_3
		
		For a standard monitor with a default scaling factor of 100%, this would be some of the scaling levels:
		
        0 = 100%
        1 = 125%
        2 = 150%
        3 = 175%
		4 = 200%

    #>

    Set-ItemProperty -Path "HKCU:Control Panel\Desktop\PerMonitorSettings\$MonitorID" -Name "DpiValue" -Value $ScalingLevel
}

function Get-VideoCard {
    
    $videoDevices = Get-PnpDevice -Class Display

    if ($videoDevices.Count -gt 1) {

        # From my testing, additional GPU's show up first in the object
        return $videoDevices[0].Name

    } else { return $videoDevices.Name }

}

function Main
{
    $GPUID = Get-VideoCard

    # Set scaling to 100%.
    Set-DPIScaling -MonitorID $MonitorID -ScalingLevel -4

    # Restart device driver.
    Restart-VideoDriver -GPUID $GPUID
	
	# Launch game.
    # Added wait instead of while loop - untested but should work?
    Start-Process -FilePath $EXEPath -ArgumentList "oldschool" -Wait
    Start-Sleep 1

  
    # Wait for game to exit.
    while(Get-Process -Name "BigBox" -ErrorAction SilentlyContinue)
    {
        Start-Sleep 1
    }
  

    # Set scaling to 100%.
    Set-DPIScaling -MonitorID $MonitorID -ScalingLevel 0

    # Restart device driver.
    Restart-VideoDriver -GPUID $GPUID

}

Main

To run this script, you will need to do two things:

1. Open Windows Powershell (admin) and then run the following:

 Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser

...and close PowerShell.

 

2. Create a shortcut by right clicking on the .ps1 file you created (i.e. BigBox.ps1). Right click on that shortcut you now created and select Properties. Go to the Shortcut tab and in the target add the following before file path (be sure to have a trailing space after the "-f"):

powershell.exe -f 

image.thumb.png.b7c5bbd67f7463bfe7380663283f496b.pngNow, go to "Advanced..." and check "Run as administrator." Hit OK there and in the shortcut window because you are all set and ready to go. Incidentally, as a security precaution against malicious PowerShell scripts, Windows will not allow you to check the "Run as administrator" option (it is grayed out for all .ps1 files) unless you previously added the "powershell.exe -f " in the target box.

Try running your script. It should now work!

---

@Jason Carr, if you could somehow decouple the marquee window from the main window in a future release, this would make life so much easier on everyone. Based on what other devs are telling me, because BigBox's application windows (main and marquee) are tied to a single executable, Windows applies DPI to both unilaterally. If the marquee and the primary display have different DPI settings, the marquee window gets stuck on the primary display. Some marquee monitors have especially low resolutions (e.g. 1280x390 is commonplace) so changing the scaling on the marquee (ideal) isn't possible because Windows forcibly hard sets them to 100%. This forces you to change the primary display's scaling to 100%. This is absolutely undesirable especially with high resolution 4K displays becoming the norm because that means dealing with reading teeny tiny text on your display. That said, this PowerScript script above overcomes this issue in the interim by allowing users to only switch the DPI for their primary display when running BigBox via this script, thereby avoiding to have to strain their eyes to read a miniaturized UI. For Kodi users who use the Launchbox plugin to launch BigBox, this script workaround is a non-option, of course, making this issue all the more important to be attended to.

Edited by Hifihedgehog
Link to comment
Share on other sites

  • 2 weeks later...

@Hifihedgehog Unfortunately separating the marquee window out into a completely separate process isn't really feasible (we'd end up doubling the memory requirements, performance would suffer, etc.), and it'd be way too tricky to do all the communication between the two processes. There are solutions out there, though (they're just horribly documented by Microsoft and terribly confusing lol). It's on my list.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hello, so is this solution still working after couple of week ?  I have the same issue.  Well, just to make sure we talk about same thing...

My situation : All MAME only lightgun working well with multiple screen.  But this is not the case with M2 emulator.  The calibration horozontal ratio is wrong, he calculate the position by adding main x resolution + x resolution marquee screen.

The only solution found so far is to close my marquee when player those game.  And this laid to a second issue for me, since when i close marquee screen, because it is a special custom resolution., i need to recreate it.  But this is my main issue with nvidia old graphic card.

So, first, is your fix work and are you in the same pattern issue as me ?

 

Link to comment
Share on other sites

  • 1 month later...

Are there any new ways to fix this issue?  I've tried everything from different cables, GPU's, PC's, DPI settings to no avail.  Wen trying to have the marquee shown on the 14.9 stretch LCD It just shows the marquee screen minimized.  if I set it to display the marquee on my other 27" 1080P it works fine.  Just don't understand it.  

 

MFPezKI.jpg

Edited by castortroy45
Link to comment
Share on other sites

18 minutes ago, castortroy45 said:

Are there any new ways to fix this issue?  I've tried everything from different cables, GPU's, PC's, DPI settings to no avail.  Wen trying to have the marquee shown on the 14.9 stretch LCD It just shows the marquee screen minimized.  if I set it to display the marquee on my other 27" 1080P it works fine.  Just don't understand it.  

 

MFPezKI.jpg

Be sure that both screens are set to the same windows dpi text scaling, this worked for me in the same situation.

Link to comment
Share on other sites

  • 3 months later...

I recently installed LB & BB, have a 2nd monitor i'm using as an lcd marquee.  For some reason Bigbox has my screen 1 and screen 2 backwards.  Anyway all games and marquee work fine except for Arcade/Mame.  When I play a game, the game is in the top marquee and the main screen just shows the game info.  If I launch a game with mame_libretro the screens work fine, marquee ontop and game on main screen.  Anyone can help me figure out why just mame does this?  Again every other platform works fine as well.

Link to comment
Share on other sites

On 3/24/2021 at 6:37 PM, ddox said:

I recently installed LB & BB, have a 2nd monitor i'm using as an lcd marquee.  For some reason Bigbox has my screen 1 and screen 2 backwards.  Anyway all games and marquee work fine except for Arcade/Mame.  When I play a game, the game is in the top marquee and the main screen just shows the game info.  If I launch a game with mame_libretro the screens work fine, marquee ontop and game on main screen.  Anyone can help me figure out why just mame does this?  Again every other platform works fine as well.

Very late reply, but make sure you mark your main monitor as the primary monitor in the Windows display settings. Most likely, that should fix any issues like this.

  • Like 1
Link to comment
Share on other sites

Yes my  main monitor is set to primary and is #1, the marquee is #2.  In BB options when I choose monitor 1 in any settings it uses the marquee, if I choose monitor 2 it uses the main monitor.  Even with them set that way all emulators work perfectly fine except Mame.  If I just start a game, If I choose Run With->Retroarch->mame_libretro, they monitors work fine.  But mame_libretro doesn't set all my controls properly and doesn't use my trackball and spinner like mame does.

Link to comment
Share on other sites

2 hours ago, ddox said:

Yes my  main monitor is set to primary and is #1, the marquee is #2.  In BB options when I choose monitor 1 in any settings it uses the marquee, if I choose monitor 2 it uses the main monitor.  Even with them set that way all emulators work perfectly fine except Mame.  If I just start a game, If I choose Run With->Retroarch->mame_libretro, they monitors work fine.  But mame_libretro doesn't set all my controls properly and doesn't use my trackball and spinner like mame does.

Weird. Idk, all I can figure is that maybe MAME has a setting you can change to tell it which monitor to use?

Link to comment
Share on other sites

  • 1 year later...

Hi guys I have a question which seems related to this topic.  To be able to play Outrun 2 via teknoparrot I had to set the DPI of my primary screen (4K screen) to 100% (from 150%).  Otherwise the image was blown up.  But what I noticed now is that with that DPI set to 100%, my marquee screen in big box isn't working.  I just see the desktop on that 2nd screen which is a 2560 x 1080 by the way.  I switched the DPI of primary screen back to 150% and marquee was working again.  

Can anyone point me in the right direction please?  Obviously I'd like to keep the DPI of primary screen to 100%.  Thanks

Link to comment
Share on other sites

7 hours ago, Morris Schaffer said:

Hi guys I have a question which seems related to this topic.  To be able to play Outrun 2 via teknoparrot I had to set the DPI of my primary screen (4K screen) to 100% (from 150%).  Otherwise the image was blown up.  But what I noticed now is that with that DPI set to 100%, my marquee screen in big box isn't working.  I just see the desktop on that 2nd screen which is a 2560 x 1080 by the way.  I switched the DPI of primary screen back to 150% and marquee was working again.  

Can anyone point me in the right direction please?  Obviously I'd like to keep the DPI of primary screen to 100%.  Thanks

Most likely you just need to play with the Windows screen positioning settings. Go to your Display settings and try dragging the screens around to different spots. That should fix the issue if you find the right spot for the screens.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...