flathub / ca.edestcroix.Recordbox

https://flathub.org/apps/details/ca.edestcroix.Recordbox
0 stars 0 forks source link

Recordbox forgets Music Folder on every startup and then becomes unresponsive #3

Open NotoriousNico opened 1 week ago

NotoriousNico commented 1 week ago

I don't have an account on Codeberg, so I hope it's okay to post my issue here instead:

On first start, I select my music folder and let Recordbox scan it. After scanning is done, everything works fine, I can play music, change settings and so on.

But after closing Recordbox and starting it again, I'm back at the first-run screen, where I have to select my Music folder again. But after selecting it this time, Recordbox becomes unresponsive, and I have to force quit it.

I'm on Ubuntu 24.10, but also had the issue on Ubuntu 24.04.1 LTS as well. I've tried Recordbox 0.8.2.

Please let me know if you need further information.

edestcroix commented 21 hours ago

Posting here is fine too, thanks for letting me know about this.

If you run Recordbox from the command line does it output any errors when this happens? And if it does can you post the output? It sounds like an issue I've run into before during development where the background thread that checks and parses the music folder is crashing, which causes the UI to get stuck on the first-start screen.

edestcroix commented 20 hours ago

Also if you delete the ~/.var/app/ca.edestcroix.Recordbox/ directory to reset Recordbox does the problem still happen?

I found a bug that might be the cause, if the "Sync on Startup" setting is disabled, the library doesn't switch off the first-start page and it thinks it's showing the main view, making it look unresponsive.

NotoriousNico commented 15 hours ago

Thank you for your reply, I appreciate it!

I did a fresh install of Recordbox 0.8.3 and this is the output I got on first run:

(Recordbox:2): Gtk-WARNING **: 10:31:18.339: Locale not supported by C library.
    Using the fallback 'C' locale.

In case it's important: My locale is en_US.UTF-8.

After the first start, I select my music library and let Recordbox scan it. By the way, there's a small typo on this screen: image

It should read "Synchronizing music".

While Recordbox is scanning my Music, I get a bunch of these error messages in my Terminal:

(Recordbox:2): Gsk-WARNING **: 10:51:39.729: Clipping is broken, everything is clipped, but we didn't early-exit.
(Recordbox:2): Gsk-WARNING **: 10:51:39.730: Clipping is broken, everything is clipped, but we didn't early-exit.
(Recordbox:2): Gsk-WARNING **: 10:51:39.742: Clipping is broken, everything is clipped, but we didn't early-exit.
(Recordbox:2): Gsk-WARNING **: 10:51:39.742: Clipping is broken, everything is clipped, but we didn't early-exit.
(Recordbox:2): Gsk-WARNING **: 10:51:39.742: Clipping is broken, everything is clipped, but we didn't early-exit.

Anyway, after Recordbox has scanned my collection, I configure it to my liking, including these options:

Settings - Library

image

In case it helps: My music library is on a second (internal) SSD.

I now exit Recordbox and start it again from Terminal. The output is exactly the same as from my first run:

(Recordbox:2): Gtk-WARNING **: 10:53:17.143: Locale not supported by C library.
    Using the fallback 'C' locale.

But now, Recordbox is showing the first-run screen again and I get the "Recordbox isn't responding" message after around five seconds: image

However, if I do nothing for around 20 to 30 seconds, the message goes away and I can see the regular library overview with my scanned library and all settings intact.

During all this time, the terminal output hasn't changed a bit, it's still this:

(Recordbox:2): Gtk-WARNING **: 10:55:57.688: Locale not supported by C library.
    Using the fallback 'C' locale.

Please let me know if you need more information.

NotoriousNico commented 15 hours ago

Thank you for your reply, I appreciate it!

I did a fresh install of Recordbox 0.8.3 and this is the output I got on first run:

(Recordbox:2): Gtk-WARNING **: 10:31:18.339: Locale not supported by C library.
    Using the fallback 'C' locale.

In case it's important: My locale is en_US.UTF-8.

After the first start, I select my music library and let Recordbox scan it. By the way, there's a small typo on this screen: image

It should read "Synchronizing music".

While Recordbox is scanning my Music, I get a bunch of these error messages in my Terminal:

(Recordbox:2): Gsk-WARNING **: 10:51:39.729: Clipping is broken, everything is clipped, but we didn't early-exit.
(Recordbox:2): Gsk-WARNING **: 10:51:39.730: Clipping is broken, everything is clipped, but we didn't early-exit.
(Recordbox:2): Gsk-WARNING **: 10:51:39.742: Clipping is broken, everything is clipped, but we didn't early-exit.
(Recordbox:2): Gsk-WARNING **: 10:51:39.742: Clipping is broken, everything is clipped, but we didn't early-exit.
(Recordbox:2): Gsk-WARNING **: 10:51:39.742: Clipping is broken, everything is clipped, but we didn't early-exit.

Anyway, after Recordbox has scanned my collection, I configure it to my liking, including these options:

