Solved Kodi starts on the wrong display
#16
(2020-01-03, 08:44)ThumbOne Wrote:
(2019-12-18, 14:41)xbmcuser01 Wrote:
(2019-12-18, 10:59)ThumbOne Wrote: I have exactly the same question and issue. On Mint 19.2 Cinnamon. Can you elucidate where system - settings - video output is found?  
In Kodi.    
Not helpful I'm afraid. Is this a skin issue? I am using a skin that has no system top menu for example. Perhaps that's why I can't see it? Maybe share a screen shot?   
Never use a skin that excludes the Settings Menu. If I'm not mistaken then the standard skin for Kodi's interface nowadays is "Estuary". In that standard skin go to the Home screen (or whatever the top most level of Kodi's interface is called). Then click on the little rond icon of a cogwheel in the upper left: that's the Settings Menu. Then do the rest, i.e. click on : system - display - monitor > choose HDMI or VGA etc.

Image

That should do it, if it doesn't I'm afraid that I can't help you anymore. Maybe somebody else can.
Reply
#17
(2020-01-03, 14:38)xbmcuser01 Wrote:
(2020-01-03, 08:44)ThumbOne Wrote:
(2019-12-18, 14:41)xbmcuser01 Wrote: In Kodi.    
Not helpful I'm afraid. Is this a skin issue? I am using a skin that has no system top menu for example. Perhaps that's why I can't see it? Maybe share a screen shot?    
Never use a skin that excludes the Settings Menu. If I'm not mistaken then the standard skin for Kodi's interface nowadays is "Estuary". In that standard skin go to the Home screen (or whatever the top most level of Kodi's interface is called). Then click on the little rond icon of a cogwheel in the upper left: that's the Settings Menu. Then do the rest, i.e. click on : system - display - monitor > choose HDMI or VGA etc.

Image

That should do it, if it doesn't I'm afraid that I can't help you anymore. Maybe somebody else can. 

Cool, I have that setting set properly but no it doesn't always work. Sometimes it does, sometimes it doesn't. It's hard to know when and when not. Essentially if I start Kodi it seems randomly to respect my setting to display on the secondary display and randomly not to. The irony when it choose not to is that I go to those setting and it says it's displaying on the other display, i.e. I have to set it to the primary display (which Kodi is on) first, and respond yes, to the prompt, then change it back to the secondary one and respond yes to the prompt before it moves to the secondary monitor.

Decidedly bizarre and irritating behaviour alas.
Reply
#18
(2020-01-08, 12:20)ThumbOne Wrote: I have to set it to the primary display (which Kodi is on) first, and respond yes, to the prompt, then change it back to the secondary one and respond yes to the prompt before it moves to the secondary monitor.

Need to know more about how you have stuff configured really.  For instance, on my setup, the Xserver has two different screens, one on HDMI-0 and one on DVI-0.  The HDMI one is connected to my amp and then on to my TV, the DVI output is my desktop monitor.

Both of the Xserver screens are completely independent of each other. Perhaps a debug log (wiki) of you starting Kodi (when it starts on the wrong display) would be beneficial.
Learning Linux the hard way !!
Reply
#19
(2020-01-08, 13:30)black_eagle Wrote:
(2020-01-08, 12:20)ThumbOne Wrote: I have to set it to the primary display (which Kodi is on) first, and respond yes, to the prompt, then change it back to the secondary one and respond yes to the prompt before it moves to the secondary monitor.

Need to know more about how you have stuff configured really.  For instance, on my setup, the Xserver has two different screens, one on HDMI-0 and one on DVI-0.  The HDMI one is connected to my amp and then on to my TV, the DVI output is my desktop monitor.

Both of the Xserver screens are completely independent of each other. Perhaps a debug log (wiki) of you starting Kodi (when it starts on the wrong display) would be beneficial. 
Thanks for the suggestion. I have a similar setup albeit one is a HDMI out and the other a DP (DisplayPort) out (not DVI). I have the Cinnamon (my DE) menu on the HDMI and Kodi set up on the DP. Alas they are both listed as HDMI's, respectively HDMI-1 and HDMI-2 (because DP looks transparently like HDMI I guess, is just a plug format and otherwise the same I imagine). The real problem is prefer to be listening to music that experimenting with restarts ;-) and I can't do both at once as I'm listening on Kodi, ha, ha, and that the startup on wrong display is intermittent, and I don't have any clear steps to reproduce, so it's fishing in the dark with debug logging on. That said, I may get around to it some time and will bear this advice in mind and to duck back here if do!
Reply
#20
First of all you need to use correct terminology or everybody understands things differently. In Unix/Linux world a display is a combination of an input and output that can be locally or on a different host. A screen is a virtual space and an output or monitor is a viewport to this screen. Run xrandr in verbose mode or kodixrandr and you'll see the information Kodi sees.
The most common configuration is a single screen with multiple outputs (monitors). This allows a user to move an application from one monitor to another. For this setup you should configure if a monitor is i.e. left or right to the other one. Another variant is having multiple screens. This setup does not allow to move an application to the other monitor by i.e. moving it with the mouse around.

Most common mistake is that users run Kodi on X11 without a window manager using the standalone option. This might work for some cases but there are lots of pitfalls. Kodi won't get required events from the window manager it needs for configuration. Kodi on X11 is supposed to run with a window manager.

Post output of kodixrand when you come back.
Reply
#21
(2020-01-16, 10:45)FernetMenta Wrote: First of all you need to use correct terminology or everybody understands things differently. In Unix/Linux world a display is a combination of an input and output that can be locally or on a different host. A screen is a virtual space and an output or monitor is a viewport to this screen. Run xrandr in verbose mode or kodixrandr and you'll see the information Kodi sees.
The most common configuration is a single screen with multiple outputs (monitors). This allows a user to move an application from one monitor to another. For this setup you should configure if a monitor is i.e. left or right to the other one. Another variant is having multiple screens. This setup does not allow to move an application to the other monitor by i.e. moving it with the mouse around.

Most common mistake is that users run Kodi on X11 without a window manager using the standalone option. This might work for some cases but there are lots of pitfalls. Kodi won't get required events from the window manager it needs for configuration. Kodi on X11 is supposed to run with a window manager.

Post output of kodixrand when you come back.
Heya, sorry it's been a while. Kodi has been behaving for a change ;-). And lifes's busy. But tidying up tabs and saw this. So put the effort in, and found kodi-xrandr and here's the output:

$ /usr/lib/x86_64-linux-gnu/kodi/kodi-xrandr
<screen id="0" minimum_w="320" minimum_h="200" current_w="1920" current_h="2160" maximum_w="16384" maximum_h="16384">
  <output name="DP-1" connected="false">
  </output>
  <output name="HDMI-1" connected="true" w="1920" h="1080" x="0" y="0" crtc="1" wmm="1150" hmm="650">
    <mode id="0x46" name="1360x768" w="1360" h="768" hz="60.01516" current="false" preferred="true"/>
    <mode id="0x47" name="1920x1080" w="1920" h="1080" hz="60.00000" current="true" preferred="false"/>
    <mode id="0x48" name="1920x1080" w="1920" h="1080" hz="50.00000" current="false" preferred="false"/>
    <mode id="0x49" name="1920x1080" w="1920" h="1080" hz="59.94020" current="false" preferred="false"/>
    <mode id="0x4c" name="1920x1080" w="1920" h="1080" hz="30.00000" current="false" preferred="false"/>
    <mode id="0x4d" name="1920x1080" w="1920" h="1080" hz="25.00000" current="false" preferred="false"/>
    <mode id="0x4e" name="1920x1080" w="1920" h="1080" hz="24.00000" current="false" preferred="false"/>
    <mode id="0x50" name="1920x1080" w="1920" h="1080" hz="29.97010" current="false" preferred="false"/>
    <mode id="0x51" name="1920x1080" w="1920" h="1080" hz="23.97608" current="false" preferred="false"/>
    <mode id="0x4a" name="1920x1080i" w="1920" h="1080" hz="30.00000" current="false" preferred="false"/>
    <mode id="0x4b" name="1920x1080i" w="1920" h="1080" hz="25.00000" current="false" preferred="false"/>
    <mode id="0x4f" name="1920x1080i" w="1920" h="1080" hz="29.97010" current="false" preferred="false"/>
    <mode id="0x52" name="1280x720" w="1280" h="720" hz="60.95819" current="false" preferred="false"/>
    <mode id="0x53" name="1280x720" w="1280" h="720" hz="60.00000" current="false" preferred="false"/>
    <mode id="0x54" name="1280x720" w="1280" h="720" hz="50.00000" current="false" preferred="false"/>
    <mode id="0x55" name="1280x720" w="1280" h="720" hz="59.94020" current="false" preferred="false"/>
    <mode id="0x56" name="1024x768" w="1024" h="768" hz="60.00384" current="false" preferred="false"/>
    <mode id="0x57" name="800x600" w="800" h="600" hz="60.31654" current="false" preferred="false"/>
    <mode id="0x58" name="720x576" w="720" h="576" hz="50.00000" current="false" preferred="false"/>
    <mode id="0x59" name="720x576i" w="720" h="576" hz="25.00000" current="false" preferred="false"/>
    <mode id="0x5a" name="720x480" w="720" h="480" hz="60.00000" current="false" preferred="false"/>
    <mode id="0x5b" name="720x480" w="720" h="480" hz="59.94006" current="false" preferred="false"/>
    <mode id="0x5c" name="640x480" w="640" h="480" hz="60.00000" current="false" preferred="false"/>
    <mode id="0x5d" name="640x480" w="640" h="480" hz="59.94048" current="false" preferred="false"/>
    <mode id="0x5e" name="720x400" w="720" h="400" hz="70.08166" current="false" preferred="false"/>
  </output>
  <output name="HDMI-2" connected="true" w="1920" h="1080" x="0" y="1080" crtc="0" wmm="708" hmm="398">
    <mode id="0x4a" name="1920x1080i" w="1920" h="1080" hz="30.00000" current="true" preferred="true"/>
    <mode id="0x4b" name="1920x1080i" w="1920" h="1080" hz="25.00000" current="false" preferred="false"/>
    <mode id="0x4f" name="1920x1080i" w="1920" h="1080" hz="29.97010" current="false" preferred="false"/>
    <mode id="0x47" name="1920x1080" w="1920" h="1080" hz="60.00000" current="false" preferred="false"/>
    <mode id="0x48" name="1920x1080" w="1920" h="1080" hz="50.00000" current="false" preferred="false"/>
    <mode id="0x49" name="1920x1080" w="1920" h="1080" hz="59.94020" current="false" preferred="false"/>
    <mode id="0x53" name="1280x720" w="1280" h="720" hz="60.00000" current="false" preferred="false"/>
    <mode id="0x54" name="1280x720" w="1280" h="720" hz="50.00000" current="false" preferred="false"/>
    <mode id="0x55" name="1280x720" w="1280" h="720" hz="59.94020" current="false" preferred="false"/>
    <mode id="0x58" name="720x576" w="720" h="576" hz="50.00000" current="false" preferred="false"/>
    <mode id="0x59" name="720x576i" w="720" h="576" hz="25.00000" current="false" preferred="false"/>
    <mode id="0x5a" name="720x480" w="720" h="480" hz="60.00000" current="false" preferred="false"/>
    <mode id="0x5b" name="720x480" w="720" h="480" hz="59.94006" current="false" preferred="false"/>
    <mode id="0x17d" name="720x480i" w="720" h="480" hz="30.00111" current="false" preferred="false"/>
    <mode id="0x17e" name="720x480i" w="720" h="480" hz="29.97003" current="false" preferred="false"/>
  </output>
</screen>


Yes, I have one screen with two outputs. And yes the terminology is useful but we're not all on top of the nuances of X terminology all the time I'm afraid. Been in the xrandr space a lot but not every day and I can't remember off hand what everything is called at that level and we'll all try at times to express ourselves in English approximations I guess.

I don't actually have a left and right but a top and bottom, as one is a TV and the other a Projector on the wall above. As they are both 1920x1080 resolution as is the display on my desktop, I can remote into the HTPC (Home Theatre PC) using nomachine, which I like precisely because it neatly maps both those outputs to my desktop nicely so I can move the mouse up and down and in a viewport that is half as high as the remotes. Very pleasant interaction with the multi-display remote PC.

The up/down config is clear in the kodi-xrandr output.

I have KODI configured as follows:

Image

The intermittent problem is that when Is tart Kodi it starts not on HDI-1 as configured but on HDMI-2.

I'm guessing what we'd need is kodi-xrandr output just after it does one of these intermittent wrong display startups. Been a while since it has but I'll keep a kodi-xrandr shortcut handy for when it does.
Reply
#22
(2020-01-08, 13:30)black_eagle Wrote:
(2020-01-08, 12:20)ThumbOne Wrote: I have to set it to the primary display (which Kodi is on) first, and respond yes, to the prompt, then change it back to the secondary one and respond yes to the prompt before it moves to the secondary monitor.

Need to know more about how you have stuff configured really.  For instance, on my setup, the Xserver has two different screens, one on HDMI-0 and one on DVI-0.  The HDMI one is connected to my amp and then on to my TV, the DVI output is my desktop monitor.

Both of the Xserver screens are completely independent of each other. Perhaps a debug log (wiki) of you starting Kodi (when it starts on the wrong display) would be beneficial.  
Thanks for this too and apologies for my tardy response. All no rush clearly. Highly intermittent issue, and of late rather uncommon. Posted kodi-xrandr output already and description of connection, but for the sake of completeness:

1) Kodi running on an MintBox 2 with Linux Mint 29.3 on it.
2) The Mintbox has two ports out back a a displayport and an HDMI port.
3) I have a TV plugged into one, and a Yamaha AVR into the other.
4) The Yamaha AVR drives surround sound speakers and a projector and it takes HDMI input for that.
5) The TV just takes HDMI input
6) I see them as TV=HDMI-1 and Yamaha=HDMI-2 on the Mintbox.
7) I'm using stock standard X-windows as Mint 19.3 comes packaged with and it uses from memory LightDM but probably slowly irrelevant detail
8) The Mintbox, in spit e of having a TV and Projector (via a Yamaha AVR) attached is essentially headless from my perspective as neither of these is generally on. They are turned on as and when needed to view something.
9) But I use Kodi primarily as a music player and so the screens are mostly off and Kodi is playing music for me.
10) I connect to and maintain the HTPC (MintBox) using Nomachine which works well. There's a neat coincedence that works in my favour, in that both Mintbox displays and my desktop display are all 1920x1080 pixels. Nomachine I can setup so that by default I am looking right at HDMI-2 which is my workspace on the HTPC. HDMI-1 is off-screen and has Kodi on it. Noamchin is so slick I can just move my mouse up and when it goes offscreen it moves the remote displays down, in short I can scroll up and down from HDMI-1 to HDMI-2 on the HTMP just by moving my mouse up and down past the top and bottom display boundary.
11) HDMI-2 is the Primary display meaning it has the task bar and system menus. I'm using the Cinnamon desktop, which has a totally ordinary Windows 7 like look and feel.
12) Common use case is: I connect to the HTPC, I'm looking at HDMI-2, I start Kodi, Kodi starts on HDMI-1 and I carry on, I don't need to see Kodi. If I want to see Kodi I just turn the TV on and sometimes I do, to interact with it.
13) The intermittent and puzzling issue is that it starts on HDMI-2. Respecting the Fullscreen config it masks my entire primary display including task bar and menu.
14) I then go to the Kodi settings and see it's configured fro HDMI-1. So I have to press enter and it switches formally to HDMI-2 (which does nothing in practice except take a moment and prompt me with Ary you sure?), Then I press enter again and it switches back to HDMI-1 this time actually moving to HDMI-1. Then I'm done. It's a bizarre start up sequence, when it fails.

