Bug 454067

Summary: Changing cd stops sound juicer working.
Product: [Fedora] Fedora Reporter: Wes Armour <wes.armour>
Component: ConsoleKitAssignee: David Zeuthen <davidz>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: bnocera, digitect, mclasen, raina, tom
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-14 15:12:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Wes Armour 2008-07-04 09:19:21 UTC
Description of problem:

If I boot my machine with a audio cd in the cdrom I can then launch sound juicer
and rip the cd (to ogg vorbis).
If I then try to change the cd sound juicer can't get a lock on the cdrom...
(I've cut repeted attempts to access the cdrom out so this isn't thousands of
lines long!)

~~~~~~~~~~~~~~~~~~~~~~~~~~~ cli output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ sound-juicer 

** (sound-juicer:3506): WARNING **: Could not lock drive: Extracting audio from CD
Error trying to open /dev/sg0 exclusively (Permission denied). retrying in 1 second.

Error trying to open /dev/sga exclusively (No such file or directory). retrying
in 1 second.

Error trying to open /dev/sg1 exclusively (Permission denied). retrying in 1 second.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If I look at what device cdrom and cdrw are linked to I find...

~~~~~~~~~~~~~~~~~~~~~~~~~~~ cli output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ ll /dev/cdr*
lrwxrwxrwx 1 root root 3 2008-07-04 09:35 /dev/cdrom -> sr0
lrwxrwxrwx 1 root root 3 2008-07-04 09:35 /dev/cdrw -> sr0

$ ll /dev/sr0 
brw-r-----+ 1 root disk 11, 0 2008-07-04 09:35 /dev/sr0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now I look at who is using the device.....
~~~~~~~~~~~~~~~~~~~~~~~~~~~ cli output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ /sbin/fuser -v /dev/cdr*
                     USER        PID ACCESS COMMAND
/dev/cdrom:          wa78       3441 f.... gvfsd-cdda
/dev/cdrw:           wa78       3441 f.... gvfsd-cdda

$ /sbin/fuser -v /dev/sr0
                     USER        PID ACCESS COMMAND
/dev/sr0:            ****       3441 f.... gvfsd-cdda
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


So I Try to launch sound juicer and tell it to use /dev/sr0 and I get...
~~~~~~~~~~~~~~~~~~~~~~~~~~~ cli output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ sound-juicer --device=/dev/sr0 

** (sound-juicer:3540): WARNING **: Could not lock drive: Extracting audio from CD
Error trying to open /dev/sg0 exclusively (Permission denied). retrying in 1 second.

etc.....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I have a feeling that this is due to sound-juicer and gnomevfs....
~~~~~~~~~~~~~~~~~~~~~~~~~~~ cli output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ gnomevfs-df 
Volume          Free space
/scratch            42.0 GB (45078933504)
/                   9.4 GB (10059841536)
/boot               437.9 MB (459125760)
/sys/fs/fuse/connections 0 bytes (0)
/selinux            0 bytes (0)
/home/wa78/.gvfs    9.4 GB (10059841536)
/dev/shm            2.9 GB (3104829440)
/dev                2.9 GB (3104714752)
/                   9.4 GB (10059841536)
Drives:
	file:///scratch	/dev/md2	124.5 GB Volume
			/dev/fd0	Floppy Drive
	cdda:///dev/sr0	/dev/sr0	CD-RW/DVD±RW Drive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I've tried to make sound-juicer access /dev/sr0 via cdda:///dev/sr0 but it
doesn't like it one bit.

I'm at at a loss as to how to fix this. Any ideas????

Version-Release number of selected component (if applicable):

$ rpm -q kernel
kernel-2.6.25.6-55.fc9.x86_64
kernel-2.6.25.9-76.fc9.x86_64

$ rpm -q sound-juicer
sound-juicer-2.22.0-3.fc9.x86_64

How reproducible:

Every time.

