RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Emulationstation: Save metadata on change

    Scheduled Pinned Locked Moved Ideas and Development
    emulationstaionmetadatasave data
    10 Posts 4 Posters 2.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • vbsV
      vbs
      last edited by

      I have the problem that often my metadata is not saved in Emulationstation. This is cause I am running Retropie on an Intel NUC and often enough when playing with friends it won't get shut down properly but just turned off. In those cases the metadata changes are lost.

      I googled a bit and I didn't find a way to have ES automatically save metadata while running. Like every time when metadata changes save it immediately. I only found the usual "Save metadata on exit" function.

      So the question: Is there a way to have ES save metadata instantly when it changes? Would it be an appreciated feature?

      I could offer to look into implementing it into ES.

      cyperghostC 1 Reply Last reply Reply Quote 0
      • cyperghostC
        cyperghost @vbs
        last edited by

        @vbs did you try sync command?

        1 Reply Last reply Reply Quote 0
        • f.carusoF
          f.caruso
          last edited by

          @vbs It is not possible. That's the way it is designed in EmulationStation source code.
          Gamelists are saved on exit only. It would need source code changes.
          Gamelists are XML files and using this format, to store 1 changed character you need to save the whole file. I'm not sure doin' it in realtime is a good idea as sometimes gamelists are very big files and take a long time to write (expecially on a SD card). You'd get enormous lags - waiting time...

          vbsV 1 Reply Last reply Reply Quote 0
          • vbsV
            vbs @f.caruso
            last edited by

            @f-caruso said in Emulationstation: Save metadata on change:

            @vbs It is not possible. That's the way it is designed in EmulationStation source code.
            Gamelists are saved on exit only. It would need source code changes.

            Yes, it would need a change in source code.

            Gamelists are XML files and using this format, to store 1 changed character you need to save the whole file. I'm not sure doin' it in realtime is a good idea as sometimes gamelists are very big files and take a long time to write (expecially on a SD card). You'd get enormous lags - waiting time...

            That behavior should be optional (defaults to off). I, for example, run Retropie on an i5 NUC with an SSD so I assume saving even a large XML with like 50 MB would only take a fraction of a second. But even if it would take 2 seconds I would possibly be willing to accept it instead of of losing the data.

            Anyway, there are even other options to avoid lags at all like saving the XML to disk in a background thread. This would be a bit more tricky as it would mean introducing multithreading into ES which is generally a thing to avoid :)

            @cyperghost
            Not sure which sync you mean? The Linux sync command? No, I didn't try and I am unsure how it could help?

            cyperghostC 1 Reply Last reply Reply Quote 0
            • cyperghostC
              cyperghost @vbs
              last edited by cyperghost

              @vbs I think it could help to flush memory and force write to disc. Never tried this. Yes I ment the Linux sync

              1 Reply Last reply Reply Quote 0
              • vbsV
                vbs
                last edited by

                @cyperghost
                According to the code ES just does not write the data before exiting so I think flushing caches does not help here.

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @vbs
                  last edited by

                  @vbs said in Emulationstation: Save metadata on change:

                  According to the code ES just does not write the data before exiting so I think flushing caches does not help here.

                  Actually metadata is written to the disk on exiting/restarting Emulationstation - if you run it with the --debug flag, these writes are logged in the es_log.txt file.

                  1 Reply Last reply Reply Quote 1
                  • vbsV
                    vbs
                    last edited by

                    @mitu
                    That's what I tried to say I guess.

                    cyperghostC 1 Reply Last reply Reply Quote 0
                    • cyperghostC
                      cyperghost @vbs
                      last edited by

                      @vbs as I said - never tried. But you can use a script to do restarts or proper shutdowns to ES. But this will not help if you pull the cord

                      1 Reply Last reply Reply Quote 0
                      • vbsV
                        vbs
                        last edited by

                        @BuZz
                        Do you have an opinion on this matter?

                        I am thinking about

                        • an option to enable instant save on every change in the event loop which might introduce lags depending on the system
                        • having a background thread that saves changes which would not introduce lags but introduce more complexity into ES
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.