Decorum for the Forum:
  • Be nice. If you want to be mean, try Reddit.
  • No Piracy. If you want to be a thief, there are dark places on the internet dedicated to that.
  • No Cracking. Discussions on AnyDVD, DeUHD, DVDFab, UHDKeys and similar tools are not permitted here.
  • No Spamming. If you want to make a buck, work smarter... somewhere else.
  • No Adult Content. Half the internet is dedicated to adult content. This half isn't.

Privacy Policy: Click Here to Review (updated September 30, 2020)

[Fixed in v3.2] Black band issue at the top of CMC

General support forum for Chameleon MediaCenter (formerly MM Browser)
Manni
Posts: 593
Joined: Wed May 22, 2019 5:27 am

Re: Black band issue at the top of CMC

Post by Manni » Thu Jan 02, 2020 5:28 pm

I did one more test beside the above, I tried to change the DPI in windows to see the results (the first screenshot was taken at 200%).

If I set the DPI to 100%, I get a much smaller GUI for CMC.

I took a picture with the lights on to show what it looks like (I have a 16/9 screen):
IMG_6081.jpg
IMG_6081.jpg (1.62 MiB) Viewed 8161 times
If I set it to 225%, it's too big and goes beyond the screen.

So it looks like it's a CMC scaling issue. 200% gives the least wrong result, with just the top black bar and missing bottom part (first screenshot).

CMC is the only app doing this after using remote desktop, at least I haven't seen others having such issues.

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Black band issue at the top of CMC

Post by Pauven » Thu Jan 02, 2020 5:37 pm

I think the issue is related, just not in the way you might be thinking. I agree that this is a very unique CMC issue.

There are many broadcast Windows messages (and by many, I mean thousands upon thousands) that are going around your entire Windows system all the time. CMC listens to a few of these messages to react to them, including media buttons being pressed (Play, Fast Forward, etc.), DVD discs being inserted, and DPI changes.

When a DPI change is detected, then CMC runs through the scaling logic to auto-adjust to the new change. And if the #'s that CMC is working with are wrong, you will get the wrong scaling and/or window position.

What I know is happening on my 3 monitor setup is that when resuming from sleep the resolutions and DPI values jump around as the connections are re-established. CMC sees the DPI change, and does it's internal logic to scale and reposition the window, and the result is bad because the displays were still renegotiating their resolution and DPI settings with Windows and the display driver.

What I don't understand is why it then gets stuck there. It'd be one thing if it was a temporary hiccup, but it stays in the wrong position even after the displays have finished negotiating their settings with the video card. Like you, my only solution has been to restart CMC, then all is fine. But I would expect that these multiple display changes would trigger one more pass through my code to give it a chance to fix itself.

In my head, this is very similar if not exactly the same thing you are experiencing. You are connected via RDP, which establishes virtual display settings, start CMC which is using those settings, then disconnect from RDP giving desktop control back to the main HTPC. This handback causes the HTPC to renegotiate display settings - it might happen to fast to see, but it is happening, sending out a DPI changed message - and CMC sees the DPI change and adjusts the scaling and position which ends up wrong.

Now that I have a use other than myself with this issue, I'll put some focus on fixing it.

Note that I first added this code for a user who often had the window positions change on him after resuming from sleep, and this function actually fixed it. Ironically it seems to be doing the opposite for you in this scenario.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Black band issue at the top of CMC

Post by Pauven » Thu Jan 02, 2020 5:44 pm

Manni wrote: Thu Jan 02, 2020 5:28 pm I did one more test beside the above, I tried to change the DPI in windows to see the results (the first screenshot was taken at 200%).

If I set the DPI to 100%, I get a much smaller GUI for CMC.

I took a picture with the lights on to show what it looks like (I have a 16/9 screen):

IMG_6081.jpg

If I set it to 225%, it's too big and goes beyond the screen.

So it looks like it's a CMC scaling issue. 200% gives the least wrong result, with just the top black bar and missing bottom part (first screenshot).

CMC is the only app doing this after using remote desktop, at least I haven't seen others having such issues.

Your scaling tests might not have had the desired result if you didn't restart windows in-between. CMC looks at your screen resolution and DPI to automatically fill the full screen (without clipping), scaling the image and positioning the window.

What you demonstrated looks like you changed scaling without restarting Windows, but I'm not sure. CMC might get confused and produce the wrong result in this scenario.

I use 150% scaling on my 4k monitors and it's fine. There's no requirement to use 200%.

EDIT: And the original issue you presented is not technically scaling, but rather window positioning. CMC thinks the screen is taller and is shifting the window down to center it. So while you found a way to trigger some scaling issues by manually adjusting the DPI, that's not necessary the exact same issue.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

Manni
Posts: 593
Joined: Wed May 22, 2019 5:27 am

Re: Black band issue at the top of CMC

Post by Manni » Thu Jan 02, 2020 6:15 pm

Yes, I had rebooted after the DPI change.

However, I noticed that if I leave a bit of time, CMC rescales, so deals with the wrong DPI, however I still have the black bar.

So you are correct that this is NOT a DPI issue but a wrong scaling/shifting issue. :)

