LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   USB Speaker Volume Control (http://www.linuxquestions.org/questions/linux-hardware-18/usb-speaker-volume-control-861862/)

Ipozya 02-10-2011 11:06 AM

USB Speaker Volume Control
 
Hello,
I got my Logitech v20 USB speakers working by simply running cat /proc/asound/cards to find the position the usb speaker card (which happened to be 1). I then edited my alsa configuration file and changed the 0 --> 1 for the following two lines

/usr/share/alsa/alsa.conf
Code:

# defaults
defaults.ctl.card 1
defaults.pcm.card 1

After restarting the sound system, the usb speakers now work!


After having plugged in, however, my volume buttons on laptop keyboard are not able to adjust speaker volume (neither do the ones located on the speakers themselves); I have to resort to using alsamixer to change the volume. When I unplugged the speakers, it reverted back to the internal sound, but now the volume buttons on laptop don't work for the regular sound either (they reset after I rebooted). Does anyone know how I could make the laptop keys work for the USB speakers as well as the regular sound when the speakers are unplugged. Here is my xbindkeys configuration (which works fine without speakers in)

.xbindkeysrc
Code:

# Increase volume
"amixer set Master playback 1+"
    m:0x0 + c:123
    XF86AudioRaiseVolume

# Decrease volume
"amixer set Master playback 1-"
    m:0x0 + c:122
    XF86AudioLowerVolume

# Toggle mute
"amixer set Master toggle"
    m:0x0 + c:156
    XF86Launch1

It may be that the volume commands need to include PCM, but I would like them to work for both regular speakers and USB. I find it a bit strange, also, that they stop working when I unplug usb. Thanks for any help!

Ipozya 02-10-2011 10:11 PM

I found the following on another thread on another forum.

Code:

"amixer -c1 sset PCM 3-"
XF86AudioLowerVolume

"amixer -c1 sset PCM 3+"
XF86AudioRaiseVolume

"amixer -c1 sset PCM toggle"
XF86AudioMute

These seem logical for the xbindkeys but I don't think that the regular sound control (w/o speakers in) will work if I alter it. Does anyone using USB speakers have any input?


All times are GMT -5. The time now is 05:35 AM.