I found the udevstart command will change the volume of the system. And i read the rule file for it (/etc/udev/rules.d). There are several rule files in this directory, 10-local.rules 50-udev.rules 60-fuse.rules alsa.rules 15-mouse.rules 51-hotplug.rules 80-local.rules. I found the file 50-udev.rules includes a section to set the alsa device:
KERNEL=="controlC[0-9]*", NAME="snd/%k"
KERNEL=="hw[CD0-9]*", NAME="snd/%k"
KERNEL=="pcm[CD0-9cp]*", NAME="snd/%k"
KERNEL=="midi[CD0-9]*", NAME="snd/%k"
KERNEL=="timer", NAME="snd/%k"
KERNEL=="seq", NAME="snd/%k"
And also I found there are some similar items in alsa.rules file:
SUBSYSTEM=="sound", KERNEL=="controlC*" RUN+="/sbin/salsa"
SUBSYSTEM=="sound", KERNEL=="pcm*" RUN+="/sbin/salsa"
How do they related? How do they change the volume? How can I modify them to meet my requirement? Is there any syntax for the rule file?
Thanks.