I can get a debug log easily enough with one caveat. It's not so easy. It's not so easy because debug mode is so ugly and verbose on screen, and the problem so intermittent, that I have always put it on, and turned it off again before I got the odd behaviour ;-). It is frustrating intermittent.

Which is why I sort of wondered though if there was some way to start Kodi with a command line option that forces it to HDMI-1 say. But I suspect there isn't. If there was I could fix my shortcuts to use that. As it stands it looks like an intermittent Kodi bug/feature.

It may relate indeed to something we see in xrandr when it's happened. But it could be some system transience that isn't well captured in that or a debug log. I'm imagining that as Kodi starts for some reason at a system level HDMI-1 fails to be there so it opts for HDMI-2 but HDMI-1 is there by the time it's fully started. I only muse in this direction because one the things I most hate about HDMI is the way it feeds back to the host the on/off status of the screen. In short when I turn the TV off or on Mint knows about it. And sometimes weird X refreshes happen because of such state changes.

In fact it's a total aside, but the reason I'm on Mint and Mintbox is that I was running Win 7 on a NUC as and HTPC and this HDMI back signalling from display to host just caused regular blue screens. So I eventually trashed Win 7 and installed Mint and things were better for ages then went pair shaped again for no obvious reason with state changes of the Yamaha (switching the projector on/off) causing the NUC to crash. Oft times unable to reboot, my having to open it and bridge two jumpers to reset the danged thing. All because of switching an HDMI projector on/off.

