Bug 230462 - Amarok does not read audio CD on dual CD drive system
Summary: Amarok does not read audio CD on dual CD drive system
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/CD (show other bugs)
Version: 2.3.1-GIT
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 237853 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-12 16:30 UTC by Paul Worrall
Modified: 2011-12-20 11:46 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.4
Sentry Crash Report:


Attachments
Output of amarok --debug when inserting Audio CD (3.03 KB, text/plain)
2010-03-16 20:38 UTC, Paul Worrall
Details
full debug output for inserted cd (142.79 KB, text/plain)
2010-06-01 06:59 UTC, Ian Wood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Worrall 2010-03-12 16:30:53 UTC
Version:           2.2.2.90 (using 4.4.1 (KDE 4.4.1), Kubuntu packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.32-16-generic

With Amarok running, I inserted and ejected the same audio CD ten times.  On each occasion, the device notifier popped up correctly, and k3b (which was also running) detected the CD, but Amarok responded on only one occasion, and then it reported zero tracks (whereas k3b presented the correct list of tracks).  I repeated the same process with two other audio CDs and got the same results.

Don't know if it's relevant but my PC has two CD drives.  I get the same results using either.  In each case I give amarok ~15s after device notifier before I eject the CD.
Comment 1 Myriam Schweingruber 2010-03-15 19:23:49 UTC
Could you please try again with Amarok 2.3, to be released later this week and report back. I can't reproduce this here with current Amarok 2.3-git
Comment 2 Paul Worrall 2010-03-16 20:38:23 UTC
Created attachment 41693 [details]
Output of amarok --debug when inserting Audio CD
Comment 3 Paul Worrall 2010-03-16 20:40:05 UTC
No improvement with 2.3 :-(  See comment #2 for a section of the amarok --debug output around the time when I insert an audio CD
Comment 4 Myriam Schweingruber 2010-03-16 20:59:15 UTC
Output from Comment #2:

amarok: BEGIN: void MountPointManager::deviceAdded(const QString&) 
amarok: END__: void MountPointManager::deviceAdded(const QString&) - Took 0.069s 
amarok: BEGIN: void MediaDeviceCache::slotAddSolidDevice(const QString&) 
amarok:   [MediaDeviceCache] Found new Solid device with udi =  "/org/freedesktop/Hal/devices/volume_part_1_size_693325824" 
amarok:   [MediaDeviceCache] Device name is =  "Volume"  and was made by  "" 
amarok:   [MediaDeviceCache] device is an Audio CD 
amarok:   BEGIN: void MediaDeviceMonitor::deviceAdded(const QString&) 
amarok:     BEGIN: void MediaDeviceMonitor::checkDevice(const QString&) 
amarok:       BEGIN: virtual bool MtpConnectionAssistant::identify(const QString&) 
amarok:          Not a PMP 
amarok:       END__: virtual bool MtpConnectionAssistant::identify(const QString&) - Took 0.02s 
amarok:       BEGIN: virtual bool AudioCdConnectionAssistant::identify(const QString&) 
amarok:          OpticalDisc 
amarok:          AudioCd 
amarok:       END__: virtual bool AudioCdConnectionAssistant::identify(const QString&) - Took 0.00015s 
amarok:       [MediaDeviceMonitor] Device identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_693325824" 
amarok:       BEGIN: virtual void ConnectionAssistant::tellIdentified(const QString&) 
amarok:         BEGIN: const QString MediaDeviceCache::volumeMountPoint(const QString&) const 
amarok:           [MediaDeviceCache] Not able to convert to StorageAccess or not accessible, returning empty 
amarok:         END__: const QString MediaDeviceCache::volumeMountPoint(const QString&) const - Took 9.4e-05s 
amarok:         BEGIN: AudioCdCollection::AudioCdCollection(MediaDeviceInfo*) 
amarok:            Getting Audio CD info 
amarok:           BEGIN: Meta::MediaDeviceHandler::MediaDeviceHandler(QObject*) 
amarok:           END__: Meta::MediaDeviceHandler::MediaDeviceHandler(QObject*) - Took 0.0052s 
amarok:         END__: AudioCdCollection::AudioCdCollection(MediaDeviceInfo*) - Took 0.02s 
amarok:         BEGIN: void MediaDeviceCollection::slotAttemptConnectionDone(bool) 
amarok:           [MediaDeviceCollection] connection failed, not scanning 
amarok:           BEGIN: void MediaDeviceCollectionFactoryBase::slotDeviceDisconnected(const QString&) 
amarok:           END__: void MediaDeviceCollectionFactoryBase::slotDeviceDisconnected(const QString&) - Took 8.1e-05s 
amarok:         END__: void MediaDeviceCollection::slotAttemptConnectionDone(bool) - Took 0.00039s 
amarok:       END__: virtual void ConnectionAssistant::tellIdentified(const QString&) - Took 0.02s 
amarok:       [MediaDeviceMonitor] Device already identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_693325824" 
amarok:       [MediaDeviceMonitor] Device already identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_693325824" 
amarok:     END__: void MediaDeviceMonitor::checkDevice(const QString&) - Took 0.047s 
amarok:   END__: void MediaDeviceMonitor::deviceAdded(const QString&) - Took 0.048s 
amarok: END__: void MediaDeviceCache::slotAddSolidDevice(const QString&) - Took 0.096s
Comment 5 Myriam Schweingruber 2010-03-16 21:04:53 UTC
Well, judging from the output Amarok sees the CD. Now why it doesn't read it... not sure the audiocd KIO slave shouldn't start reading it but doesn't show up, or does your output show any later information about that?
Comment 6 Paul Worrall 2010-03-17 23:50:13 UTC
No, no info about audiocd, BUT... I disconnected one of the CD drives (so that there's only one), and it now works OK, so maybe its detecting the CD and then not looking on the right drive to read it, or something like that?
Comment 7 Damián Muzzio 2010-05-07 17:35:12 UTC
Same bug here. I have to disconnect one CD drive in order to play an audio CD. And wenn I do, the tracks are displayed as they had a length of 0:00, and as a consequence they are not scrobbled to last.fm. 

I'm using Versión Amarok 2.3.0 and KDE 4.4.2 from Kubuntu 10.04 LTS
Comment 8 G.G. 2010-05-17 12:37:04 UTC
Amarok does not read audio CD on dual DVD drive system.
I'm using Amarok 2.3.0 and KDE 4.4.2 from Kubuntu 10.04 LTS.
I have a dvd rom and a dvdrw.
I have this same problem also.
K3b recognizes both drives.
Comment 9 Sven Krohlas 2010-05-18 15:28:47 UTC
*** Bug 237853 has been marked as a duplicate of this bug. ***
Comment 10 Ian Wood 2010-05-30 15:52:28 UTC
I have the same problem. 
I'm using Amarok 2.3.0 and KDE 4.4.2 from Ubuntu 10.04 (lucid)
It's a laptop with internal CD-RW/DVD drive and a USB external DVD-RW.

This debug text starts just before I put a cd in the external drive:
http://pastebin.ca/1874185

When I removed the usb external drive and tried the internal one, I got the track list, but Amarok stopped at 0% when I tried to rip the cd. This CD drive has problems with RythmBox (ripped items are sometimes broken), so it's suspect, though Rythmbox does get something off it.

I might try removing the internal CD, see if I can use the external only.
Comment 11 Myriam Schweingruber 2010-05-30 19:07:16 UTC
Confirmed by comment #10
Comment 12 Ian Wood 2010-05-31 04:53:29 UTC
Update: I removed the internal (scsi) CD, though the system still seems to expect it to exist, which may complicate things. Initially, the cd and tracks were recognised, but the playlist showed 0 duration (though the, what is it.. 'in track position indicator slider'? seemed to show the correct track duration).

I ran amarok again, this time collecting debug info. This time, when I inserted a cd, amarok didn't show it in the 'local music' list. Here is the full debug output until some time after inserting the cd:

http://pastebin.ca/1874645

CD detection etc.. looks to be around line 2039 (pastbin shows line '039'), right at the end.

If it would be useful for me to run any other tests, let me know. (though my technical expertise with linux is none too deep)
Comment 13 Ian Wood 2010-05-31 04:54:26 UTC
This forum discussion also talks about this bug, and has a few debug traces:

http://forum.kde.org/viewtopic.php?f=115&t=85177&start=30

Apologies for multiple posts..
Comment 14 Myriam Schweingruber 2010-05-31 23:12:48 UTC
(In reply to comment #12)
> This time, when I inserted
> a cd, amarok didn't show it in the 'local music' list. Here is the full debug
> output until some time after inserting the cd:
> 
> http://pastebin.ca/1874645
> 
> CD detection etc.. looks to be around line 2039 (pastbin shows line '039'),
> right at the end.
> 
> If it would be useful for me to run any other tests, let me know. (though my
> technical expertise with linux is none too deep)

Could you please attach the output, but only the relevant part? Pastebins tend to disappear after a certain time. Alos make sure you only startup amarok, put the CD in and go to the local Music and try to play the CD, then quit Amarok again.
Comment 15 Ian Wood 2010-06-01 06:09:14 UTC
Relevant part from pastebin in comment #12

amarok: BEGIN: void MountPointManager::deviceAdded(const QString&)
amarok: END__: void MountPointManager::deviceAdded(const QString&) - Took 0.017s
amarok: BEGIN: void MediaDeviceCache::slotAddSolidDevice(const QString&)
amarok:   [MediaDeviceCache] Found new Solid device with udi =  "/org/freedesktop/Hal/devices/volume_part_1_size_494366720"
amarok:   [MediaDeviceCache] Device name is =  "Volume"  and was made by  ""
amarok:   [MediaDeviceCache] device is an Audio CD
amarok:   BEGIN: void MediaDeviceMonitor::deviceAdded(const QString&)
amarok:     BEGIN: void MediaDeviceMonitor::checkDevice(const QString&)
amarok:       BEGIN: virtual bool AudioCdConnectionAssistant::identify(const QString&)
amarok:          OpticalDisc
amarok:          AudioCd
amarok:       END__: virtual bool AudioCdConnectionAssistant::identify(const QString&) - Took 0.00043s
amarok:       [MediaDeviceMonitor] Device identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_494366720"
amarok:       BEGIN: virtual void ConnectionAssistant::tellIdentified(const QString&)
amarok:         BEGIN: const QString MediaDeviceCache::volumeMountPoint(const QString&) const
amarok:           [MediaDeviceCache] Not able to convert to StorageAccess or not accessible, returning empty
amarok:         END__: const QString MediaDeviceCache::volumeMountPoint(const QString&) const - Took 0.00045s
amarok:         BEGIN: AudioCdCollection::AudioCdCollection(MediaDeviceInfo*)
amarok:            Getting Audio CD info
amarok:           BEGIN: Meta::MediaDeviceHandler::MediaDeviceHandler(QObject*)
amarok:           END__: Meta::MediaDeviceHandler::MediaDeviceHandler(QObject*) - Took 0.00029s
amarok:         END__: AudioCdCollection::AudioCdCollection(MediaDeviceInfo*) - Took 0.0021s
amarok:         BEGIN: void MediaDeviceCollection::slotAttemptConnectionDone(bool)
amarok:           [MediaDeviceCollection] connection failed, not scanning
amarok:           BEGIN: void MediaDeviceCollectionFactoryBase::slotDeviceDisconnected(const QString&)
amarok:           END__: void MediaDeviceCollectionFactoryBase::slotDeviceDisconnected(const QString&) - Took 0.00019s
amarok:         END__: void MediaDeviceCollection::slotAttemptConnectionDone(bool) - Took 0.0098s
amarok:       END__: virtual void ConnectionAssistant::tellIdentified(const QString&) - Took 0.015s
amarok:       [MediaDeviceMonitor] Device already identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_494366720"
amarok:       [MediaDeviceMonitor] Device already identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_494366720"
amarok:       [MediaDeviceMonitor] Device already identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_494366720"
amarok:     END__: void MediaDeviceMonitor::checkDevice(const QString&) - Took 0.017s
amarok:   END__: void MediaDeviceMonitor::deviceAdded(const QString&) - Took 0.017s
amarok: END__: void MediaDeviceCache::slotAddSolidDevice(const QString&) - Took 0.022s
amarok: BEGIN: void ScanManager::startIncrementalScan(const QString&)
amarok:   BEGIN: void ScanManager::checkTables(bool)
amarok:   END__: void ScanManager::checkTables(bool) - Took 0.00024s
amarok:   BEGIN: QStringList ScanManager::getDirsToScan()
amarok:   END__: QStringList ScanManager::getDirsToScan() - Took 0.027s
amarok:    GOING TO SCAN:
amarok:    "(a *lot*: 315 directories)"
amarok:   BEGIN: void ScanManager::writeBatchIncrementalInfoFile()
amarok:   END__: void ScanManager::writeBatchIncrementalInfoFile() - Took 0.00099s
amarok:   BEGIN: XmlParseJob::XmlParseJob(ScanManager*, SqlCollection*)
amarok:     BEGIN: ProgressBar* ProgressBar::setAbortSlot(QObject*, const char*)
amarok:        Setting abort slot for  "Scanning music"
amarok:        connecting to  1abort()
amarok:     END__: ProgressBar* ProgressBar::setAbortSlot(QObject*, const char*) - Took 0.00035s
amarok:   END__: XmlParseJob::XmlParseJob(ScanManager*, SqlCollection*) - Took 0.0028s
amarok:   BEGIN: virtual void XmlParseJob::run()
amarok:   END__: void ScanManager::startIncrementalScan(const QString&) - Took 0.04s
amarok:    Success. Committing result to database.
amarok:    Database temporary table setup did not complete due to no directories needing to be processed.
amarok: END__: virtual void XmlParseJob::run() - Took 0.11s
amarok: BEGIN: virtual XmlParseJob::~XmlParseJob()
amarok:   BEGIN: void StatusBar::hideProgress()
amarok:   END__: void StatusBar::hideProgress() - Took 0.0012s
amarok: END__: virtual XmlParseJob::~XmlParseJob() - Took 0.0024s
amarok: BEGIN: void ScanManager::slotFinished()
amarok: END__: void ScanManager::slotFinished() - Took 0.00084s 

On this run, I did nothing other than start amarok and insert a cd, though amarok was playing some music (that had been playing last time I quit)

Note that I had (physically) removed the scsi cd drive, but some remnant remains (eg: nautilus 2.30.1 shows 'cdrom0', but is 'unable to mount cdrom0' as 'special device /dev/scd0 does not exist'. 

I put the cd into an external usb cd/dvd drive. Nautilus, rythymbox etc.. detected the inserted cd normally. Strangely, the unmountable 'cdrom0' disappeared from nautilus after inserting a cd in the external drive.
Comment 16 Ian Wood 2010-06-01 06:18:41 UTC
content of pastbin from comment #10 below..

What i did: 
 - launch amarok --debug
 - insert a cd in the external drive
 - wait till cd stops spinning and a few minutes more
 - copy debug output from just before I inserted cd

(Note that in this trial, the scsi cd was physically present - see end of comment #15)

(In reply to comment #10)
> I have the same problem. 
> I'm using Amarok 2.3.0 and KDE 4.4.2 from Ubuntu 10.04 (lucid)
> It's a laptop with internal CD-RW/DVD drive and a USB external DVD-RW.
> 
> This debug text starts just before I put a cd in the external drive:
> http://pastebin.ca/1874185
> 
> When I removed the usb external drive and tried the internal one, I got the
> track list, but Amarok stopped at 0% when I tried to rip the cd. This CD drive
> has problems with RythmBox (ripped items are sometimes broken), so it's
> suspect, though Rythmbox does get something off it.

amarok: BEGIN: void MountPointManager::deviceAdded(const QString&)
amarok: END__: void MountPointManager::deviceAdded(const QString&) - Took 0.023s
amarok: BEGIN: void MediaDeviceCache::slotAddSolidDevice(const QString&)
amarok:   [MediaDeviceCache] Found new Solid device with udi =  "/org/freedesktop/Hal/devices/volume_part_1_size_454088704"
amarok:   [MediaDeviceCache] Device name is =  "Volume"  and was made by  ""
amarok:   [MediaDeviceCache] device is an Audio CD
amarok:   BEGIN: void MediaDeviceMonitor::deviceAdded(const QString&)
amarok:     BEGIN: void MediaDeviceMonitor::checkDevice(const QString&)
amarok:       BEGIN: virtual bool AudioCdConnectionAssistant::identify(const QString&)
amarok:          OpticalDisc
amarok:          AudioCd
amarok:       END__: virtual bool AudioCdConnectionAssistant::identify(const QString&) - Took 0.00068s
amarok:       [MediaDeviceMonitor] Device identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_454088704"
amarok:       BEGIN: virtual void ConnectionAssistant::tellIdentified(const QString&)
amarok:         BEGIN: const QString MediaDeviceCache::volumeMountPoint(const QString&) const
amarok:           [MediaDeviceCache] Not able to convert to StorageAccess or not accessible, returning empty
amarok:         END__: const QString MediaDeviceCache::volumeMountPoint(const QString&) const - Took 0.00032s
amarok:         BEGIN: AudioCdCollection::AudioCdCollection(MediaDeviceInfo*)
amarok:            Getting Audio CD info
amarok:           BEGIN: Meta::MediaDeviceHandler::MediaDeviceHandler(QObject*)
amarok:           END__: Meta::MediaDeviceHandler::MediaDeviceHandler(QObject*) - Took 0.00026s
amarok:         END__: AudioCdCollection::AudioCdCollection(MediaDeviceInfo*) - Took 0.0049s
amarok:         BEGIN: void MediaDeviceCollection::slotAttemptConnectionDone(bool)
amarok:           [MediaDeviceCollection] starting full scan
amarok:           BEGIN: virtual void AudioCdCollection::startFullScan()
amarok:             BEGIN: void AudioCdCollection::readCd()
amarok:             END__: void AudioCdCollection::readCd() - Took 0.0028s
amarok:             BEGIN: void CollectionManager::slotNewCollection(Amarok::Collection*)
amarok:             END__: void CollectionManager::slotNewCollection(Amarok::Collection*) - Took 0.012s
amarok:           END__: virtual void AudioCdCollection::startFullScan() - Took 0.017s
amarok:         END__: void MediaDeviceCollection::slotAttemptConnectionDone(bool) - Took 0.017s
amarok:       END__: virtual void ConnectionAssistant::tellIdentified(const QString&) - Took 0.023s
amarok:       [MediaDeviceMonitor] Device already identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_454088704"
amarok:       [MediaDeviceMonitor] Device already identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_454088704"
amarok:       [MediaDeviceMonitor] Device already identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_454088704"
amarok:     END__: void MediaDeviceMonitor::checkDevice(const QString&) - Took 0.026s
amarok:   END__: void MediaDeviceMonitor::deviceAdded(const QString&) - Took 0.027s
amarok: END__: void MediaDeviceCache::slotAddSolidDevice(const QString&) - Took 0.037s
amarok: BEGIN: virtual void CollectionTreeItemModel::collectionAdded(Amarok::Collection*)
amarok:    [WARNING!] failed: an unexpected comparison was made
amarok:   BEGIN: virtual float Meta::MediaDeviceHandler::usedcapacity() const
amarok:   END__: virtual float Meta::MediaDeviceHandler::usedcapacity() const - Took 0.0043s
amarok:   BEGIN: virtual float Meta::MediaDeviceHandler::totalcapacity() const
amarok:   END__: virtual float Meta::MediaDeviceHandler::totalcapacity() const - Took 0.00018s
amarok: END__: virtual void CollectionTreeItemModel::collectionAdded(Amarok::Collection*) - Took 0.01s
amarok: BEGIN: void AudioCdCollection::infoFetchComplete(KJob*)
amarok:    [ERROR!] 101
amarok:   BEGIN: void AudioCdCollection::noInfoAvailable()
amarok:   END__: void AudioCdCollection::noInfoAvailable() - Took 0.088s
amarok:   BEGIN: bool MainWindow::isWaitingForCd()
amarok:     [MainWindow] waiting?:  false
amarok:   END__: bool MainWindow::isWaitingForCd() - Took 0.00032s
amarok: END__: void AudioCdCollection::infoFetchComplete(KJob*) - Took 0.089s
amarok: BEGIN: virtual bool Meta::AudioCdAlbum::isCompilation() const
amarok: END__: virtual bool Meta::AudioCdAlbum::isCompilation() const - Took 0.0003s
amarok: BEGIN: void ScanManager::startIncrementalScan(const QString&)
amarok:   BEGIN: void ScanManager::checkTables(bool)
amarok:   END__: void ScanManager::checkTables(bool) - Took 0.00029s
amarok:   BEGIN: QStringList ScanManager::getDirsToScan()
amarok:   END__: QStringList ScanManager::getDirsToScan() - Took 0.027s
amarok:    GOING TO SCAN:
amarok:    "(a *lot*: 310 directories)"
amarok:   BEGIN: void ScanManager::writeBatchIncrementalInfoFile()
amarok:   END__: void ScanManager::writeBatchIncrementalInfoFile() - Took 0.00082s
amarok:   BEGIN: XmlParseJob::XmlParseJob(ScanManager*, SqlCollection*)
amarok:     BEGIN: ProgressBar* ProgressBar::setAbortSlot(QObject*, const char*)
amarok:        Setting abort slot for  "Scanning music"
amarok:        connecting to  1abort()
amarok:     END__: ProgressBar* ProgressBar::setAbortSlot(QObject*, const char*) - Took 0.00039s
amarok:   END__: XmlParseJob::XmlParseJob(ScanManager*, SqlCollection*) - Took 0.0026s
amarok:   BEGIN: virtual void XmlParseJob::run()
amarok:   END__: void ScanManager::startIncrementalScan(const QString&) - Took 0.04s
amarok:    Success. Committing result to database.
amarok:    Database temporary table setup did not complete due to no directories needing to be processed.
amarok: END__: virtual void XmlParseJob::run() - Took 0.097s
amarok: BEGIN: virtual XmlParseJob::~XmlParseJob()
amarok:   BEGIN: void StatusBar::hideProgress()
amarok:   END__: void StatusBar::hideProgress() - Took 0.0014s
amarok: END__: virtual XmlParseJob::~XmlParseJob() - Took 0.0026s
amarok: BEGIN: void ScanManager::slotFinished()
amarok: END__: void ScanManager::slotFinished() - Took 0.001s
amarok: BEGIN: void ScanManager::startIncrementalScan(const QString&)
amarok:   BEGIN: void ScanManager::checkTables(bool)
amarok:   END__: void ScanManager::checkTables(bool) - Took 0.00026s
amarok:   BEGIN: QStringList ScanManager::getDirsToScan()
amarok:   END__: QStringList ScanManager::getDirsToScan() - Took 0.056s
amarok:    GOING TO SCAN:
amarok:    "(a *lot*: 310 directories)"
amarok:   BEGIN: void ScanManager::writeBatchIncrementalInfoFile()
amarok:   END__: void ScanManager::writeBatchIncrementalInfoFile() - Took 0.0014s
amarok:   BEGIN: XmlParseJob::XmlParseJob(ScanManager*, SqlCollection*)
amarok:     BEGIN: ProgressBar* ProgressBar::setAbortSlot(QObject*, const char*)
amarok:        Setting abort slot for  "Scanning music"
amarok:        connecting to  1abort()
amarok:     END__: ProgressBar* ProgressBar::setAbortSlot(QObject*, const char*) - Took 0.00089s
amarok:   END__: XmlParseJob::XmlParseJob(ScanManager*, SqlCollection*) - Took 0.0057s
amarok:   BEGIN: virtual void XmlParseJob::run()
amarok:   END__: void ScanManager::startIncrementalScan(const QString&) - Took 0.077s
amarok:    Success. Committing result to database.
amarok:    Database temporary table setup did not complete due to no directories needing to be processed.
amarok: END__: virtual void XmlParseJob::run() - Took 0.088s
amarok: BEGIN: virtual XmlParseJob::~XmlParseJob()
amarok:   BEGIN: void StatusBar::hideProgress()
amarok:   END__: void StatusBar::hideProgress() - Took 0.001s
amarok: END__: virtual XmlParseJob::~XmlParseJob() - Took 0.002s
amarok: BEGIN: void ScanManager::slotFinished()
amarok: END__: void ScanManager::slotFinished() - Took 0.00098s
Comment 17 Ian Wood 2010-06-01 06:59:56 UTC
Created attachment 47543 [details]
full debug output for inserted cd

In case there is something useful in there, I've attached the full debug output from :
 - amarok -d > amarok-debug-insertcd.txt 2>&1
 - pause amarok (it launched with a track playing)
 - insert a cd in external drive (amarok showed a cd with 0 tracks)
 - eject the cd
 - quit amarok

(note: for this trace, I have re-connected the second, scsi cd drive. Physically removing it seemed to cause more trouble than not)
Comment 18 Myriam Schweingruber 2010-06-01 13:32:19 UTC
Looks like a problem with either HAL or the kio-audiocd slave, will have to explore that...
Comment 19 Rick Stockton 2010-07-21 01:36:21 UTC
(In reply to comment #18)
> Looks like a problem with either HAL or the kio-audiocd slave, will have to
> explore that...
Hi, Myriam. I haven't begun to look at your code, and probably won't try (my wife would KILL me ;). But I spent many years as a professional software tester, and I believe that the following simple tests rule out HAL -- and offer an approach to solving the problem. I have two DVD/RW devices, one is PATA/SCSI and the other is SATA/SCSI. Amaronk is fully functional on /dev/sr1, and (per the problem) can't see the tracks when CD-audio is loaded into /dev/sr0. I use Amaronk 2.3.1 on KDE 4.4.3, on a desktop running the brand-new Mandriva 2010.1 586/686 Distro. In all tests, /dev/sr0 is the "problem drive": 

FIRST TEST (confirming the bug): When a CD is loaded into /dev/sr0, with nothing loaded into /dev/sr1: Amaronk "sees" notification of the new CD, but  can't/won't build an index of tracks to work with (or play).

SECOND TEST (new): CD is loaded into /dev/sr0 after Amaronk is initialized and GUI has appeared. (The problem occurs, of course.) Test is to issue "Eject" from within the Amaronk GUI. Result: IT WORKS. My conclusion? Linkage into HAL/udev seems solid.

THIRD TEST (new): Initialize Amaronk, wait for GUI. The loaded a CD into the "good" drive, /dev/sr1. KDE notification of "audio CD" appears, and Amaronk creates a good index of tracks. Test is to different CD into the "bad" drive. The *single* entry for "Audio CD" is updated to show zero tracks. (BTW, the CD in the "good" drive has 14 tracks, and the CD in the "bad" drive has 18.)

Conclusions: Amaronk is incapable of showing two loaded CD drives at the same time. When the second drive (the "bad" one) is loaded, Amaronk fails to inspect it's list of tracks correctly-- even though it does have the correct UID.

If the "bad" drive is loaded while the good drive still holds a CD, a different error is thrown-- and depending on which one get's KDE's attention first, you may or may not see the CD shown with "zero tracks". But in all cases, you will see only one CD.

I will show the --debug log entries in the next comments, they *DO* show that errors have been detected.
Comment 20 Rick Stockton 2010-07-21 02:23:41 UTC
For the case of loading a CD into the "bad" drive, this is probably the relevant snippet (same as part of Ian Wood's, above). First four lines are just FYI, and I have re-formatted with single-space indentation. 

   [MediaDeviceMonitor] Device already identified with udi:  "/org/freedesktop/Hal/devices/volume_part_1_size_371634176" 
  END__: void MediaDeviceMonitor::checkDevice(const QString&) - Took 0.0085s 
 END__: void MediaDeviceMonitor::deviceAdded(const QString&) - Took 0.0086s 
END__: void MediaDeviceCache::slotAddSolidDevice(const QString&) - Took 0.012s

BEGIN: virtual void CollectionTreeItemModel::collectionAdded(Collections::Collection*) 
  [WARNING!] failed: an unexpected comparison was made 


*** Something critical probably went wrong right there; Maybe we've built (or are trying to build) an invalid tree model for the CD and it's "child" audio tracks. I'll SWAG that the audio tracks can't be shown because the CD content tree couldn't be built. Does the "unexpected comparison" lead to the creation of an unusable, default-case Collection? ***

 BEGIN: virtual float Meta::MediaDeviceHandler::usedcapacity() const 
 END__: virtual float Meta::MediaDeviceHandler::usedcapacity() const - Took 8.6e-05s 
 BEGIN: virtual float Meta::MediaDeviceHandler::totalcapacity() const 
 END__: virtual float Meta::MediaDeviceHandler::totalcapacity() const - Took 0.00022s 

*** those probably worked ***

END__: virtual void CollectionTreeItemModel::collectionAdded(Collections::Collection*) - Took 0.0018s

*** and now, we pass our broken collection (the unbuilt/misbuilt CollectionTree) into further processing, and GUI display (of no tracks found) ***
 
BEGIN: void CollectionTreeItemModelBase::handleSpecialQueryResult(CollectionTreeItem::Type, Collections::QueryMaker*, const Meta::DataList&) 
[CollectionTreeItemModelBase] Received special data:  0 
END__: void CollectionTreeItemModelBase::handleSpecialQueryResult(CollectionTreeItem::Type, Collections::QueryMaker*, const Meta::DataList&) - Took 0.00011s
 
BEGIN: void Collections::AudioCdCollection::infoFetchComplete(KJob*) 
 [ERROR!] 101 
BEGIN: void Collections::AudioCdCollection::noInfoAvailable()
BEGIN: virtual void CollectionTreeItemModelBase::listForLevel(int, Collections::QueryMaker*, CollectionTreeItem*) 

*** this routine was repeated 3x in my case, and then they return to the parent 'cleanup' routine AudioCdCollection::noInfoAvailable(), which returns to AudioCdCollection::infoFetchComplete(KJob*) ****

And so: without looking at it, I'll SWAG that the bug is probably not within AudioCdCollection::infoFetchComplete(KJob*) , but rather within Amarok trying to create an "invalid, unacceptable" Tree Model -- and the problem is almost certainly tied to Amarok manipulation of a "MediaDevicexxxx" class for these 2nd (and 3rd, etc.) local drives.

Obviously, the ways into "[ERROR!] 101" within AudioCdCollection::infoFetchComplete(KJob*) are the first place to look, even though it probably isn't the root cause of "zero tracks shown". (It's more likely only a result of asking it to work with the invalid AudioCdCollection).
Comment 21 Rick Stockton 2010-07-21 02:42:23 UTC
With a valid CD in the "bad" drive, loading another valid CD into the "good" drive provokes error #111 ... before the "good drive" is scanned and displayed properly. It looks as if infoFetchComplete() is designed to work with all CD instances when called, and it throws this error when one CD TreeItem is valid and another is not:

amarok: BEGIN: void Collections::AudioCdCollection::infoFetchComplete(KJob*) 
amarok:    [ERROR!] 111 
amarok:   BEGIN: void Collections::AudioCdCollection::noInfoAvailable() 
amarok:      got track:  "audiocd:/Track 01.wav" 
amarok:      got track:  "audiocd:/Track 02.wav" 
amarok:      got track:  "audiocd:/Track 03.wav" 
amarok:      got track:  "audiocd:/Track 04.wav" 
amarok:      got track:  "audiocd:/Track 05.wav" 
amarok:      got track:  "audiocd:/Track 06.wav" 
amarok:      got track:  "audiocd:/Track 07.wav" 
amarok:      got track:  "audiocd:/Track 08.wav" 
amarok:      got track:  "audiocd:/Track 09.wav" 
amarok:      got track:  "audiocd:/Track 10.wav" 
amarok:      got track:  "audiocd:/Track 11.wav" 
amarok:      got track:  "audiocd:/Track 12.wav" 
amarok:      got track:  "audiocd:/Track 13.wav" 
amarok:      got track:  "audiocd:/Track 14.wav" 
amarok:      got track:  "audiocd:/Track 15.wav" 
amarok:      got track:  "audiocd:/Track 16.wav" 
amarok:      got track:  "audiocd:/Track 17.wav" 
amarok:      got track:  "audiocd:/Track 18.wav"

Those tracks were found for the "good" drive, of course. This is actually beginning to look like a pretty easy bug... but my wife would KILL me if I started working on a patch for it. Sorry not to be of more help.
Comment 22 Rick Stockton 2010-07-24 03:25:30 UTC
OK, I found a couple of hours and built from GIT (with full debug). When I insert a CD into the "bad" drive, not yet running "--debug", I see that Amarok is notified of a CD having been loaded- but it shows this on stdout:

<<start of snip>>

Checking /dev/cdrom for cdrom...
        Testing /dev/cdrom for SCSI/MMC interface
                SG_IO device: /dev/sr0

CDROM model sensed sensed: TSSTcorp CDDVDW SH-S223L SB02 

Checking for SCSI emulation...
        Drive is ATAPI (using SG_IO host adaptor emulation)

Checking for MMC style command set...
        Drive is MMC style
QPainter::end: Painter ended with 2 saved states
<< end of snip >>

so, it seems to be trying ONLY the device which I configured as a multimedia device in "configure your desktop"... even though this "checking" was provoked by the OTHER device (my Memorex).
Comment 23 Rick Stockton 2010-07-24 04:45:28 UTC
In contrast, when I load a CD into the "good drive" (bad drive is empty):

l
Checking /dev/cdrom for cdrom...
        Testing /dev/cdrom for SCSI/MMC interface
                SG_IO device: /dev/sr0

CDROM model sensed sensed: TSSTcorp CDDVDW SH-S223L SB02 

Checking for SCSI emulation...
        Drive is ATAPI (using SG_IO host adaptor emulation)
Checking /dev/cdrom for cdrom...
        Testing /dev/cdrom for SCSI/MMC interface
                SG_IO device: /dev/sr0

CDROM model sensed sensed: TSSTcorp CDDVDW SH-S223L SB02 

Checking for SCSI emulation...
        Drive is ATAPI (using SG_IO host adaptor emulation)

Checking for MMC style command set...
        Drive is MMC style
amarok: BEGIN: void Collections::AudioCdCollection::infoFetchComplete(KJob*) 
amarok:    [ERROR!] 111 
amarok:   BEGIN: void Collections::AudioCdCollection::noInfoAvailable() 
123 A Cappella
 34 Acid
 74 Acid Jazz
<<snip listing of music categories>>
 28 Vocal
Checking /dev/cdrom for cdrom...
        Testing /dev/cdrom for SCSI/MMC interface
                SG_IO device: /dev/sr0

CDROM model sensed sensed: TSSTcorp CDDVDW SH-S223L SB02 

Checking for SCSI emulation...
        Drive is ATAPI (using SG_IO host adaptor emulation)

Checking for MMC style command set...
        Drive is MMC style
        DMA scatter/gather table entries: 1
        table entry size: 131072 bytes
        maximum theoretical transfer: 55 sectors
        Setting default read size to 27 sectors (63504 bytes).

Verifying CDDA command set...
        Expected command set reads OK.
amarok:      got track:  "audiocd:/Track 01.wav" 
123 A Cappella
<<snip the categories list again>>

this repeats for each of the tracks, and then:



Checking /dev/cdrom for cdrom...
        Testing /dev/cdrom for SCSI/MMC interface
                SG_IO device: /dev/sr0

CDROM model sensed sensed: TSSTcorp CDDVDW SH-S223L SB02 

Checking for SCSI emulation...
        Drive is ATAPI (using SG_IO host adaptor emulation)

Checking for MMC style command set...
        Drive is MMC style
        DMA scatter/gather table entries: 1
        table entry size: 131072 bytes
        maximum theoretical transfer: 55 sectors
        Setting default read size to 27 sectors (63504 bytes).

Verifying CDDA command set...
QPainter::end: Painter ended with 2 saved states
        Expected command set reads OK.
amarok:      Initialized thread, count== 5 
amarok:   END__: void Collections::AudioCdCollection::noInfoAvailable() - DELAY Took (quite long) 10s 
amarok:   BEGIN: bool MainWindow::isWaitingForCd() 
amarok:     [MainWindow] waiting?:  false 
amarok:   END__: bool MainWindow::isWaitingForCd() - Took 6.4e-05s 
amarok: END__: void Collections::AudioCdCollection::infoFetchComplete(KJob*) - DELAY Took (quite long) 10s 
amarok: BEGIN: virtual bool Meta::AudioCdAlbum::isCompilation() const 
amarok: END__: virtual bool Meta::AudioCdAlbum::isCompilation() const - Took 6.9e-05s 
amarok: BEGIN: virtual bool Meta::AudioCdAlbum::isCompilation() const 
amarok: END__: virtual bool Meta::AudioCdAlbum::isCompilation() const - Took 5.4e-05s

It seems as if the problem consists of mis-identification of the drive which needs scanning. We always scan the "good" drive, even thou we ARE capable of performing an "eject" action on the "bad" drive if it has been shown (with zero tracks) in the GUI.
Comment 24 Myriam Schweingruber 2010-07-24 11:54:48 UTC
Which is clearly not an Amarok problem, as this detection is made by SOLID and reading the DVD is done by the kioslave, which doesn't start to read. 

In my opinion this is still something to be push to kioslave or to solid, Amarok does absolutely nothing itself in hardware detection.
Comment 25 Rick Stockton 2010-07-24 21:15:37 UTC
Thanks for the advice, Myriam! I will try to proceed with this issue, and isolate it's cause -- in whichever place it turns out to be (Solid framework and/or kio). I have a question for you:

In your comment #1, you couldn't reproduce the problem. When you load Audio CD devices into both drives, do they both auto-magically appear as separate audio CD's within the "local music" panel, or do you need to go through the "play media..." menu item to select the one you want to work with?

(If they're both in the panel, then fixes to kio and/or Solid, not yet present in my MDV 2010.1 KDE 4.4.3 software but already running in your box are almost certainly the solution.)
Comment 26 Rick Stockton 2010-07-24 21:31:59 UTC
With CDs insterted into both drives, the output of 'solid-hardware list' includes the following items:

root@localhost rick]# solid-hardware list
udi = '/org/freedesktop/Hal/devices/volume_part_1_size_665593856'
udi = '/org/freedesktop/Hal/devices/volume_part_1_size_621725696'
udi = '/org/freedesktop/Hal/devices/storage_model_CDDVDW_SH_S223L'
<< snipped soundcard resources >>
udi = '/org/freedesktop/Hal/devices/storage_model_DVD__RAM_530L_v1'
<< snipped everything else >>

So even back at my KDE 4.4.3, SOLID sees the two audio cd volumes. Problem seems to be happening a bit higher up (in kio, or in notification to Amarok.)
Comment 27 Myriam Schweingruber 2010-07-24 21:35:04 UTC
I never tried on a dual drive system as I don't have it, but if you read the original report again it was an error reported on both drives, it was not clear to me this was related to a dual drive system.
Comment 28 Rick Stockton 2010-07-25 11:26:19 UTC
Myriam, I have found that changing the hard-coded setting of "device=dev/cdrom" to "device=dev/cdrom1" within the [CDDA] section of file ".kde4/share/config/kcmaudiocdrc" causes the problem to become completely mixed up:

The directory of Tracks on a CD is displayed when I load into the formerly *bad* drive, while loading or ejecting another CD into the fomerly "good" drive resets the media display to zero tracks. The Playlist-->"Add Media" FileChooser panel shows both "Audio CD" on the left as separate places, but the only directory of tracks which can be shown corresponds to one of them -- not the other.

When set this way, I can't actually play anything. Probably, there's a another routine which reads the CD Data (rather than the track info) and it's still hard-wired to "dev/cdrom". In this experiment, I can get the track index and then fail to play the songs; or (on the formerly "good" drive) I COULD HAVE played them-- but can't get the track index to find out where they are. My test seems to have assigned the "get the index" and "play the tracks" routines to the two different drives. Ian Wood, in comment 10, may have had a nearly identical situation, with "get the index" mapped to one drive and "RIP the tracks" mapped to the other.

It looks like your earlier comment was correct: This bug almost certainly gets pushed into the kio toolkit, where routines which Amarok uses are not even getting mapped to such devices as "dev/cdrom" and "dev/cdrom1"-- much less HAL or udev-generated dynamic IDs.
Comment 29 Rick Stockton 2010-07-27 04:10:06 UTC
Upon a 'fresh' restart of the whole computer, the "good" drive again works. When I try to "Add media" to the empty collection, the 2nd Audio CD (loaded into the "bad" drive) is being shown as a root item in "Places". But, when I try to select it (by single-click OR double-click, although I'm configured for single-click) the FileBrowser pops itself up to the "good" CD and shows the track index for that device.

Here's the --debug sequence:

amarok: END__: void ScanManager::slotFinished() - Took 0.00014s 
amarok:  Drop from external source or file browser 
amarok: BEGIN: void Playlist::Controller::slotFinishDirectoryLoader(const Meta::TrackList&) 
amarok: END__: void Playlist::Controller::slotFinishDirectoryLoader(const Meta::TrackList&) - Took 8e-05s 
amarok:  Drop from external source or file browser 
amarok: BEGIN: void Playlist::Controller::slotFinishDirectoryLoader(const Meta::TrackList&) 
amarok: END__: void Playlist::Controller::slotFinishDirectoryLoader(const Meta::TrackList&) - Took 0.00011s 
amarok: BEGIN: virtual void ScanManager::startIncrementalScan(const QString&) 
amarok:   BEGIN: void ScanManager::checkTables(bool) 
amarok:   END__: void ScanManager::checkTables(bool) - Took 5.9e-05s 
amarok:   BEGIN: QStringList ScanManager::getDirsToScan() 
amarok:   END__: QStringList ScanManager::getDirsToScan() - Took 0.00036s 
amarok:   [ScanManager] GOING TO SCAN: 
amarok:   [ScanManager]      "/home/rick/Music/_AMAROKMTIME_1277610295" 
amarok:   BEGIN: void ScanManager::writeBatchIncrementalInfoFile() 
amarok:   END__: void ScanManager::writeBatchIncrementalInfoFile() - Took 0.00024s 
amarok:   BEGIN: XmlParseJob::XmlParseJob(ScanManager*, Collections::SqlCollection*) 
amarok:     BEGIN: ProgressBar* ProgressBar::setAbortSlot(QObject*, const char*, Qt::ConnectionType) 
amarok:        Setting abort slot for  "Scanning music" 
amarok:        connecting to  1abort() 
amarok:     END__: ProgressBar* ProgressBar::setAbortSlot(QObject*, const char*, Qt::ConnectionType) - Took 0.00012s 
amarok:   END__: XmlParseJob::XmlParseJob(ScanManager*, Collections::SqlCollection*) - Took 0.00086s 
amarok:   BEGIN: virtual void XmlParseJob::run() 
amarok:   END__: virtual void ScanManager::startIncrementalScan(const QString&) - Took 0.0053s 
QPainter::end: Painter ended with 2 saved states
amarok:   [ScanManager] Success. Committing result to database. 
amarok:    Database temporary table setup did not complete due to no directories needing to be processed. 
amarok: END__: virtual void XmlParseJob::run() - Took 0.023s 
amarok: BEGIN: virtual XmlParseJob::~XmlParseJob() 
amarok:   BEGIN: void StatusBar::hideProgress() 
amarok:   END__: void StatusBar::hideProgress() - Took 0.00034s 
amarok: END__: virtual XmlParseJob::~XmlParseJob() - Took 0.0006s 
amarok: BEGIN: void ScanManager::slotFinished() 
amarok: END__: void ScanManager::slotFinished() - Took 0.00015s 

IIRC, the duplicate debug messages "amarok:  Drop from external source or file browser" correspond to a double-click on the 'bad' Audio CD in this particular case.

Something comes back to Amarok, but we failed to get the track index afterwards. We think the previously stored listing, for the Audio CD in the "good" drive, is still valid, and nothing has changed. (We've got a CD, and we've got a listing of tracks, and we *THINK* that they correspond to each other -- even though they don't.) I have no idea what sort of kioslave job is invoked to do this, or why the FileBrowser wants to force the selection of the 'Audio CD' in the "bad" drive upwards in the GUI, so that it poionts at the "good" drive. Can you give me a hint where to look, within kioslave? Thanks.
Comment 30 Rick Stockton 2010-07-27 06:52:52 UTC
BTW, this misbehavior in Amarok's FileBrowser window *is* duplicated with Konqueror.
Comment 31 Rick Stockton 2010-07-27 07:21:08 UTC
And Dolphin too (as you'd expect).
Comment 32 Myriam Schweingruber 2010-07-27 09:52:09 UTC
Which just shows that this is not an Amarok problem, but lies elsewhere. Reassigning
Comment 33 Rick Stockton 2010-07-28 18:54:24 UTC
Myriam, thanks for using my research to re-assign! I'll follow Kevin's comments to assist further in any way I can. :))
Comment 34 Kevin Ottens 2010-07-28 19:16:22 UTC
From the description, it looks to me (didn't check the code though) that Amarok is in fact using the audiocd:/ URL, period. In such a case the audiocd ioslave uses the default device declared in its config.

So it's really an amarok bug at that point which should use the block information provided by solid to forge the proper audiocd:/ url. For instance
"audiocd:/?device=/dev/sr1" should access /dev/sr1, "audiocd:/?device=/dev/sr0" should access /dev/sr0, and so on.

Now longer term we could argue about solid exporting audio cds with the StorageAccess interface pointing at the right place in the audiocd ioslave. I added it on my todo list just now, but it won't hit soon so you probably want to fix Amarok first. I'll notify the Amarok crew when this admittedly easier solution will be available.
Comment 35 Rick Stockton 2010-07-29 02:17:50 UTC
Kevin, thanks. Would it be useful for you if I opened an actual bug against kio-audiocd? That way, I'll get emails about bug status changes, and I might be able to test for you-- even if it will be a long time.

Again, per comment 31, Dolphin shows two "Audio CD" locations in the "places" column (I'll call it a panel, I don't know KDE terminology). Selecting one of them causes a full set of Track icons to be shown in the "showing-contents-of-the-selection" panel in the middle of the Window.

But, trying to select the OTHER "Audio CD" in the places panel generates an  error on the Window's status bar ("Could not read."). And Dolphin auto-magically hops back up to the previously selected "Audio CD" within the "places" panel.
Comment 36 Michael Jansen 2011-01-09 05:36:09 UTC
commit 121f91675dbf68072cefe486ccdabfff922cc0d5
branch master
Author: Michael Jansen <kde@michael-jansen.biz>
Date:   Sun Jan 9 05:09:57 2011 +0100

    If the music cd is in /dev/cdrom[1-x] and not /dev/cdrom amarok failed to read the cd. For
    me it showed up as having no tracks. Now call the audiocd io slave with the correct device
    
    audiocd:/<path>?device=/dev/sr0
    
    Kudos to Kevin Ottens for the explanation. Hacking solid was no fun tho.
    
    BUG: 230462
    
    These bugs please check if it helps for your problem too.
    
    CCBUG: 254459

diff --git a/src/MediaDeviceCache.cpp b/src/MediaDeviceCache.cpp
index babb8ff..6f0c17e 100644
--- a/src/MediaDeviceCache.cpp
+++ b/src/MediaDeviceCache.cpp
@@ -30,6 +30,7 @@
 #include <solid/portablemediaplayer.h>
 #include <solid/storageaccess.h>
 #include <solid/storagedrive.h>
+#include <solid/block.h>
 #include <solid/storagevolume.h>
 
 #include <QDir>
@@ -318,6 +319,28 @@ MediaDeviceCache::deviceName( const QString &udi ) const
     return "ERR_NO_NAME"; //Should never happen!
 }
 
+const QString
+MediaDeviceCache::device( const QString &udi ) const
+{
+    DEBUG_BLOCK
+    Solid::Device device( udi );
+    Solid::Device parent( device.parent() );
+    if( !parent.isValid() )
+    {
+        debug() << udi << "has no parent, returning null string.";
+        return QString();
+    }
+
+    Solid::Block* sb = parent.as<Solid::Block>();
+    if( !sb  )
+    {
+        debug() << parent.udi() << "failed to convert to Block, returning null string.";
+        return QString();
+    }
+
+    return sb->device();
+}
+
 bool
 MediaDeviceCache::isGenericEnabled( const QString &udi ) const
 {
diff --git a/src/MediaDeviceCache.h b/src/MediaDeviceCache.h
index 11f0c01..7e8cd65 100644
--- a/src/MediaDeviceCache.h
+++ b/src/MediaDeviceCache.h
@@ -49,6 +49,7 @@ class AMAROK_EXPORT MediaDeviceCache : public QObject
         const QStringList getAll() const { return m_type.keys(); }
         MediaDeviceCache::DeviceType deviceType( const QString &udi ) const;
         const QString deviceName( const QString &udi ) const;
+        const QString device( const QString & udi ) const;
         bool isGenericEnabled( const QString &udi ) const;
         const QString volumeMountPoint( const QString &udi ) const;
 
diff --git a/src/core-impl/collections/audiocd/AudioCdCollection.cpp b/src/core-impl/collections/audiocd/AudioCdCollection.cpp
index 6cfbfb9..cb404f8 100644
--- a/src/core-impl/collections/audiocd/AudioCdCollection.cpp
+++ b/src/core-impl/collections/audiocd/AudioCdCollection.cpp
@@ -70,6 +70,7 @@ AudioCdCollection::AudioCdCollection( MediaDeviceInfo* info )
     debug() << "Getting Audio CD info";
     AudioCdDeviceInfo *cdInfo = qobject_cast<AudioCdDeviceInfo *>( info );
     m_udi = cdInfo->udi();
+    m_device = cdInfo->device();
 
     readAudioCdSettings();
 
@@ -85,7 +86,10 @@ AudioCdCollection::~AudioCdCollection()
 KUrl
 AudioCdCollection::audiocdUrl( const QString & path ) const
 {
-    return KUrl( QString( "audiocd:/" ) + path );
+    if (m_device.isNull())
+        return KUrl( QString( "audiocd:/" + path ) );
+    else
+        return KUrl( QString( "audiocd:/%1?device=%2" ).arg( path ).arg( m_device ) );
 }
 
 
diff --git a/src/core-impl/collections/audiocd/AudioCdCollection.h b/src/core-impl/collections/audiocd/AudioCdCollection.h
index a2f5935..54cd4d8 100644
--- a/src/core-impl/collections/audiocd/AudioCdCollection.h
+++ b/src/core-impl/collections/audiocd/AudioCdCollection.h
@@ -117,6 +117,7 @@ private:
     QString m_cdName;
     QString m_discCddbId;
     QString m_udi;
+    QString m_device;
     mutable int m_encodingFormat;
 
     QString m_fileNamePattern;
diff --git a/src/core-impl/collections/audiocd/support/AudioCdConnectionAssistant.cpp b/src/core-impl/collections/audiocd/support/AudioCdConnectionAssistant.cpp
index 3ca90fd..fc90e66 100644
--- a/src/core-impl/collections/audiocd/support/AudioCdConnectionAssistant.cpp
+++ b/src/core-impl/collections/audiocd/support/AudioCdConnectionAssistant.cpp
@@ -55,9 +55,8 @@ AudioCdConnectionAssistant::identify( const QString& udi )
 MediaDeviceInfo*
 AudioCdConnectionAssistant::deviceInfo( const QString& udi )
 {
-    const QString mountpoint = MediaDeviceCache::instance()->volumeMountPoint(udi);
-
-    return new AudioCdDeviceInfo( mountpoint, udi );
+    const QString device = MediaDeviceCache::instance()->device(udi);
+    return new AudioCdDeviceInfo( device, udi );
 }
 
 #include "AudioCdConnectionAssistant.moc"
diff --git a/src/core-impl/collections/audiocd/support/AudioCdDeviceInfo.cpp b/src/core-impl/collections/audiocd/support/AudioCdDeviceInfo.cpp
index 1a6ad7a..e971510 100644
--- a/src/core-impl/collections/audiocd/support/AudioCdDeviceInfo.cpp
+++ b/src/core-impl/collections/audiocd/support/AudioCdDeviceInfo.cpp
@@ -17,9 +17,9 @@
 #include "AudioCdDeviceInfo.h"
 #include "MediaDeviceInfo.h"
 
-AudioCdDeviceInfo::AudioCdDeviceInfo( QString mountpoint, QString udi )
+AudioCdDeviceInfo::AudioCdDeviceInfo( QString device, QString udi )
 : MediaDeviceInfo(),
-m_mountpoint( mountpoint )
+m_device( device )
 {
     m_udi = udi;
 }
@@ -29,9 +29,9 @@ AudioCdDeviceInfo::~AudioCdDeviceInfo()
 }
 
 QString
-AudioCdDeviceInfo::mountpoint()
+AudioCdDeviceInfo::device()
 {
-    return m_mountpoint;
+    return m_device;
 }
 
 #include "AudioCdDeviceInfo.moc"
diff --git a/src/core-impl/collections/audiocd/support/AudioCdDeviceInfo.h b/src/core-impl/collections/audiocd/support/AudioCdDeviceInfo.h
index b1d0949..499a391 100644
--- a/src/core-impl/collections/audiocd/support/AudioCdDeviceInfo.h
+++ b/src/core-impl/collections/audiocd/support/AudioCdDeviceInfo.h
@@ -23,13 +23,13 @@ class AudioCdDeviceInfo : public MediaDeviceInfo
 {
     Q_OBJECT
     public:
-        AudioCdDeviceInfo( QString mountpoint, QString udi );
+        AudioCdDeviceInfo( QString device, QString udi );
         ~AudioCdDeviceInfo();
 
-        QString mountpoint();
+        QString device();
 
     private:
-        QString m_mountpoint;
+        QString m_device;
 };
 
 #endif
Comment 37 Rick Stockton 2011-01-09 07:19:57 UTC
(In reply to comment #36)
> commit 121f91675dbf68072cefe486ccdabfff922cc0d5
> branch master
> Author: Michael Jansen <kde@michael-jansen.biz>
> Date:   Sun Jan 9 05:09:57 2011 +0100

Michael, I can't get to it for a few days- but I should be able to pull from GIT, rebuild, and verify the fix within one week. Thanks for your work on this.

Is there any dependency on recent Updates within SOLID? I'm currently running with libsolid 4.5.2 (kinda "stale", I know....)
Comment 38 Rick Stockton 2011-01-09 07:20:39 UTC
(In reply to comment #36)
> commit 121f91675dbf68072cefe486ccdabfff922cc0d5
> branch master
> Author: Michael Jansen <kde@michael-jansen.biz>
> Date:   Sun Jan 9 05:09:57 2011 +0100

Michael, I can't get to it for a few days- but I should be able to pull from GIT, rebuild, and verify the fix within one week. Thanks for your work on this.

Is there any dependency on recent Updates within SOLID? I'm currently running with libsolid 4.5.2 (kinda "stale", I know....)