Bug 257818 - Audio cd tracks are not showed or played
Summary: Audio cd tracks are not showed or played
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/CD (show other bugs)
Version: 2.3.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: 2.4.0
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-24 20:52 UTC by Andrea
Modified: 2011-12-20 11:46 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.4


Attachments
Amarok log (94.79 KB, text/plain)
2010-11-29 13:46 UTC, Andrea
Details
Nothing happens, no CD icon appears in Amarok (5.52 KB, application/octet-stream)
2010-12-01 21:46 UTC, Andrea
Details
CD loaded in Amarok with 0 tracks (7.53 KB, application/octet-stream)
2010-12-01 21:47 UTC, Andrea
Details
CD loaded OK with track listing (21.73 KB, application/octet-stream)
2010-12-01 21:48 UTC, Andrea
Details
patch to handle the no-CDDB-info case (474 bytes, patch)
2010-12-02 11:40 UTC, Andriy Gapon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea 2010-11-24 20:52:02 UTC
Version:           2.3.2 (using KDE 4.5.1) 
OS:                Linux

When an audio CD is inserted in the cdrom and device is detected, if the action play with amarok is selected nothing happen in the player. Tracks does not play and are not shown in the file browser. Zero tracks are counted in the local compilation where the CD track listing should appear.

Reproducible: Always

Steps to Reproduce:
just put any audio CD in  the cdrom and select play with amarok

Actual Results:  
Nothing happens in amarok, no sound, no tracks listed.

Expected Results:  
Being able to listen to CD and view track listing so that it can be ripped.

OS: Linux (i686) release 2.6.35-23-generic
Compiler: cc
Comment 1 Myriam Schweingruber 2010-11-29 11:06:16 UTC
Could you please provide the output of 'amarok -d --nofork' when you insert the CD? Make sure you run the command twice, the first time debugging is enabled and debug messages will be collected the second time you run the command.
Comment 2 Andrea 2010-11-29 13:44:25 UTC
Here enclosed in the attachments the requested output file in txt.
Many thanks
Andrea

