Bug 135669 - audiocd:/ needs exclusive access to device
Summary: audiocd:/ needs exclusive access to device
Status: RESOLVED NOT A BUG
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: audiocd (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: icefox
URL:
Keywords:
: 150151 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-15 05:16 UTC by Gustavo Michels
Modified: 2010-04-26 21:51 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Michels 2006-10-15 05:17:00 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
Compiler:          gcc version 4.1.1 (Gentoo 4.1.1) 
OS:                Linux

When I insert an audio cd on my computer, I get a pop-up notification asking me what to do. When I choose "open in a new window", so I can use the audiocd kioslave to rip the tracks to my hd, after a while I get an error popup[1] telling me it couldn't find any devices and advising me to run the command 'cdparanoia -svQ' to check if any devices are found.

[1] http://i9.tinypic.com/2wg9pa1.png

Running the above command returns the following:

$ cdparanoia -svQ
cdparanoia III release 9.8 (March 23, 2001)
(C) 2001 Monty <monty@xiph.org> and Xiphophorus

Report bugs to paranoia@xiph.org
http://www.xiph.org/paranoia/

Checking /dev/cdrom for cdrom...
        Testing /dev/cdrom for SCSI interface
Error trying to open /dev/sr0 exclusively (Device or resource busy). retrying in 1 second.
Error trying to open /dev/sr0 exclusively (Device or resource busy). retrying in 1 second.
Error trying to open /dev/sr0 exclusively (Device or resource busy). retrying in 1 second.
Error trying to open /dev/sr0 exclusively (Device or resource busy). retrying in 1 second.
....

So the problem is cdparanoia needs exclusive access to the device, but it's not being able to have it. Here's lsof output from right after the error is shown:

# lsof /dev/sr0
COMMAND    PID     USER   FD   TYPE DEVICE SIZE NODE NAME
kio_audio 4359 gmichels   15r   BLK   11,0      4362 /dev/sr0
kio_audio 4360 gmichels   14r   BLK   11,0      4362 /dev/sr0

However, after about 5-10 minutes of inactivity, I get another "disc inserted notification", as if I had inserted a new disc, but I haven't removed or inserted any discs or whatever. And now, if I do the "open in a new window" command, it works as expected (the mp3, vorbis, flac, etc folders are shown) and I can succesfully rip the audio cd.

The output of lsof when it succesfully opens the cd:

# lsof /dev/sr0
COMMAND    PID     USER   FD   TYPE DEVICE SIZE NODE NAME
kio_audio 4360 gmichels   14r   BLK   11,0      4362 /dev/sr0

And when the ripping process is ongoing:

# lsof /dev/sr0
COMMAND     PID     USER   FD   TYPE DEVICE SIZE NODE NAME
kio_audio 10025 gmichels   15r   BLK   11,0      4362 /dev/sr0
kio_audio 10061 gmichels   14u   BLK   11,0      4362 /dev/sr0
kio_audio 10061 gmichels   15r   BLK   11,0      4362 /dev/sr0
lame      10206 gmichels   14u   BLK   11,0      4362 /dev/sr0
lame      10206 gmichels   15r   BLK   11,0      4362 /dev/sr0

To be honest, it's the first time I'm trying to use the audiocd ioslave on this computer, so I can't tell if it worked with previous versions.

I'm using cdparanoia-3.9.8 with the SG_IO patches applied, as I'm on 2.6.18. Also, it's a SATA DVD-RW, using libata.

Please ask if you need further information.
Comment 1 Jesse Barnes 2007-03-03 23:07:00 UTC
I'm seeing this too, with KDE 3.5.6 under Fedora.  Looks like an audioslave process starts up, grabs /dev/scd0, and won't let go.  kaudiocreator and k3b both complain that they can't get to the device to do their thing until I kill the initial kio_audiocd process and let them get at it.  This happens every time I insert a CD.
Comment 2 Mary Ellen Foster 2007-07-15 17:23:51 UTC
I'm still seeing this on KDE 3.5.7 (Fedora 7). It's really quite annoying, as I keep having to "killall kio_audiocd" every time I want to do anything with an audio CD.
Comment 3 Richard Lärkäng 2007-09-25 20:51:02 UTC
*** Bug 150151 has been marked as a duplicate of this bug. ***
Comment 4 Rex Dieter 2007-09-25 21:12:59 UTC
confirmed
Comment 5 Jesse Barnes 2007-11-18 19:53:41 UTC
I think this problems is due to the fact that Fedora's cdparanoia includes a patch that opens the CD with O_EXCL.  I don't think the patch is in upstream cdparanoia anymore though, so it may have to be worked around in the Fedora KDE packages, probably by not spawning more than one process that opens the CD at a time...
Comment 6 Jesse Barnes 2007-11-18 19:59:37 UTC
Just confirmed that removing the O_EXCL patch from Fedora's cdparanoia patch makes things work again.

pjones has a good point though, not opening the CD in exclusive mode can cause multiple apps to try to access it, which can lead to undesired results, so it might be best if this is fixed in upstream KDE rather than just the Fedora packages.
Comment 7 Albert Astals Cid 2010-04-26 21:51:32 UTC
Closing as invalid per last comment since it's not our fault if fedora ships a broken cdparanoia