timers.xml corruption - cause and cure

There are 4 replies in this Thread which was already clicked 624 times. The last Post () by NobleGas.

  • Hi all,

    I got a VU+ Uno 4K SE linux based PVR with twin DVB-T2 tuners a couple of months ago as a replacement for my elderly Topfield 5800 PVR. This is for FreeView in the UK.


    The VU+ works reasonably well but I've had a number of 'timers.xml file corruption' errors on start up and lost all my timers. The first time this happened, it was after a HD series recording event. Examining the /etc/enigma2/timers.xml_old file showed HD series timer entry had binary characters in the timer description field despite the description being readable when I created the timer. This was a HD timer event. I tried to edit these out, but at the time wasn't aware that I had to stop enigma2 running, edit the timers.xml file and restart enigma again. So I gave up and reconstructed the timers again from memory.


    The second time the timers.xml was corrupted, I was successful in recovering from this error using the 'init 4' & 'init 3' to stop and then restart enigma2 after settng the corrupt description field to an empty string. This time a SD event had a corrupted description field.

    The Cause

    I'm new to this so please feel free to point out if I've got anything wrong.


    After some investigation it looks like enigma stores timer events internally (in memory) probably as dvb_table_eit_event structures. The <program>.eit appears to conform to a dvb_table_eit_event structure so backs up this assertion. Any time the current timer events list changes or enigma quits (init 4), enigma stores these internal timers as an xml format file to disk, including any garbage data.


    The PVR's internal enigma xml encoder cannot handle/exclude binary data so the stored timers.xml file cannot be correctly parsed in again later. Internal event descriptions with binary characters (from HD EPG), will be encoded with binary characters still present.


    There is a possibility during/after any HD viewing/recording, the internal EPG could be updated with the HD EPG and will corrupt a previously good timer description field that needs a refresh. I haven't worked out the exact cause but this scenario occurred earlier today and corrupted the timers.xml file.

    The Cure

    There is no real cure, just some suggested work arounds to make things a little tolerable. Unfortunately the product developers failed to perform any real data verification which is why we still see this issue even after several years of product development. This is an epic Programming 101 class fail IMHO.


    1. The simplest solution is to ONLY to view/record DVB-T (SD) programs - not really practical.


    2. If you do want to record HD programs, then tune to the SD channel, add the timer and then change the channel to the corresponding HD channel. This will ensure the description field is readable and the xml can be correctly read back in on the next start up. I have 2 program lists defined, one for all channels and a second for HD channels only. This means I can select the HD channel list and go to the HD channel almost directly. DO NOT try to record a HD program series, this will corrupt your timers file after the next event EPG refresh. I now set timers for each individual HD program in a series.


    3. There is a pre enigma startup hook (/usr/bin/enigma2_pre_start.sh) for the Linux based products: DUO 4K & SE, SOLO 4K, ULTIMO 4K, UNO 4K & SE and ZERO 4K. We can use this to 'fix' the timers.xml file before Enigma starts. VUi images use the same hook script but OpenViX uses /etc/enigma2/startup.sh instead. References to either of these are present in the /usr/bin/enigma2.sh file. For this hook to function the hook scripts need to be present and set executable by root (chmod u+x '<script nmae>').


    I've developed a simple script (enigma2_pre_start.sh) that removes all NON alphanumeric, punctuation or white spaces characters from the timers.xml file before Enigma2 starts up. The script only leaves valid ascii characters in the description field (in the whole xml file actually) but at least the corrupted timers.xml file can now be read in. The script also saves a copy of the original corrupt timers file for future investigations/stats.


    If a full program description is important to you then you will have to manually correct this yourself. You can either edit the timers.xml file directly after an 'init 4' command, or edit the timer from Open Webif and just copy/paste the description from your PC and save the timer.


    -- NG


    enigma2_pre_start.sh

  • master G

    Approved the thread.
  • As my Toppy was sick,needed recapping, I needed to commission the Uno4kSE quickly so I've kept the original firmware OpenVuplus 2021-04-26-vuplus_experimental. I haven't tried any other OpenVu+ images (or any other distros) so can't say if they have the same issue. I did download the most recent OpenVuplus images and compared them against each other. The differences were nothing to write home about.


    I did look at other options but most were half the size of the OpenVu+ image and I couldn't find out how well they supported DVB-T2, especially how they handled encoded HD EPG which is which i suspect is the root cause of the timers corruption in the OpenVu+ image.


    As I only use the Uno for its PVR capability, I'm not to bothered about the UI. If anyone can tell me how well DBV-T2 is supported under other distros, that would most welcome.


    --NG

    • Official Post

    You won't have a problem with DVB-T2 in the UK using OpenPLI, OpenVix, OpenATV, OpenBlackHole, HD Freaks, OpenSpa, Pure2, Egami, HD Freaks. I have not yet tried openVision, but am sure it will be fine too.


    Two of the Vix coders are terrestrial only. Both come from topfield user base. Simon Capewell has incorporated some of the functions he was used to in the topfield like joining events split apart by the 5 minute "news" type of broadcasts that you get on some channels.


    If you are using USB tuners, OpenSpa have built their own mediatree which is more inline with linux standards.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!