Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] How to change /dev/cdrom in kscd (KDE4) ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
E001754
Guru
Guru


Joined: 01 Aug 2004
Posts: 442
Location: Paris, France

PostPosted: Wed Nov 04, 2009 1:15 pm    Post subject: [SOLVED] How to change /dev/cdrom in kscd (KDE4) ? Reply with quote

Hi there,

I have my optical drives under /media/sr0 and /media/sr1.
kscd is trying to access /dev/cdrom, which doesn't exists, so I can't play any audioCD.

In kscd for KDE3, there was an option to change the device to use. in KSCD for KDE4, I didn't find out any option in the few available to change the device to use.
For ripping the CD, I use 'asunder' in which I can specify to use /media/sr1 and it works : I can grab the audio tracks and convert it in mp3. So I assume the /media/sr1 is the correct device to use, but I just can't do it in kscd.

I've found a .kscdrc file in $HOME$/.kde/apps, but that file doesn't seems to be linked to kscd as this file already specifies /media/sr1 instead of /dev/cdrom.

Thanks in advance for any help


Last edited by E001754 on Sat Nov 07, 2009 6:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1141
Location: Romania

PostPosted: Thu Nov 05, 2009 7:45 am    Post subject: Reply with quote

You can use udev.
Create /etc/udev/rules.d/70-persistent-cd.rules with:
Code:

ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:07.1-scsi-1:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:07.1-scsi-1:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:07.1-scsi-1:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:07.1-scsi-1:0:0:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"

Replace ENV{ID_PATH} with
Code:
ls -l /dev/disk/by-path | grep sr0

This will create cdrom, cdrw, dvd, dvdrw symlinks for /dev/sr0.
Back to top
View user's profile Send private message
E001754
Guru
Guru


Joined: 01 Aug 2004
Posts: 442
Location: Paris, France

PostPosted: Thu Nov 05, 2009 9:36 am    Post subject: Reply with quote

Thanks for that !

And that'll probably solve my problem with the DVD drive : it's mounter by the volume name (which is different from one disc to another) instead of being mounted with some standard id.

I'll try that and keep in touch for the results here.

:D
Back to top
View user's profile Send private message
E001754
Guru
Guru


Joined: 01 Aug 2004
Posts: 442
Location: Paris, France

PostPosted: Thu Nov 05, 2009 10:41 pm    Post subject: Reply with quote

ls -l /dev/disk/by-path | grep sr (Actually, I got two optical drives) :
Quote:

lrwxrwxrwx 1 root root 9 nov. 5 20:23 pci-0000:04:07.0-scsi-0:0:0:0 -> ../../sr0
lrwxrwxrwx 1 root root 9 nov. 5 20:23 pci-0000:04:07.0-scsi-0:0:1:0 -> ../../sr1


My /etc/udev/rules.d/70-persistent-cd.rules contains the following :
Quote:

# This file was automatically generated by the /lib64/udev/write_cd_rules
# program, probably run by the cd-aliases-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line
# and set the $GENERATED variable.

# DVDR_PX-716A (pci-0000:05:07.0-scsi-0:0:0:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:05:07.0-scsi-0:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:05:07.0-scsi-0:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:05:07.0-scsi-0:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:05:07.0-scsi-0:0:0:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"

# (pci-0000:05:07.0-scsi-0:0:1:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:05:07.0-scsi-0:0:1:0", SYMLINK+="cdrom1", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:05:07.0-scsi-0:0:1:0", SYMLINK+="cdrw1", ENV{GENERATED}="1"

# (pci-0000:04:07.0-scsi-0:0:1:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:1:0", SYMLINK+="cdrom2", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:1:0", SYMLINK+="cdrw2", ENV{GENERATED}="1"

# (pci-0000:04:07.0-scsi-0:0:0:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:0:0", SYMLINK+="cdrom3", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:0:0", SYMLINK+="cdrw3", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:0:0", SYMLINK+="dvd3", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:0:0", SYMLINK+="dvdrw3", ENV{GENERATED}="1"


Should I change this file into this? :
Quote:

ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:0:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"

ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:1:0", SYMLINK+="cdrom1", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:1:0", SYMLINK+="cdrw1", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:1:0", SYMLINK+="dvd1", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:1:0", SYMLINK+="dvdrw1", ENV{GENERATED}="1"


Or, more simply, into that (the first drive is DVD, the second drive is cdrom)? :
Quote:

ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"

ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:04:07.0-scsi-0:0:1:0", SYMLINK+="cdrom", ENV{GENERATED}="1"