Settings - Library

image

In case it helps: My music library is on a second (internal) SSD.

I now exit Recordbox and start it again from Terminal. The output is exactly the same as from my first run:

(Recordbox:2): Gtk-WARNING **: 10:53:17.143: Locale not supported by C library.
    Using the fallback 'C' locale.

But now, Recordbox is showing the first-run screen again and I get the "Recordbox isn't responding" message after around five seconds: image

However, if I do nothing for around 20 to 30 seconds, the message goes away and I can see the regular library overview with my scanned library and all settings intact.

During all this time, the terminal output hasn't changed a bit, it's still this:

(Recordbox:2): Gtk-WARNING **: 10:55:57.688: Locale not supported by C library.
    Using the fallback 'C' locale.

EDIT: Things get interesting, when I try to play a random track. I first got a little toast message that says: "Error: Resource not found."

After about two seconds, the toast goes away and a new message appears: image Interestingly, the lyrics to that song I try to play display just fine, as well as all other metadata of that song. But the song itself can't be played.

However, this doesn't happen to all of my songs and I've experienced it only with one song so far. In case it helps: The filename of the song I can't play is 1-01 - Cell #1.flac. So this issue might be totally unrelated, but it's still worth mentioning.

Please let me know if you need more information.

edestcroix commented 8 hours ago

Awesome thank you for all the information, and for pointing out the typo, that's probably been there for months.

The "Clipping is broken" errors are a bug in GTK that should be fixed soon. And the error playing that track is unrelated, but something I thought I had fixed so thank you for mentioning it. It's because of the # character in the filename, GStreamer really doesn't like filenames with it. I remember fixing it a while ago, but the fix must not have survived the port to Rust so I'll look into it again.

Just to confirm, Recordbox doesn't go unresponsive like that the first time it starts, and the lists are able to load like normal without anything freezing? The UI going completely unresponsive before the library appears is interesting, and rules out all my previous ideas for what's going on. I thought it was just stuck on the first-start page, not frozen.

All I can think to try right now is that you mentioned your music folder is on a second SSD, so you could be running into a limitation of the flatpak sandbox where apps running in flatpak can't request persistent access to a folder, and Recordbox is having issues when it tries to read your music folder after the first time.

Can you try running flatpak override ca.edestcroix.Recordbox --filesystem=path to the SSD, or if you use Flatseal adding that path to the "Other Files" section in Recordbox's filesystem options, then reset Recordbox again? This will allow Recordbox to access the music folder without going through the sandbox.

NotoriousNico commented 7 hours ago

Thank you for your reply.

To answer your question regarding Recordbox going unresponsive: The first time I start it, Recordbox is very responsive: I can select my music folder and then it synchronizes all my music. Recordbox has to scan 738 folders, but it does that without any problems.

Only after that is done, me closing Recordbox and then starting it again, becomes it unresponsive. Waiting for around 20 to 30 seconds instead of force quitting Recordbox makes it become responsive again.

I did what you asked for:

I reset Recordbox and added the folder to my music libary with Flatseal: image

After that, I started Recordbox, selected my music library and let it do the synchronization. This screenshot is to confirm that the path to my music library in Recordbox is the same as the one in Flatseal: image

Once Recordbox is done synchronizing my music, I once again configure it to my liking and then close it. I wait for a few moments and then start it again.

… and the result is exactly the same as before: I see the first-run screen again, and after about five seconds, I get the "Recordbox is not responding" dialog. But if I wait for 20 to 30 seconds, that dialog goes away and I see my music library again. So nothing has changed, unfortunately.

edestcroix commented 3 hours ago

Ok thank you. I don't think it's a problem with the sandbox then, that path in Recordbox would show up under /run/user/... in that case.

The only other thing I think it could be at this point is that your music library is much larger than mine which is revealing an inefficiency in the code that's retrieving the library data from Recordbox's database and it's freezing while it loads everything into the UI, although I'm not 100% confident on that because if that was the case I would think it would freeze on the first run too.

If you don't mind my asking, could you send me a copy of the database file at ~/.var/app/ca.edestcroix.Recordbox/data/Recordbox/recordbox.db? If you put it in a zip you should be able to just attach it to your reply here it Github. It would allow me to debug this a lot easier, and I can hopefully track down what's causing the freeze.

Also, if you set your music folder to a subfolder with a smaller amount of files in it and Recordbox doesn't freeze when you restart after then that is almost definitely the problem.

edestcroix commented 3 hours ago

Actually, you probably don't have to send me the database file after all, I just tested adding a lot of extra entries to the database and I think I'm able to reproduce your issue now.

What is happening is that when the database gets big enough the UI freezes while it's loading the library from the database, causing Recordbox to do what it's been doing for you. I'll look into fixing this for the next release and hopefully this is what is causing your issue.

Thank you again for reporting this, I spent a lot of time optimizing the code to read large libraries into the database, but didn't realize getting them back out of the database could end up being the bottleneck.