So I trashed the NUC and got a Mintbox and it's been pretty smooth ever since. No more HDMI shenanigans and the worst I see is X doing some weird repainting stuff as one of the outputs changes state but it always settles back down in under a minute (it's a little slow but not painfully so so probably 10 or 15 seconds all up) and it's business as usual, no system crashes (lesson learned:  avoid NUCs for HTPC use).

And only reason I share that is as backstory to this: I'm very wary that state changes in attached HDMI devices can cause transient oddities at the system (X windows) level.

The only caveat is, I don't correlate Kodi's intermittent wrong display startup with any state changes in attached HDMI devices.

So it remains an intermittent mystery. For better or worse which hasn't raised it's head in a while. I'm waiting patiently for Kodi 19 before do any serious add-on work as I have no desire to start in Python2 and Kodi-19 promises Python3 finally.
Reply
#23
What window manager do you have in use?

Quote:I'm guessing what we'd need is kodi-xrandr output just after it does one of these intermittent wrong display startups
 

Post a debug log.
Reply
#24
Quote:I can get a debug log easily enough with one caveat. It's not so easy. It's not so easy because debug mode is so ugly and verbose on screen

Not if you enable debug mode via advancedsettings.
Code:
<advancedsettings>
    <loglevel>1</loglevel> <!-- Change this to "1" to hide the on-screen debug log text -->
