Tracks are duplicated when the app restarts
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Ubuntu Music App |
Undecided
|
Andrew Hayzen | ||
Bug Description
The list of tracks that is passed to media-hub contains duplicated elements. To reproduce:
1. Start music-app
2. Create a list, simply going to "Songs". Issue the command:
dbus-send --print-reply --type=method_call --dest=
(substitute X with the session number that music app has created; to check which one the session is do "grep Session ~/.cache/
to know the current tracks.
3. Play a song
4. Stop music-app
5. Reboot the phone
6. Start music-app and go to "Songs". Issue the the same command as in step 2.
Compare the output in both cases. The number of tracks is twice the one in step 2. media-hub log inspection shows duplicated entries. This does not look like a media-hub/
Finally, when playing again the track list is re-created and you get the expected number of tracks, but the initial track list keeps growing and growing.
*** Taking a look at the music-app DB confirms that it is storing duplicated tracks:
sqlite3 ~/.local/
sqlite> .dump queue
(lots of tracks here...)
Each start of music app + pressing play add rows that are duplicated. Finally, removing the database makes things start from scratch.
Although the list is recreated right when starting to play (so there are o immediate issues from the user's POV), iterating a few times causes performance to drop, as it starts to take a few seconds since the moment you press play to the moment when the displayed screen in music-app changes.
| description: | updated |
| description: | updated |
| description: | updated |
| summary: |
- Tracks are duplicated when the app re-starts + [bgplaylist] Tracks are duplicated when the app re-starts |
| Changed in music-app: | |
| assignee: | nobody → Andrew Hayzen (ahayzen) |
The queue in the UI is always right. What I think is happening:
1. music-app gets the tracks from the DB
2. It creates a track list in media-hub with them
3. When "play" is pressed, it clears the current track list and loads a new one in media-hub, this time a correct one
4. but it also appends those tracks to the table in the DB, increasing the number of tracks loaded initially when music-app re-starts
The side issue is that as the table grows, there is some lag in the app due to the time it takes to create/clear the initial playlist.
To solve this I guess that the tracks of step 4 should overwrite what is in the DB instead of being appended.
| description: | updated |
| description: | updated |
| description: | updated |
| tags: | added: bgplaylist |
| summary: |
- [bgplaylist] Tracks are duplicated when the app re-starts + Tracks are duplicated when the app restarts |
This might have been a false positive, as it stopped happening when I copied over my compiled media-hub library. So some ABI mess was happening.
| Changed in music-app: | |
| status: | New → Invalid |


Sounds like the clearQueue method is not being called correctly, or the clear of the playlist queue isn't working, is the queue in the UI always correct or does that have duplicates as well?