(In reply to comment #1)
> Could you please provide the output of 'amarok -d --nofork' when you insert the
> CD? Make sure you run the command twice, the first time debugging is enabled
> and debug messages will be collected the second time you run the command.
Comment 3 Andrea 2010-11-29 13:46:06 UTC
Created attachment 53854 [details]
Amarok log
Comment 4 Myriam Schweingruber 2010-11-29 21:19:19 UTC
Does the CD drive appear in the Local Music section? What happens if you right-click on it?
Comment 5 Andrea 2010-11-30 00:52:08 UTC
(In reply to comment #4)
> Does the CD drive appear in the Local Music section? What happens if you
> right-click on it?

YES, the CD drive icon appears in the Local Music section but it shows "0 tracks". If I click on the arrow at the right nothing happens (no expanded submenu - no tracks displayed). If I right click I get the standard menu options...

Further info: the cd tracks appears in Dolphin browser, but even from here they do not play... If I double-click a song file from inside Dolphin, Amarok opens but still no tracks/no music.
Comment 6 Myriam Schweingruber 2010-11-30 19:14:33 UTC
Sorry to bother you with questions, but just to make sure. Do you use a dual CD/DVD drive or does your system use two different drives? That would then be a duplicate of bug 230462
Comment 7 Andrea 2010-11-30 21:59:34 UTC
(In reply to comment #6)
> Sorry to bother you with questions, but just to make sure. Do you use a dual
> CD/DVD drive or does your system use two different drives? That would then be a
> duplicate of bug 230462

No problem... I'm happy to answer questions even if I'm not a linux expert...
YES, I have two different drives, the internal cd-rom and an additional USB CD/DVD drive. So probably this is a very similar issue of 230462 bug. However please note that I made a test and removed the external drive, restart the system..., this does not fix the problem, on the contrary now not even the audiocd icon appears in the left panel of Amarok...
Comment 8 Myriam Schweingruber 2010-12-01 03:48:28 UTC
Similar, but not identical indeed. Thank you for your feedback.
Comment 9 Andriy Gapon 2010-12-01 16:13:11 UTC
I believe I have the same issue.
I also found this forum thread that describes my problem precisely:
http://forum.kde.org/viewtopic.php?f=115&t=91305

I think that I see the issue when an audio CD doesn't have CDDB information.

I briefly glimpsed into the code and, indeed, it seems that track data is only populated based on CDDB data in .txt file returned by Audio CD KIO slave ("Information/CDDB Information.txt" or its localized equivalent).
But that file is empty if there is no CDDB data.

Not sure if it's an amarok's problem or if Audio CD KIO slave is supposed to always provide non-empty disk information.
Comment 10 Andriy Gapon 2010-12-01 17:41:13 UTC
(In reply to comment #9)
> Not sure if it's an amarok's problem or if Audio CD KIO slave is supposed to
> always provide non-empty disk information.

Or, perhaps, amarok expects Information/CDDB Information.txt to not exist at all rather than be empty.
Comment 11 Andrea 2010-12-01 21:45:13 UTC
(In reply to comment #8, 9, 10)

I made additional test with the following scenario:

Amarok NOT running
Insert a CD in external drive
System Pop-up to select device: I choose "Play with Amarok"
Amarok opens in sys tray
The audiocd does not load (no cd icon in Amarok) - Always true in my tests.

CD removed from drive, Amarok is still open
Same CD inserted again -several times until read.

Unfortunately I could not identify a pattern here: in the subsequent attempts sometimes the CD loaded with 0 tracks, sometimes does not appears at all in the panel, sometimes the CD tracks appears correctly. 

It seems random but I can confirm the the CDs containing CDDB info usually opens although not necessarily at the first attempt. In my tests even the CD with CDDB info never opens if Amarok is not running and "play with Amarok" is chosen when media is inserted.

(Hardware or media problem are excluded because everything works 100% OK on other systems)

The only thing that has changed compared to my previous test is KDE version, now being 4.5.4

New Amarok logs included in attachments.
Comment 12 Andrea 2010-12-01 21:46:46 UTC
Created attachment 53956 [details]
Nothing happens, no CD icon appears in Amarok
Comment 13 Andrea 2010-12-01 21:47:27 UTC
Created attachment 53957 [details]
CD loaded in Amarok with 0 tracks
Comment 14 Andrea 2010-12-01 21:48:33 UTC
Created attachment 53958 [details]
CD loaded OK with track listing
Comment 15 Andriy Gapon 2010-12-02 11:35:10 UTC
(In reply to comment #11)
> Unfortunately I could not identify a pattern here: in the subsequent attempts
> sometimes the CD loaded with 0 tracks, sometimes does not appears at all in the
> panel, sometimes the CD tracks appears correctly. 

Just in case, there is another bug about a similar problem - bug 254459.
It's just that the original description of this bug has "reproducible always" and that bug has "reproducible sometimes".
Comment 16 Andriy Gapon 2010-12-02 11:40:12 UTC
Created attachment 53971 [details]
patch to handle the no-CDDB-info case

Meanwhile here is a patch that seems to significantly improve the situation with audio CDs that do not have online DB information about them.
The patch is naive, straightforward and likely incomplete.
Transient problems like described in bug 254459 may still remain.
Comment 17 Myriam Schweingruber 2010-12-02 13:42:19 UTC
Thank you for the patch, Andriy. Please get an account on http://identity.kde.org and submit the patch to http://git.reviewboard.kde.org
Comment 18 Andriy Gapon 2010-12-02 17:53:36 UTC
I got an account, but when I try to post the patch reviewboard tells me "The selected file does not appear to be a diff".
I am not sure if 'post-review' is available for FreeBSD...
Do you I have to produce some kind of special diff, like against the svn repository, etc?
Comment 19 Raphael Kubo da Costa 2010-12-06 17:51:01 UTC
You probably need to use 'git diff' or 'git format-patch', don't you?
Comment 20 Andriy Gapon 2010-12-06 19:22:16 UTC
Oh, likely.
I just didn't want to setup KDE/amarok development environment to report a three line patch.  I don't do much/any KDE development, just hacked one file in the FreeBSD port build directory.
Comment 21 Raphael Kubo da Costa 2010-12-06 19:37:50 UTC
You don't really need to set anything up, you just need to clone amarok from git, change those 3 lines and use 'git diff' or whatever, without really having to build anything.
Comment 22 Andriy Gapon 2010-12-14 18:57:39 UTC
Thanks a lot!
Finally managed to get back to KDE stuff: http://git.reviewboard.kde.org/r/100212/
Comment 23 Mark Kretschmann 2010-12-17 10:23:50 UTC
commit 21ee1da5303a33e2737d2779ed4923e384406819
branch master
Author: Mark Kretschmann <kretschmann@kde.org>
Date:   Fri Dec 17 10:21:37 2010 +0100

    Fix issue with Audio CDs that do not provide CDDB information.
    Patch by Andriy Gapon <avg@icyb.net.ua>, many thanks :)
    
    BUG: 257818

diff --git a/ChangeLog b/ChangeLog
index a769e36..ba7e952 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@ VERSION 2.4-Beta 2
   CHANGES:
 
   BUGFIXES:
+    * Fixed issue with Audio CDs that do not provide CDDB information. Patch by
+      Andriy Gapon <avg@icyb.net.ua>. (BR 257818)
 
 
 
diff --git a/src/core-impl/collections/audiocd/AudioCdCollection.cpp b/src/core-impl/collections/audiocd/AudioCdCollection.cpp
index 6c45edc..09398b8 100644
--- a/src/core-impl/collections/audiocd/AudioCdCollection.cpp
+++ b/src/core-impl/collections/audiocd/AudioCdCollection.cpp
@@ -141,6 +141,11 @@ AudioCdCollection::infoFetchComplete( KJob *job )
 
         debug() << "Encoding: " << prober.encoding();
         debug() << "got cddb info: " << cddbInfo;
+        if (cddbInfo.length() == 0) {
+            job->deleteLater();
+            noInfoAvailable();
+            return;
+        }
 
         int startIndex;
         int endIndex;