Steps to Reproduce:
1. Boot machine with audio cd. 
2. Rip cd (all well and good :-)
3. Change cd
4. Try to Rip new cd.
5. Sound juicer dies :-(
  
Actual results:
No oggs.

Expected results:
new oggs.

Additional info: None.

Comment 1 Tom Hughes 2008-07-04 13:06:44 UTC
This was happening to me as well and I eventually worked out that it was because
gvfs-fuse-daemon wasn't running.

The reason why it was failing to start was that I had an old broken .gvfs fuse
mount in my home directory. Unmounting that with "fusermount -u ~/.gvfs" and
logging in again got gvfs-fuse-daemon running and made sound juicer happy.

Comment 2 Tom Hughes 2008-07-04 13:39:01 UTC
Looks like I spoke too soon - that did get it working for me but only for one CD
like you. Each time I login the current CD can be ripped but no more.

Comment 3 Bastien Nocera 2008-07-04 14:02:04 UTC
Try running:
gvfs-mount -u cdda:///dev/sr0
on the command-line, after having inserted the second CD.

If that works, then it's a dupe of bug 452313.

Comment 4 Tom Hughes 2008-07-04 14:17:05 UTC
Doesn't seem to help no, in fact it complains it isn't mounted:

vauxhall [~] % gvfs-mount -u cdda:///dev/sr0
Error finding enclosing mount: The specified location is not mounted

Listing the mounts would appear to agree:


vauxhall [~] % gvfs-mount -l
Drive(0): CD-RW/DVD±RW Drive
  Volume(0): Audio Disc
    Mount(0): Audio Disc -> cdda://sr0/
Drive(1): USB Drive
  Volume(0): data
    Mount(0): data -> file:///media/data
Drive(2): CompactFlash Drive
Drive(3): USB Drive


Comment 5 Bastien Nocera 2008-07-04 14:29:08 UTC
That should have been:
gvfs-mount -u cdda://sr0/

Comment 6 Wes Armour 2008-07-04 14:30:47 UTC
I get the same error but it appears my drive is mounted.....

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ gvfs-mount -u cdda:///dev/sr0
Error finding enclosing mount: The specified location is not mounted
[wa78@localhost ~]$ gnomevfs-df 
Volume          Free space
/scratch            41.9 GB (44983693312)
/                   9.3 GB (10020229120)
/boot               437.9 MB (459125760)
/sys/fs/fuse/connections 0 bytes (0)
/selinux            0 bytes (0)
/home/wa78/.gvfs    9.3 GB (10020229120)
/dev/shm            2.9 GB (3104829440)
/dev                2.9 GB (3104714752)
/                   9.3 GB (10020229120)
Drives:
	file:///scratch	/dev/md2	124.5 GB Volume
			/dev/fd0	Floppy Drive
	cdda:///dev/sr0	/dev/sr0	CD-RW/DVD±RW Drive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I also find that using fusermount -u ~/.gvfs and logging out and back in again
seems to fix it for just one cd, as soon as I try to change the cd sound juicer
locks up again :-(

Comment 7 Wes Armour 2008-07-04 14:34:25 UTC
Nope, sorry that one doesn't work for me, thanks for trying though :-)

$ gvfs-mount -u cdda://sr0/
Error finding enclosing mount: The specified location is not mounted

$ gnomevfs-df 
Volume          Free space
/scratch            41.9 GB (44983693312)
/                   9.3 GB (10020196352)
/boot               437.9 MB (459125760)
/sys/fs/fuse/connections 0 bytes (0)
/selinux            0 bytes (0)
/home/wa78/.gvfs    9.3 GB (10020196352)
/dev/shm            2.9 GB (3104829440)
/dev                2.9 GB (3104714752)
/                   9.3 GB (10020196352)
Drives:
        file:///scratch /dev/md2        124.5 GB Volume
                        /dev/fd0        Floppy Drive
        cdda:///dev/sr0 /dev/sr0        CD-RW/DVD±RW Drive


Comment 8 Tom Hughes 2008-07-04 14:44:37 UTC
That command does work in as much as it unmounts it without error, but it
doesn't help sound juicer at all.

Comment 9 Bastien Nocera 2008-07-04 14:48:12 UTC
Stop using gnomevfs-df to list the drives. Use gvfs-mount -l, otherwise
gnome-vfs will open the drive, and lock the device again, which is what we're
trying to avoid.

Comment 10 Wes Armour 2008-07-04 15:05:21 UTC
Ooops, Sorry, I didn't realise.

Ok so I've tried...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ gvfs-mount -u cdda://sr0/
Error finding enclosing mount: The specified location is not mounted

$ gvfs-mount -l
Drive(0): Floppy Drive
Drive(1): CD-RW/DVD±RW Drive
  Volume(0): Audio Disc

$ fusermount -u ~/.gvfs

$ gvfs-mount -l
Drive(0): Floppy Drive
Drive(1): CD-RW/DVD±RW Drive
  Volume(0): Audio Disc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

None of them seem to work. I don't understand why sound-juicer is trying to
access /dev/sg0 when gnomevfs-df (I promise I wont do it again) lists
cdda:///dev/sr0 /dev/sr0 ???


Comment 11 Bastien Nocera 2008-07-04 15:20:57 UTC
(In reply to comment #10)
<snip>
> None of them seem to work. I don't understand why sound-juicer is trying to
> access /dev/sg0 when gnomevfs-df (I promise I wont do it again) lists
> cdda:///dev/sr0 /dev/sr0 ???

That'd be because /dev/sr0 is the drive, /dev/sg0 is the generic SCSI interface
needed for CDDA access.

What's the outputs of those commands (run as root):
fuser /dev/sr0
fuser /dev/sg0

Comment 12 Tom Hughes 2008-07-04 15:39:27 UTC
I put the CD in and ran those and got:

vauxhall [~] % sudo fuser /dev/sr0
/dev/sr0:             3537  4683
vauxhall [~] % sudo fuser /dev/sg0

then unmounted:

vauxhall [~] % gvfs-mount -u cdda://sr0/

and got:

vauxhall [~] % sudo fuser /dev/sr0      
/dev/sr0:             3537
vauxhall [~] % sudo fuser /dev/sg0      

Process 3537 is rhythmbox, which is also trying to look at the CD and having
problems. Killing it makes no difference though.

One thing I did just notice is that /dev/sr0 has an ACL allowing me access, but
/dev/sg0 does not, which would explain why sound juicer and rhythmbox are
getting permission denied trying to access ag0. I assume PolicyKit installed the
ACL on the sr0 device?

Comment 13 Wes Armour 2008-07-04 15:41:35 UTC
Without sound-juicer running I get...
[root@localhost ~]# fuser /dev/sr0
[root@localhost ~]# fuser /dev/sg0
i.e. they return nothing.

If I run sound juicer I get nothing until I hit the extract button. Then I get...
** (sound-juicer:4590): WARNING **: Could not lock drive: Extracting audio from CD
# fuser /dev/sg0
[root@localhost ~]# fuser /dev/sr0
/dev/sr0:             4590

So the face the it will rip a cd as root make me think there might be some
permission issues somewhere???

Comment 14 Tom Hughes 2008-07-04 15:45:13 UTC
If I add write permission to sg0 though, then it just complains about /dev/sga
instead, which doesn't even exist...

Comment 15 Steve Hall 2008-07-05 03:58:42 UTC
I just learned that I can fix these symptoms after inserting the new disk simply
with:
  chmod g+w /dev/sr0

My machine only has one drive, a CD/DVD-RW. Does this help anybody?

Comment 16 Raina Otoni 2008-07-06 02:31:23 UTC
(In reply to comment #15)
> I just learned that I can fix these symptoms after inserting the new disk simply
> with:
>   chmod g+w /dev/sr0
> 
> My machine only has one drive, a CD/DVD-RW. Does this help anybody?

Thanks, Sound Juicer seems to work.


Comment 17 Steve Hall 2008-07-20 00:51:21 UTC
Can we bump severity from low to normal? Permissions related to cd devices is
broken here (not just Sound Juicer, same in grip). Cryptic command line
permission changes (as root/sudo) does not a userland workaround make, this is
something more systemic.

Comment 18 Bug Zapper 2009-06-10 01:54:49 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 19 Bug Zapper 2009-07-14 15:12:26 UTC
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.