By the way, I know that you don't have to use 200%, but that's what allows me to see the interface on my 88" diag screen when sitting 2-3 meters away from it :)

Note that I can reproduce this 100% when I go directly from remote desktop with CMC correctly displayed to logging to the HTPC (hence terminating the remote desktop session), but I can also have this issue when I start CMC from the HTPC after ending the RD session, provided an earlier RD session had taken place.

I don't have the issue if I haven't used RD in that same session.

Are you able to reproduce the issue with remote desktop?

1) RD into the PC where CMC is installed (this will log you out of that PC)
2) Launch CMC in the RD session. It should display properly (no black bar).
3) Log into to the CMC PC (this will terminate your RD session). There should be black bars.

This is assuming that both the PC running the RD session and the CMC PC are using a 4K monitor/display configured in UHD resolution (3840x2160).

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Black band issue at the top of CMC

Post by Pauven » Thu Jan 02, 2020 7:14 pm

Manni wrote: Thu Jan 02, 2020 6:15 pm Are you able to reproduce the issue with remote desktop?

1) RD into the PC where CMC is installed (this will log you out of that PC)
2) Launch CMC in the RD session. It should display properly (no black bar).
3) Log into to the CMC PC (this will terminate your RD session). There should be black bars.

This is assuming that both the PC running the RD session and the CMC PC are using a 4K monitor/display configured in UHD resolution (3840x2160).

At the moment I am not able to recreate this exact scenario. All of my 4k monitors are on the same PC. I do have another PC set up with a 1920x1200 screen that I will do some RDP testing into, and perhaps it will experience the same type of issue. It may be a few days before I can get to this testing. Hopefully my test setup will reproduce the issue, otherwise I'll have to move some hardware around and it might be a few weeks before I can get to that.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Black band issue at the top of CMC

Post by Pauven » Thu Jan 02, 2020 7:27 pm

Okay, I couldn't wait and did a bit of testing with my setup.

Note that the desktop I'm remoting into has the 1920x1200 screen, so I naturally get the black bars on top and bottom as designed. The RDP session is from my workstation with the 3840x2160 monitors using full screen, so I am getting resolution and dpi changes when I RDP into the other PC.

I was somewhat able to recreate this issue. I can't say it is the same, since I have different aspect ratios on these two screens, but it does appear that while scaling was fixed when RDP'ing into the PC, the window position was not, leaving a black bar at the top only and the bottom cropped.

I tested this with CMC v3.0, so I got some DPI.txt logging, but it only logged during CMC startup, and didn't log anything during RDP connection/disconnection when the rescaling is occurring. I'll have to add some extra logging in the code so I can see what is going on here.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

Manni
Posts: 593
Joined: Wed May 22, 2019 5:27 am

Re: Black band issue at the top of CMC

Post by Manni » Thu Jan 02, 2020 7:48 pm

I might understand it wrong, but it might be more conclusive if you run the RD session from the 1900x1200 PC, into the PC with CMC and the 4K monitor. That way, even if CMC doesn't look right during the session, it should look right when the session is terminated. If it isn't, then you'll have reproduced the issue. The resolution from the PC your run the RD session isn't really relevant, the ratio should be correct on the PC running CMC once the session is terminated.

Hopefully the extra logging will help. Once you have it, please let me know if you want me to run it here.

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Black band issue at the top of CMC

Post by Pauven » Wed Jan 08, 2020 6:14 pm

I'm very happy to report that I believe I have fixed this issue. There were actually 3 issues that I had to address.

1) The code was skipping the step of repositioning the window on a 16:9 screen. While this sounds okay, the problem was that a temporary incorrect screen size change to something other than 16:9 would shift the GUI down, but the following correction back to a 16:9 ratio would not reposition the GUI to the home position, leaving the black bar.

2) When connecting via RDP and then disconnecting, the screen size reported (by Windows) to CMC was wrong wrong wrong (all kinds of wrong). I struggled with this one for a while, and finally found a way to force the info to update itself and provide the correct numbers.

3) When DPI changes occurred, my code was too fast, finishing the scaling change before Windows had really finished adapting to the new screen parameters. This was easily solved by adding a short delay at the beginning of my scaling algorithm, so now Windows has finished adapting to the screen change before my code takes action.

Altogether, the 3 fixes have addressed the scaling issues when connecting/disconnecting via RDP. I'm not yet ready to release a beta of the next version, but this should be soon.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

Manni
Posts: 593
Joined: Wed May 22, 2019 5:27 am

Re: [Retest in v3.2] Black band issue at the top of CMC

Post by Manni » Wed Jan 08, 2020 6:46 pm

Fantastic news, thanks!

Does that also solve your multi-monitor issue, or was it unrelated?

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: [Retest in v3.2] Black band issue at the top of CMC

Post by Pauven » Wed Jan 08, 2020 6:52 pm

Not sure if it fixes my multi-mon issue. One of the (way too many) driver issues I have with my Radeon is that after a while the displays stop sleeping, and I have to reboot to fix. My issue only crops up after the displays sleep (but not a system sleep), so I'm gonna have to reboot someday to test it. I so rarely reboot (cause it's a PitA, right?!) so I can't test that issue for now.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

Post Reply