Ardour 8.10: Invalid or corrupt session state

With my session file after I closed it normally, the day after I get this error:

Session “/data/music_kl/99_idea54 (snapshot 99_idea54)” did not load successfully:
Cannot initialize session/engine: Invalid or corrupt session state.

—ERROR: Could not set session state from XML
ERROR: Session: failed to load active playlists
ERROR: Session: cannot create Playlist from XML description.
ERROR: Playlist: cannot create region from XML
ERROR: Session: cannot create Region from XML description. Can not load state for region ‘Take273_drum1-1.13’
ERROR: Session: cannot create Region from XML description. Can not load state for region ‘Take273_drum1-1.11’

How I can recover my session files?

Thanks in advance

Got the same issue as well. Ardour 8.10:

—ERROR: Could not set session state from XML
ERROR: Session: failed to load active playlists
ERROR: Session: cannot create Playlist from XML description.
ERROR: Playlist: cannot create region from XML
ERROR: Session: cannot create Region from XML description. Can not load state for region 'Take44_SY99-1.4'

Already tried loading the .BAK file, gives the same error.

Look at this thread:

You can into an edge-case bug.

Region Take271_drum1-1.15 has length a165282228@a37460945355 which is longer than its (first?) source's length of a165280920
Region Take271_drum1-1.15 has length a165282228@a37460945355 which is longer than its (first?) source's length of a165280920
Region Take271_drum1-1.16 has length a165282228@a37460945355 which is longer than its (first?) source's length of a165280920
Region Take273_drum1-1.11 has length a39823637@a47769921691 which is longer than its (first?) source's length of a39819360
Region Take273_drum1-1.11 has length a39823637@a47769921691 which is longer than its (first?) source's length of a39819360
Region Take273_drum1-1.13 has length a85527273@a47809745328 which is longer than its (first?) source's length of a85524600
Region Take273_drum1-1.13 has length a85527273@a47809745328 which is longer than its (first?) source's length of a85524600

I have replaced the respective duration with the slightly shorter ones:

Fixed session file: The choice

Hmm… Do you know why this error occurs sometimes?

Is this something that could be scripted and given to users to self-fix?

Cheers,

Keith

Hi, I have 2 projects I can’t open for this same reason. Sorry, I haven’t understood any of the fix solutions as described in this forum to date. What options do I have to fix my files? Thanks very much.

To minimize the issue, use “AudioTime” when creating a session (dropdown in the new-session dialog). The underlying bug is a rounding error when using BeatTime (bar/beat/ticks).

If you have a session that does not load, you can either post it here and @paul or me or someone can have a look.

Alternatively: run Ardour from a Terminal and there will be messages like

Region NNN has length XXX which is longer than its (first?) source's length of ZZZ

You then open the .ardour session file in a text editor (after making a backup), and search/replace the duration XXX with ZZZ for all affected regions.

Hi Robin, thanks, that’s very helpful and has worked. A bit of a pain going through that, and it takes 2 passes, but better than losing my work. If it helps, the first file was a snapshot and in Audio Time. The 2nd - not a snapshot but a first save of a project and in Beat Time.

Why attempt to trim the region content at its beginning or end at all?

Following the tape-machine paradigm there should be a leader and trailer to spool the tape onto its reels.

Is this recurring bug of region longer than the actual audio file expected to be avoided with this new commit?

commit fa376b709d46cbd9d1002ef46f96adece36cecaf
Author: Paul Davis paul@linuxaudiosystems.com
Date: Wed Jan 29 17:24:12 2025 -0700


This fixes a number of bugs, including any use of ARDOUR::Filter which writes a new (audio) file
to disk that must be an integer number of samples long, but may be derived from and later used
by a region that had an audio-time duration that is slightly longer (less than one sample)
than the audio file

1 Like

Yes, I am hopeful that this solves it. I managed to find a repeatable set of steps to trigger it and this change fixes it. There is a small code simplification to come.

2 Likes

Well, seems in 8.11 the problem still persists… (as I encountered, and also the user which posted Broken project with ardour 8.11.0)

The problem was created with 8.11, not just that 8.11 cannot open a session which was corrupted with the previous version?

1 Like

8.11 has no special magic that allows it to open a broken session. What it does have it a fix for the bug that caused the broken sessions.

Hmm. I’m not totally sure if indeed this particular problem arose with a session created in 8.10, latently waiting for me to open it in 8.11.
I created the session in 8.10. I did some file date forensics and I can confirm.

However this is a bit peculiar when I checked the xml:

<ProgramVersion created-with="Ardour 8.2" modified-with="Ardour 8.11"/>

Ardour’s development branch (right now, master) has a new and different fix for this issue, and will also correct region lengths during loading.

The changes will be backported to 8.11 and we will do an 8.12 “hotfix” release next week.

The fix in 8.11 was ill-conceived and had many subtle side-effects (thanks to user @miblo for alerting us to some of them).

4 Likes