video: Can't connect to X11 server on ':0.0'

  • Hi there,

    I have been a happy VDR user for over 20 years now. For almost all the time I've been running a headless system with two PCI DVB-C cards, one of which providing also the mpeg2 decoding. You know, composite video and audio cables direct to the TV, providing smooth (pun intended) experience for the viewer. My OS of choice has always been Debian, and due to some of the DVB drivers missing from the Debian 12 stock kernel (IIRC) I've run Debian Trixie/sid for the last year or so, with no problems. It has provided me with VDR 2.6.0 and recently 2.6.9 out of the box. Great stuff.

    Now the time for non-HD TV is apparently nearing its end here in Finland, so I went and bought a Hauppauge WinTV dualHD USB stick. I got it working in Debian and VDR (I'm going to write a public blog post as well for my own and maybe someone else's benefit). It found the local DVB-C channels and epgsearch timers are working again to save the recordings.

    But the problem is still the output to the TV. Since there is no dedicated hardware decoder output anymore, I figured I need to use the displayport output from the Debian host. Now, I haven't almost ever run X11 on any systems during my 30+ years with Linux. I managed to add X11 to the Debian setup though ("Xwayland" is running and login screen is there). I also managed to compile and install the vdr-plugin-softhddevice plugin since I figured that's what I can use the get the VDR output locally on this "Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz" box. (I also installed vdr-plugin-streamdev-server and have been able to see the live programmes and saved recordings with VLC player over the network nicely, this will be an extra feature of this Next Generation VDR setup of mine.)

    However, the TV (Debian box output) stays in the graphical X11 login screen and I don't get any VDR-specific outputs. The only hint I get is "video: Can't connect to X11 server on ':0.0'" error when starting VDR service.

    With my lack of understanding of X11 world, I've still figured that there is some permission problem that the vdr user cannot access the X11 server. Chatgpt gives me various "xhost +si:localuser:vdr" kind of commands, but I don't seem to find the correct way to apply it. Nor can I figure out a working .Xauthority stuff to remove the error message and allow VDR output to the screen. I haven't found any suitable other sources either, even with German translations applied.

    To be clear, I don't want to attach any keyboard to this box and login or start VDR there. The goal is to get it working as before: start the box (or it has started automatically due to a timer) and VDR screen is available and operable with the IR remote.

    Am I trying this graphical thing the correct way at all? All these years I've only used the display output of the Debian box just when absolutely necessary to access the Linux console, since I've used the old DVB card decoder output for the VDR screen. Obviously that is not an option anymore with HD programmes.

    I want to think that I am so near to the solution (well there is no audio yet either but I haven't tried that yet at all), but I'm still missing some key concept to enable VDR to decode the stream and send it to the screen correctly.

    Any hints are very much appreciated. Or, if I need to give more information about this setup or about the problem, let me know. Thank you for any assistance. For the next 25 (or so) years of VDR!

  • Welcome at vdr-portal.de.

    Have you tried to create and add a .xhost file in home directory of the user running X to allow access to X?

    Code
    ~/> cat .xhosts
    127.0.0.1

    HowTo: APT pinning

    Click for my gear

    [¹] Intel NUC Kit NUC7i5BNH, Akasa Newton S7, 8GB DDR4, WD Black SN700 500GB NVMe, Crucial MX500 2TB, CIR, SAT>IP, Ubuntu LTS 18.04.5, VDR 2.4.1 (15W)
    [²] Intel NUC Kit NUC7i3BNH, 8GB DDR4, WD PC SN520 250GB NVMe, Crucial MX500 1TB, CIR, SAT>IP, Ubuntu LTS 20.04.1, VDR 2.4.1 (13W)
    [³] BQ500, Asrock X470D4U, AMD Ryzen 5 5600, 32GB DDR4 ECC, 2x WDC SN750 512GB, 4x Samsung SSD 4TB, 1x Samsung SSD 8TB, 1x Crucial MX500 500GB, 1x WDC Blue SSD 500GB, Windows Server 2019 Hyper-V (35W)
    [⁴] Jultec JPS0501-12AN, JPS0501-8M2, Octopus Net (DVBS2-8) & openHABian 3.3.0

  • For a presumably insignificant detail for this issue right now, the system is a Lenovo ThinkCentre M82 i3-2120 TWR, from 2013, since that was something that was available at that time to accomodate the two PCI (not PCIe) DVB-C cards after my original Asus Pundit box died. Unless the CPU or other capabilities fail to meet the HD era requirements, that's the box I'll be running with VDR for the foreseeable future as well.

  • Welcome at vdr-portal.de.

    Have you tried to create and add a .xhost file in home directory of the user running X to allow access to X?

    Code
    ~/> cat .xhosts
    127.0.0.1

    Thanks! So, the /usr/bin/Xwayland process is run by Debian-gdm:

    Debian-gdm:x:122:136:Gnome Display Manager:/var/lib/gdm3:/bin/false

    I added .xhosts:

    root@digitv:~# cat /var/lib/gdm3/.xhosts
    127.0.0.1

    and restarted gdm, gdm3 and vdr, but the same error still occurs in VDR startup.

    I also attempted to add the "xhost +SI:localuser:vdr" command in /var/lib/gdm3/.profile earlier, with no better results.

  • Please switch back to X11. VDR concept is 25 years old, your M82 also exceeded 10 years, and what is your GPU - internal old i915something or a nvidia card?

    While Wayland is nice, shiny and new, but struggles with nvidia as well as old iGPUs.

    vdr User #2022 - hdvdr2:

    Lenovo SFF M83, Intel(R) Core(TM) i5-4670S, 32 GB Ram, zram-swap/tmp, ubuntu-focal+ESM, softhdcuvid, ffmpeg-6.1(git)

    ddbridge-6.5 mit 2xDVB-S2 und (Flex) 2xDVB-C/T Tunern, nvidia-GF1050Ti SFF (nvidia-dkms-570.124), System SSD btrfs,

    timeshift-btrfs, Video 8TB HDD XFS/cow, yavdr-ansible-2.7.3-seahawk, epgd-git mit plugins, Kernel 6.12.18+dddvb-0.9.41-git

    vdradmin-am-3.6.13-git, vdr-live-ng, vdrmanager (Smartphones als FB)

  • Please switch back to X11. VDR concept is 25 years old, your M82 also exceeded 10 years, and what is your GPU - internal old i915something or a nvidia card?

    While Wayland is nice, shiny and new, but struggles with nvidia as well as old iGPUs.

    About the GPU I can tell that there is the internal GPU of the CPU, nothing more as far as I can tell.

    $ lspci
    ...
    00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)

    Just to make sure I understand correctly, your advice forward is that I should search for a way to replace this Wayland thing on Debian with something else, and that could enable VDR to output the video to the screen?

  • Hmm, maybe I need to comment further. I'm willing to accept that this old hardware is not suitable for fully fluent HD output. I don't just know anything about it yet, and I just have this box right now for testing all these new graphical Linux things. If I could get this system to at least output something, then I could be more confident to buy new hardware (no PCI slots required anymore!), no problem.

  • Hi,

    You should try with an LiveDVD to test the hardware.

    Use easyvdr v3.5. I think this should work anymore.

    The new v5 is no LiveDVD anymore.

    Or you should give yavdr a try on a new HDD/SSD, that distri is actively managed any more. Easyvdr v3.5 is not.

    Regards Stefan

    Test-VDR1: HP rp5700 Fertigsystem, Core2Duo E6400, 2GB RAM, FF-SD C-2300, nvidia Slim-GT218 x1 | easyVDR 2.0 64Bit
    VDR3: in Rente

    VDR4: MSI G31M2 v2, Digitainer2-Geh., t6963c 6" gLCD, E5200, 2GB, 3TB WD Red, GT730, 2x TT S2-3200; easyVDR 3.5 64bit
    VDR5: Gigabyte
    GA-G31M-S2L, Intel E2140, Zotac GT730 passiv, Digitainer2-Geh., t6963c 6 " gLCD, 2 TB WD Red, 2x TT S2-3200 (an 1 Kabel) easyVDR 3.5 64bit
    VDR6:
    Intel E5200, GT630 passiv, F1 750 GB, t6963c gLCD, 2x TT S2-3200 | easyVDR 3.5 64bit
    VDR-User #1068
    http://www.easy-vdr.de

  • According to https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video Your CPU has hardware decoder for AVC, if that is what they broadcast, it should be fine. For it to work make sure to compile softhddevice with libva (VA-API), check https://wiki.debian.org/HardwareVideoAcceleration to familiarize Yourself what's needed (Arch Linux wiki also has good article about it). Just as reminder You'll probably need to set this "LIBVA_DRI3_DISABLE=1" as global variable for the decoding to work. As alternative to X11+softhddevice You could also try to use softhdcuvid's (https://github.com/jojo61/vdr-plugin-softhdcuvid) DRM plugin variant which doesn't use X11 at all, simply run with the plugin enabled and there should be image on TV (remember to shutdown X11 before).

    I personally use X11+softhddevice as an output, since that's been most stable and performant on my systems. As I use Arch Linux as base, I'll describe the setup only briefly, since some details might differ.

    There's this nice project called xlogin (https://github.com/joukewitteveen/xlogin), install it in Debian appropriate places, no need to start or enable its service. Download https://raw.githubusercontent.com/VDR4Arch/vdr4a…g/vdr-xorg.conf to /etc/systemd/system/vdr.service.d and that's it. Now each time You'll run vdr.service it'll pull xlogin as a dependency which will start X server to which softhddevice will be able to connect to. Remember to adjust -v option of the plugin, I use va-api-egl, You might find va-api to work better on Your hardware.

  • Intel 2nd generation will be able to show h.264 1920x1080, but it has a very unstable decoder, and with everyday use, most likely you will have frequent crashes, and you will need to restart VDR. With this hardware, run softhddevice -v va-api, and export LIBVA_DRI3_DISABLE=1 in modern OS. -v va-api-glx should work too. Also, use latest softhddevice. If you don't use desktop, install X11 only, without (gdm) window managed (Gnome, kde). But softhddevice can works in windowed mode too. Look $DISPLAY, maybe you have not :0.0. Compile softhddevice with DEBUG, uncomment it in Makefile, and look log.
    You can't use softhdcuvid (softhdvaapi, softhddrm) with old GPU, they are not supported by the plugin.

    To view UHD, you need Intel no earlier than the 8th generation, or for example Nvidia 1030.

  • First thing for today, I want to say thank you for your very fast responses and comments, I really appreciate all of them. Lots of things for me to think, test, report and consider.

    Now, based on some of my chatgpt attempts, I did this (all of this in a SSH+tmux session):

    • Set sudo journalctl -f running
    • Run sudo xinit in another window:
    • Run sudo systemctl restart vdr

    And you know what: I got the VDR output on the display. OSD is working, as well as the IR remote (it's using serial port btw like all these years).

    Some quick observations:

    • Watching live HD TV, looks fine and smooth. Except that sometimes movements start being jerky. And then at some point it is all fine again. No mosaic or anything like that
    • There is a screensaver somewhere (like 15 minutes or so), I have to click something on the keyboard (that I temporarily have connected)or use the VDR IR remote to get TV out of blank screen
    • No audio (but again, I haven't tried anything with it yet)
    • Switching channels take like 5 seconds before the new channel starts moving (it switches faster but shows a still image for a few seconds)
    • Subtitles are working (in channels that provide separate subtitle data)
    • SoftHdDevice has a menu in the main level, it shows "Video Decoder: VAAPI OSD: Software" (frames missed and dropped are zero, duped = 27400 (increasing), total = 47700 (increasing))
    • At least it can output something in the screen!

    Here is some related excerpts from the VDR logs (maybe answering some of the presented questions as well):

    As of writing this, I don't yet understand how this X11 (or Xwayland? Xorg? I don't know even the terminology) works and what "xinit" does to enable the vdr user to write to the display now.

    But hey at least this is something. Onwards...

    Einmal editiert, zuletzt von Markku (21. Februar 2025 um 17:07)

  • Fast forwarding/reversing an existing recording works, but when going back to play, it takes a few seconds to start playing and this is logged at the same time:

    Code
    Feb 21 18:20:30 digitv kernel: i915 0000:00:02.0: [drm] GPU HANG: ecode 6:4:ec879ffe, in vdr [2069]
    Feb 21 18:20:30 digitv kernel: i915 0000:00:02.0: [drm] GT0: Resetting chip for stopped heartbeat on vcs0
    Feb 21 18:20:30 digitv kernel: i915 0000:00:02.0: [drm] *ERROR* failed to set vcs0 head to zero ctl 00000000 head 00601a64 tail 00000000 start 7fdec000
    Feb 21 18:20:30 digitv kernel: i915 0000:00:02.0: [drm] vdr[2069] context reset due to GPU hang
    Feb 21 18:20:30 digitv vdr[2069]: video/vaapi: gpu hung 5277ms 974

    Maybe this is related to some of the comments shown earlier about the old CPU?

  • Hi,

    You are using software decoding, that is too much for your CPU... You should use VAAPI. This is done by using an start option for the Plugin VAAPI in your runvdr. Your ffmpeg need to be compiled as above mentioned for VAAPI support, which is not standard in Debian as I remember, but this could also be wrong.

    The screensaver should to be disabled via Setup option in the Softhddevice plugin. If not this is possible via an Xorg.conf setting.

    Have you instslled pulseaudio for audio? And alsa?

    Channel switching is optimized by the parsmeters of the Softhddevice, but first fix the opther problems.

    Regards, Stefan

    Test-VDR1: HP rp5700 Fertigsystem, Core2Duo E6400, 2GB RAM, FF-SD C-2300, nvidia Slim-GT218 x1 | easyVDR 2.0 64Bit
    VDR3: in Rente

    VDR4: MSI G31M2 v2, Digitainer2-Geh., t6963c 6" gLCD, E5200, 2GB, 3TB WD Red, GT730, 2x TT S2-3200; easyVDR 3.5 64bit
    VDR5: Gigabyte
    GA-G31M-S2L, Intel E2140, Zotac GT730 passiv, Digitainer2-Geh., t6963c 6 " gLCD, 2 TB WD Red, 2x TT S2-3200 (an 1 Kabel) easyVDR 3.5 64bit
    VDR6:
    Intel E5200, GT630 passiv, F1 750 GB, t6963c gLCD, 2x TT S2-3200 | easyVDR 3.5 64bit
    VDR-User #1068
    http://www.easy-vdr.de

  • Thanks, found the screensaver setting and disabled it, it did the trick in that front.

    I'll try to find some time to test the audio in the weekend, and also check the market situation for some used workstations to modernize the hardware a bit.

    Regarding the display permission problem, any ideas if I should be looking for adding some components (like that xlogin etc), or to still try adding some other settings to allow vdr user to use the display? I have currently no idea what the "xinit" test really did on the system to enable VDR to start. (It was a good test to show the video output in general though)

  • I got audio working by installing libalsa-ocaml-dev and then recompiling vdr-plugin-softhddevice, and configuring it with HDMI:

    Code
    [softhddevice]
    -a hdmi

    (I first installed packages like pulseaudio and pulseaudio-utils but later purged them and sounds are still fine)

    Nice!

    What is more interesting is that currently I have zero problems when VDR is running:

    • Smooth video and audio output
    • Even when recording two channels from different muxes and replaying one existing recording
    • Switching channels is as fast as I can maybe hope: switches immediately, maybe two seconds of jerky movement in video but stabilizes quickly
    • Replaying and fast forwarding/reversing an HD recording works without any problems, no GPU hangs/errors

    This looks pretty good already with this old i3-2120 battle horse.

    I still have to figure out the correct way to get VDR running automatically after reboot without manual kludges.

  • That xlogin addition, as I described, is precisely for not starting X server manually or even logging user in, it handles everything for You (not much magic, everything in that project is plaintext, see for Yourself).

    Today I've tested X11+softhddevice on i3-3220T with Debian 12, that's 3rd gen, any 3rd gen i3 or i5 intel is dirt cheap and should work with Your mainboard (check compatibility), worked like charm with AVC broadcasts. The -v switch of softhddevice was va-api-egl (plain one has given me "video/vaapi: vaPutSurface failed: unknown libva error", while glx "video/glx: vaCopySurfaceGLX failed", probably I missed some dev dependency). No stuttering or hiccups. But before buying anything check if changing to va-api-egl helps with Your CPU.

  • That xlogin addition, as I described, is precisely for not starting X server manually or even logging user in, it handles everything for You (not much magic, everything in that project is plaintext, see for Yourself).

    Hmm, I see.

    And that absolutely did the trick! Without "vdr-xorg.conf" it started VDR but not in the foreground (sounds were playing but the X login screen was shown), and with it now there is black screen after the usual Debian startup outputs for a few seconds and then VDR screen!

    Thank you very much!

    I need to take a break now and then digest this a bit more before documenting everything and deciding how to proceed with the hardware. I need more storage anyway, and considering buying a second dualHD tuner as well.

  • I installed the new VDR setup:

    • Lenovo ThinkCentre M720q, i5-8500T, 8 GB, 2 TB NVMe, currently one Hauppauge WinTV dualHD
    • Debian 13/testing, VDR 2.6.9 from Debian packages
    • vdr-plugin-softhddevice compiled from https://github.com/ua0lnj/vdr-plugin-softhddevice, with ALSA and EGL (-a hdmi -v va-api-egl)

    Fast forward/rewind works strangely, two different observations:

    1. For example, when playing the recording at 0:05:42 and pressing rewind, the timestamp first flickers values like 0:03:xx (or even 0:00:xx) and then "syncs" back to reality, counting correctly values like 0:05:xx (going down). Basically the minute value shows false values for a moment. (Actually also the progress bar reflects those false values as well.)
    2. Cannot actually reproduce it right now, but a few moments ago rewind was not possible, it only fast-forwarded even when clicked rewind. It didn't matter if I used the IR remote or the web UI remote provided by the vdr-plugin-live plugin, so at least it wasn't an IR signal problem. Then it next time worked again, and then not. So I don't know what happened.

    But an actual question about video output. For the TV set I have my usual setup so that the VDR host is directly connected to mains power, but everything else (TV, soundbar, DVD player) is connected to an extension cord with an on/off switch, and it is off whenever nobody is home or when not watching TV for a longer period. Now I observed that if the TV (Samsung "smart TV" from about 2014 I think, connected with a displayport-to-hdmi adapter with a hdmi cable) is not powered on when VDR host starts, there won't be any output (audio or video) when the TV is later turned on. There are repeated errors like:

    Even restarting VDR does not help, reboot of the VDR host helps.

    Is this something that is just the norm, or is there something that could maybe be attempted on the Lenovo UEFI side or somewhere else?

  • I think you need a individual "edid.bin" for connecting VDR correctly to a non-running TV.
    There are many Threads for that - good luck!

    MyVDR: yaVDR-Ansible (Ubuntu 20) - softhddevice-openglosd (ffmpeg 2.8) - epgd/epg2vdr - skindesigner estuary4vdr (adaptiert) - 1920x1080@50 Hz | kodi 21 - xstream
    Aerocube M40 | 300W | ASRock H61M-GE | Intel G530 | Asus ENGT520 | 2 x TT-budget S2-3200 | ASRock Smart Remote (CIR) | 4 GB RAM | 120 GB SSD | 3 TB HDD

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!