Secondary display not recognized

In standalone mode, Kodi won't recognize my secondary HDMI display (TV) unless another user is already logged-in (Gnome session). As a result I see only one HDMI display in the system settings (my VGA computer display) and can't get any sound from the TV.
The problem appeared after I upgraded from Kodi 16 stable to Kodi 17 beta5.

Process tree:

Code:
kodi   tty5     \_ /usr/libexec/gdm-x-session --run-script kodi-standalone
kodi   tty5          \_ /usr/libexec/Xorg vt5 -displayfd 3 -auth /run/user/1001/gdm/Xauthority -nolisten tcp -background none -no
kodi   tty5          \_ /bin/sh /usr/bin/kodi-standalone
kodi   tty5               \_ /bin/sh /usr/bin/kodi --standalone
kodi   tty5                   \_ /usr/lib64/kodi/kodi.bin --standalone

The kodi.log file mentions:
(note the line about the HDMI2 display)
Code:
15:51:03 T:140529758467136  NOTICE: load settings...
15:51:03 T:140529758467136  NOTICE: Found 1 Lists of Devices
15:51:03 T:140529758467136  NOTICE: Enumerated PULSE devices:
15:51:03 T:140529758467136  NOTICE:     Device 1
15:51:03 T:140529758467136  NOTICE:         m_deviceName      : Default
15:51:03 T:140529758467136  NOTICE:         m_displayName     : Default
15:51:03 T:140529758467136  NOTICE:         m_displayNameExtra: Default Output Device (PULSEAUDIO)
15:51:03 T:140529758467136  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
15:51:03 T:140529758467136  NOTICE:         m_channels        : FL,FR
15:51:03 T:140529758467136  NOTICE:         m_sampleRates     : 5512,8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000,38​4000
15:51:03 T:140529758467136  NOTICE:         m_dataFormats     : AE_FMT_U8,AE_FMT_S16NE,AE_FMT_S24NE3,AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_FLOAT
15:51:03 T:140529758467136  NOTICE:         m_streamTypes     : No passthrough capabilities
15:51:03 T:140529758467136  NOTICE:     Device 2
15:51:03 T:140529758467136  NOTICE:         m_deviceName      : alsa_output.pci-0000_00_1b.0.hdmi-stereo
15:51:03 T:140529758467136  NOTICE:         m_displayName     : Built-in Audio Digital Stereo (HDMI)
15:51:03 T:140529758467136  NOTICE:         m_displayNameExtra: HDMI / DisplayPort (PULSEAUDIO)
15:51:03 T:140529758467136  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
15:51:03 T:140529758467136  NOTICE:         m_channels        : FL,FR
15:51:03 T:140529758467136  NOTICE:         m_sampleRates     : 5512,8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000,38​4000
15:51:03 T:140529758467136  NOTICE:         m_dataFormats     : AE_FMT_U8,AE_FMT_S16NE,AE_FMT_S24NE3,AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_FLOAT
15:51:03 T:140529758467136  NOTICE:         m_streamTypes     : No passthrough capabilities
[...]
15:51:03 T:140529293993728  NOTICE: PulseAudio: Opened device Default in pcm mode with Buffersize 150 ms
15:51:03 T:140529758467136 WARNING: CXRandR::Query - output HDMI2 has no current mode, assuming disconnected
15:51:03 T:140529758467136  NOTICE: Checking resolution 16
15:51:03 T:140529758467136 WARNING: CWinEventsX11::Init - no input method found
15:51:03 T:140529758467136  NOTICE: Using visual 0x20
15:51:03 T:140529758467136  NOTICE: GL_VENDOR = Intel Open Source Technology Center
15:51:03 T:140529758467136  NOTICE: GL_RENDERER = Mesa DRI Intel(R) Ironlake Desktop
15:51:03 T:140529758467136  NOTICE: GL_VERSION = 2.1 Mesa 12.0.3
15:51:03 T:140529758467136  NOTICE: GL_SHADING_LANGUAGE_VERSION = 1.20
[...]