</advancedsettings>
Reply
#25
You have a similar setup to me, in that I have one PC running the monitor I'm using now on a DVI ouput and Kodi running on the HDMI output.  The difference is that I have X configured for two screens.  My normal ubuntu desktop runs on screen 0 and Kodi runs on screen 1.  With this config, Kodi has never failed to start on the correct display (apart from some development issues during v18 which FernetMenta fixed).  If the output is removed completely (cable unplugged) then Kodi will switch back to the desktop, but otherwise it'll stay where it's supposed to.

Kodi can't be controlled by a keyboard when running in it's own screen because the keyboard is attached to the desktop screen, but I use an IR remote for Kodi anyway.  It can be controlled by the mouse but that's pointless as I can't see the TV from my desk!  It's effectively headless at the moment, as the TV is off (amp is on) and it's playing music.  Enabling CEC makes Kodi switch back to my desktop when the TV is off, so I leave it disabled. 

Apart from the development issue, I have never had any problems with the way it's set up and it's been like this for at least 6 years.

This is my xorg.conf.

xml:
Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" 1920 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"

    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "LG Electronics W2442"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Section "Monitor"

    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "ONKYO Corporation TX-SR508"
    HorizSync       26.0 - 68.0
    VertRefresh     24.0 - 60.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 710"
    BusID          "PCI:1:0:0"
    Screen          0
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 710"
    BusID          "PCI:1:0:0"
    Screen          1
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "DVI-D-0: nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "HDMI-0: 1920x1080 +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    Option          "ColorRange" "Full"
    Option         "ColorSpace" "RGB"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection


