library context actions can block UI when many tracks selected

Bug #1395022 reported by Owen Williams
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Confirmed
Medium
Unassigned

Bug Description

I was doing a bunch of work and ended up with my database in a state where only a few covers had been found. So naturally I did a select-all and clicked "refresh covers." It worked, but mixxx went dark while the processing was happening. Can we put in code to pop up a progress window if > kXXX files are put in the queue to locate covers? (Actually we should do this for other IO intensive operations like refreshing metadata.

Tags: gui library
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

This is a general problem -- try select all add to playlist or select all reload track metadata.

For covers in particular, all the work is done in a different thread. The problem is that queueing the tracks to a different thread involves deserializing a TIO from the database for every file you have highlighted.

We have some bugs for the various context menu items and some of them also have a component of making the actual work be done in a different thread -- but in the case of covers the UI hangs because it is in a loop loading every selected track from the database.

When we have a separate thread for library operations and a TrackReference concept that lets you refer uniquely to a track without deserializing it then this will be resolvable but it's not for now. :-/

Changed in mixxx:
importance: Undecided → Medium
status: New → Confirmed
tags: added: concurrency gui library
Revision history for this message
Owen Williams (ywwg) wrote :

OK, but when the program starts up and the upgrade procedure fires, we get a nice cancelable progress dialog. Would it be possible to reuse that box in this case?

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

During the scan that's a custom SQL query to select all tracks without cover art. In this case the way the code works is you have to deserialize all the TrackPointers first to tell the background thread what to do -- so that's the issue here. We need a sort of lightweight TrackReference thing to truly be able to say "here's some work to do" to a background thread without doing a ton of heavyweight work.

Revision history for this message
Owen Williams (ywwg) wrote :

ok. I actually don't think this is that high priority so I'll bump it down.

Changed in mixxx:
importance: Medium → Low
milestone: none → 1.13.0
Revision history for this message
Daniel Schürmann (daschuer) wrote :

Is a duplicate or Bug #842689 ?

We have already a rotting solution in our repros.
https://github.com/mixxxdj/mixxx/pull/73
I hope I or Nazar finds time to put in a mergeable state.

Revision history for this message
Be (be.ing) wrote :

IMO right clicking a track in a track table shouldn't touch the database at all. The "Add to Playlist" and "Add to Crate" entries in the right click context menu are ugly hacks around the lack of a good drag-and-drop GUI for sorting tracks into playlists and crates. This will be fixed by the library redesign.

Changed in mixxx:
importance: Low → High
milestone: 2.1.0 → none
Be (be.ing)
Changed in mixxx:
importance: High → Medium
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

If you want to visualize the relations between tracks and related entities like crates and playlists you always need some database queries, independent of how the actual UI works. Asynchronous communication of the corresponding results from the database to the UI would require to adjust and redraw this UI accordingly at any time, not just when the selection changes.

But as a first step the playlist and crate related sub-menus should populated lazily (i.e. only after actually opened by the user) instead of immediately in WTrackTableView::contextMenuEvent()! This would make the context menu much more responsive, independent of how many tracks have been selected.

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

Lazily populating the context sub-menu is also an open issue in this PR:
https://github.com/mixxxdj/mixxx/pull/1341

tags: removed: concurrency
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/7669

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.