Some info about my system:
Code:
-----------------------------------------------------------------------
Starting Kodi (17.0-BETA5 Git:20161028-nogitfound). Platform: Linux x86 64-bit
Using Release Kodi x64 build
Kodi compiled Nov  4 2012 by GCC 6.2.0 for Linux x86 64-bit version 4.8.0 (264192)
Running on Fedora 25 (Workstation Edition), kernel: Linux x86 64-bit version 4.8.6-300.fc25.x86_64
FFmpeg version/source: ffmpeg-3.1-kodi
Host CPU: Intel(R) Core(TM) i5 CPU 650 @ 3.20GHz, 4 cores available
-----------------------------------------------------------------------



I made the "kodi-standalone" bash script execute the "xrandr" command before starting Kodi. Here is what I found.

Output of the "xrandr" command when Kodi is the unique opened session:
Code:
Screen 0: minimum 8 x 8, current 1680 x 1050, maximum 32767 x 32767
DP1 disconnected primary (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 430mm x 270mm
   1680x1050     59.95*+
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   640x480       75.00    72.81    66.67    59.94  
   720x400       70.08  
HDMI2 connected (normal left inverted right x axis y axis)
   1920x1080     60.00 +  50.00    59.94    30.00    25.00    24.00    29.97    23.98  
   1920x1080i    60.00    50.00    59.94  
   1280x1024     60.02  
   1360x768      59.80  
   1280x720      60.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x576i      50.00  
   720x480       60.00    59.94  
   720x480i      60.00    59.94  
   640x480       60.00    59.94  
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

Output of the "xrandr" command when the Kodi session is started while another desktop session is active:
(note the * symbol in front of both monitors)
Code:
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP1 disconnected primary (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 430mm x 270mm
   1680x1050     59.95*+
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   640x480       75.00    72.81    66.67    59.94  
   720x400       70.08  
HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 640mm x 360mm
   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98  
   1920x1080i    60.00    50.00    59.94  
   1280x1024     60.02  
   1360x768      59.80  
   1280x720      60.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x576i      50.00  
   720x480       60.00    59.94  
   720x480i      60.00    59.94  
   640x480       60.00    59.94  
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)



Did anyone face a similar issue on Linux and found a workaround?

osx el capitan 10.11.6 (15G1108)

KODI CRASH EVER CANT'T OPEN IT FROM THE FIRST INSTALLATION ALL VERSION OF KODI Process: Kodi [1057] Path: /Volumes/VOLUME/Kodi.app/Contents/MacOS/Kodi Identifier: org.xbmc.kodi Version: 16.1. (Git...

Watch plugin output on another kodi?

In trying to keep a clean installation on multiple devices, I wondered if my main PC which has various video plugins installed could throw its output to another kodi device? So I have one master kodi device in the home, that shares the output of those ...

Playback HDR ?

Hi is there a way to playback the HDR Samples so that Kodi switches immediately to HDR on the TV or Beamer ? Or do you have to change that manually ? Thanks

unable to connect to a remote UPNP server (serviio)

Hi all I have a problem with kodi (15.2) and a remote UPNP server (Serviio on a synology NAS) I have successfullyadded the source and i can see my video but, after a reboot, if i try to open the source i receive this error: "unable to connect to the ...

Flashing colored blank screens

New user totally. Successfully installed Kodi. Using Jarvis, found a few add-ons,.. loads,.. plays,.. is audible,.. but only delivers flashing colored blank images on screen. #seriouslyneedhelp

Compiling “external” PVR Addon – Howto?

Hi, after following this tutorial, I was able to successfully build Kodi 17 and also some "official" PVR Addons like iptvsimple, etc. Now I want to compile this Zattoo addon, but couldn't find any usable tutorial for Android, only Win/Linux. Can someb...

display soft subs

When watching videos from youtube, I guess I'm surprised that Kodi can't (as far as I know) display soft subs.

hide play menu

I guess the main thing that frustrates me about watching videos, and not just on Kodi, is not having a clean screen.. This can be particularly annoying when watching something with subtitles.Although having said that the skin I'm using that is pretty g...

System option in Power menu

Hi, Please consider adding a System option to the Kore remote's power menu. With which you can open Kodi's system menu. I want to remove System from Kodi's main menu to prevent mischievous little fingers wrecking a fine-tuned set-up. Yet I'd still li...

Kodi only shows Working when trying to view live TV

Hi, I've been using Mediaportal for many years bit need to find an alternative to its back end. Kodi is running on Windows 10, 64 bit, couldnt find the version, but it is upto date and has all updates applied. Core i7, 32 GB ram. I have disabled the ...