So, that links screen 0 to device 0 (dvi out on the gfx card) with monitor 0 and the same for device 1, screen 1, monitor 1.  0 is the ordinary desktop and 1 is the amp-tv with Kodi running on it.
Learning Linux the hard way !!
Reply
#26
(2020-02-06, 13:13)black_eagle Wrote: You have a similar setup to me, ...
Thanks for that! I've never used two different screens before. I wonder how that works moving windows around and the mouse etc. One screen two outputs is the usual default config I find that Cinnamon in any case sets up when there are two monitors plugged into two ports. I may experiment with screens some time, but as noted this issue is intermitent, and as an aside I'm crazy time poor so tend to do such things when they press me to, especially experiments that involve reboots and hence time down form my otherwise endless stream of pleasing background music (I live in a soundtrack at home ;-). Oh as total aside I have an FM transmitter on the same HTPC and so Kodi provides me with the original and cheapest (though far from the highest quality) wireless sound system known ;-). So I have music in the house, around the house int he workshop in the garden, you name it, on demand now with phone app!
Reply
#27
Yeah, one screen with two or more outputs is more usual because you can move windows between outputs so it's like an extended desktop.  Two screens isn't like that.  You can't drag something from one screen to the other.  You can move the mouse onto the other screen but that's about itTo launch on a different screen you either have to set the DISPLAY env variable, or be running something that is multi-screen aware (like Kodi or GIMP).  Effectively the screens are completely independent of each other, which is exactly what I  want.

No need to reboot Wink  ctrl+alt+fn(2~6) will get you a proper VT.  Log into it as normal and then sudo systemctl restart <yourdisplaymanager> should restart the X server with the new config.
Learning Linux the hard way !!
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi starts on the wrong display0