Where can I find some documentation about HAL rules, for me to understand how this stuff works ?

Many thanks anyway for your help so far.

Cheers.
Back to top
View user's profile Send private message
sebaro
Veteran
Veteran


Joined: 03 Jul 2006
Posts: 1141
Location: Romania

PostPosted: Fri Nov 06, 2009 6:44 am    Post subject: Reply with quote

Edit the udev cd rules file, then restart udev and look into /dev for those symlinks.
Writing udev rules: http://www.reactivated.net/writing_udev_rules.html
Back to top
View user's profile Send private message
E001754
Guru
Guru


Joined: 01 Aug 2004
Posts: 442
Location: Paris, France

PostPosted: Fri Nov 06, 2009 9:49 am    Post subject: Reply with quote

many thanks for all.

cheers.
Back to top
View user's profile Send private message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Tue May 25, 2010 12:19 pm    Post subject: Reply with quote

Hallo,

I have the same issue, but not the time to go through all the documentation for the time being.

**Edit **
Although it does not seem to be so hard. I will give it a try. Thanx!
***

Could you please post the relevant config files that made it work?

Kind regards,
orange_juice
Back to top
View user's profile Send private message
E001754
Guru
Guru


Joined: 01 Aug 2004
Posts: 442
Location: Paris, France

PostPosted: Wed May 26, 2010 11:27 am    Post subject: Reply with quote

This currently works with only those two lines in /etc/udev/rules.d/70-persistent-cd.rules

Code:
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:06:07.0-scsi-0:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:06:07.0-scsi-0:0:1:0", SYMLINK+="cdrom", ENV{GENERATED}="1"


Be warned that the pci-id ("pci-0000:06:07.0-scsi-0:0:1:0") is valid only for my system. Get yours with this command : ls -l /dev/disk/by-path | grep sr

Hope it helps you avoiding reading the full doc just for two lines !
:D
Back to top
View user's profile Send private message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Wed May 26, 2010 11:32 am    Post subject: Reply with quote

Thank you! It works great!

Kind regards,
orange_juice

***EDIT***

I also found those rules that work as well:

Code:
SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="cdrom", GROUP="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="dvd", GROUP="cdrom", ENV{GENERATED}="1"



or the most complicated in this post: https://bugzilla.redhat.com/show_bug.cgi?id=570490#c26

Code:
# change the default device by changing sr0 to srN in this section
SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM}=="1",        SYMLINK+="cdrom",
ENV{GENERATED}="1", link_priority=1
SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM_CD_RW}=="1",  SYMLINK+="cdrw",
ENV{GENERATED}="1", link_priority=1
SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM_DVD}=="1",    SYMLINK+="dvd", 
ENV{GENERATED}="1", link_priority=1
SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM_DVD_RW}=="1", SYMLINK+="dvdrw",
ENV{GENERATED}="1", link_priority=1
SUBSYSTEM=="block", KERNEL=="sr0", ENV{GENERATED}="1", GOTO="cd_rules_end"
# end of default device rules

# if the default device does not exist, fall back to sr0
SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM}=="1",        SYMLINK+="cdrom",
ENV{GENERATED}="1"
SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM_CD_RW}=="1",  SYMLINK+="cdrw",
ENV{GENERATED}="1"
SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM_DVD}=="1",    SYMLINK+="dvd", 
ENV{GENERATED}="1"
SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM_DVD_RW}=="1", SYMLINK+="dvdrw",
ENV{GENERATED}="1"
SUBSYSTEM=="block", KERNEL=="sr0", ENV{GENERATED}="1", GOTO="cd_rules_end"

SUBSYSTEM=="block", KERNEL=="sr[0-9]*", ENV{ID_CDROM}=="1",       
SYMLINK+="cdrom%n", ENV{GENERATED}="1"
SUBSYSTEM=="block", KERNEL=="sr[0-9]*", ENV{ID_CDROM_CD_RW}=="1",
SYMLINK+="cdrw%n",  ENV{GENERATED}="1"
SUBSYSTEM=="block", KERNEL=="sr[0-9]*", ENV{ID_CDROM_DVD}=="1",   
SYMLINK+="dvd%n",   ENV{GENERATED}="1"
SUBSYSTEM=="block", KERNEL=="sr[0-9]*", ENV{ID_CDROM_DVD_RW}=="1",
SYMLINK+="dvdrw%n", ENV{GENERATED}="1"

LABEL="cd_rules_end"   
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum