Clementine: Qt5: audioCD support brocken

Created on 5 Mar 2018  Â·  8Comments  Â·  Source: clementine-player/Clementine

  • [x] I checked the issue tracker for similar issues
  • [x] I checked the changelog if the issue is already resolved
  • [x] I tried the latest Clementine build from here

System information

  • Operating System: openSUSE Tumbleweed
  • Clementine version: 1.3.99 rev 5966ff51c (qt5)
  • Qt version: 5.10.0

Expected behaviour / actual behaviour

doesn't show CD tracks in Devices (after double click), only count of tracks

INFO DeviceManager:559 Connecting QUrl("cdda:///dev/sr0")
INFO ConnectedDevice:45 connected QUrl("cdda:///dev/sr0") "/dev/sr0" false
INFO CddaSongLoader:159 MusicBrainz discid: "oEZVFTXDVkBVf5B0j4.yuES7YYM-"
INFO CddaSongLoader:159 MusicBrainz discid: "oEZVFTXDVkBVf5B0j4.yuES7YYM-"

if choose Music → Open Audio CD i get this errors:

ERROR GstEnginePipeline:645 1 "gsturidecodebin.c(1425): gen_source_element (): /GstPipeline:pipeline/GstURIDecodeBin:uridecodebin-0:nNo element accepted URI 'cdda://0.0.0.1'"
WARN GstEngine:693 Gstreamer error: "Could not handle CDDA URI"

Steps to reproduce the problem (only for bugs)

probe to play CD

1.3.1 version play audio CD correct

All 8 comments

I can confirm this. Works in master, but not the qt5 branch. I also use opensuse, but 42.3

@jonaski, hi, i build qt5 brunch in this repo.

I see the problem now. In CddaSongLoader::GetUrlFromTrack() it creates the url from cdda://tracknumber, like cdda://1, but when it converts the qstring to qurl it ends up as cdda://0.0.0.1, qurl behaves differently in Qt5. I will see if I can fix it.

very dirty hack

diff --git a/src/engines/gstenginepipeline.cpp b/src/engines/gstenginepipeline.cpp
index bff43aeac..ea6528904 100644
--- a/src/engines/gstenginepipeline.cpp
+++ b/src/engines/gstenginepipeline.cpp
@@ -181,8 +181,16 @@ bool GstEnginePipeline::ReplaceDecodeBin(const QUrl& url) {
         spotify_server, "StartPlayback", Qt::QueuedConnection,
         Q_ARG(QString, url.toString()), Q_ARG(quint16, port));
   } else {
+    QByteArray uri;
+    if (url.scheme() == "cdda") {
+        QString track = url.toString().split('.').takeLast();
+        uri = QString("%1://%2").arg(url.scheme()).arg(track).toUtf8();
+    } else {
+        uri = url.toEncoded();
+    }
+
     new_bin = engine_->CreateElement("uridecodebin");
-    g_object_set(G_OBJECT(new_bin), "uri", url.toEncoded().constData(),
+    g_object_set(G_OBJECT(new_bin), "uri", uri.constData(),
                  nullptr);
     CHECKED_GCONNECT(G_OBJECT(new_bin), "drained", &SourceDrainedCallback,
                      this);

Music → Open Audio CD work, but still doesn't show CD tracks in Devices

QUrl class impossible to create URL like _cdda://1_.

There is a problem in Qt 5 with all devices and it's not related to QUrl.
The songs never show up under the device.
I did some debugging back in March. I did the same debugging now, but I seem to be stuck at the same place, probably an easy fix here but I'm overlooking something for sure.
Here is what I've found:
I tested with both CD and an iPod.
It reads the songs from the device fine, and calls LibraryModel::SongsDiscovered fine with the songlist.
It also seem to work as expected in the model, but DeviceItemDelegate::paint() is never reached.
Maybe someone else could look into it, or give me some pointers here. I think the bug might be in DeviceView.
By the way there is also a bug in the device schema, its missing ftsyear.

Fixed. See #6260

AudioCD playing not work if drag'n'drop disc to playlist and start playback from him.
Error message:

No URI handler implemented for "cdd".

Case with playback from menu Music → Open AudioCD work correct.

Fixed. See #6260

I test this changes in Qt5 branch.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xuanruiqi picture xuanruiqi  Â·  5Comments

Clementine-Issue-Importer picture Clementine-Issue-Importer  Â·  6Comments

JulianVolodia picture JulianVolodia  Â·  5Comments

MiguelTremblay picture MiguelTremblay  Â·  6Comments

darkMatterSound picture darkMatterSound  Â·  3Comments