Results 1 to 2 of 2

Thread: External volume control

  1. #1
    Low Bitrate
    Join Date
    May 2010
    Posts
    83

    External volume control

    I thought this was already posted but couldn't find it. I have an external volume control (from a usb keyboard), have it hooked up and am wondering how to get it to control the volume for my system. I am thinking that it is probably easier to make it control the system volume and leave nghost volume maxed out, but the knob doesn't change any volume except mplayer's when playing videos.

  2. #2
    Low Bitrate
    Join Date
    May 2010
    Posts
    83

    Fixed it

    xbindkeys setup

    I used xbindkeys. In my .xbindkeysrc config file I added these lines:

    # Examples of commands:

    "sh $HOME/Scripts/volume-down.sh &"
    m:0x0 + c:122

    "sh $HOME/Scripts/volume-up.sh &"
    m:0x0 + c:123
    #----

    The scripts I use are found at Post #7. The process was simple. I had to modify my scripts because I have the pulseaudio equalizer running which has a separate audio device. below are my modified scripts.

    #volume-up.sh
    #!/bin/bash

    A=`pacmd dump | grep "set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo" | cut -d " " -f 3`
    B=$((A + 0x01000))
    if [ $(($B)) -gt $((0x10000)) ]
    then
    B=$((0x10000))
    fi
    pactl set-sink-volume 0 `printf "0x%X" $B`

    C=`pacmd dump | grep "set-sink-volume ladspa_output.mbeq_1197.mbeq" | cut -d " " -f 3`
    D=$((C + 0x10000))
    if [ $(($D)) -gt $((0x10000)) ]
    then
    D=$((0x10000))
    fi
    pactl set-sink-volume 1 `printf "0x%X" $D`
    #---
    #volume-down.sh
    #!/bin/bash

    A=`pacmd dump | grep "set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo" | cut -d " " -f 3`
    B=$((A - 0x01000))
    if [ $(($B)) -lt $((0x00000)) ]
    then
    B=$((0x00000))
    fi
    pactl set-sink-volume 0 `printf "0x%X" $B`

    C=`pacmd dump | grep "set-sink-volume ladspa_output.mbeq_1197.mbeq" | cut -d " " -f 3`
    D=$((C + 0x10000))
    if [ $(($D)) -gt $((0x10000)) ]
    then
    D=$((0x10000))
    fi
    pactl set-sink-volume 1 `printf "0x%X" $D`
    #---

    In my matchbox session file I added these two lines.

    #matchbox session file
    xbindkeys &

    "sh $HOME/Scripts/volume-down.sh &"
    #---

    Now whenever I adjust the volume it maxes out my "ladspa_output.mbeq_1197.mbeq" output. This output causse small clicks in the sound when adjusted so I decided to just max it out when adjust the volume either way. When my system boots, it runs the volume down script to pretty much just set the system volume before the music is really played. One thing that I don't like is that I can only adjust the volume 6% or less than that. I have tried different values, but 6% is about the only plausible step. If anyone has any questions about this, let me know. You can also make a mute script if you wish.

Similar Threads

  1. Hardware Review: JL Audio CL-RLC volume controlled preamp
    By soundman98 in forum The Review Palace
    Replies: 46
    Last Post: 06-12-2011, 09:30 PM
  2. Master Volume Control Issue With Prodigy 7.1 Hifi
    By Madboy in forum Road Runner
    Replies: 11
    Last Post: 02-26-2010, 10:55 PM
  3. Replies: 12
    Last Post: 07-31-2007, 02:05 PM
  4. Enhanced Volume Control
    By XxAndyxX in forum Software & Software Development
    Replies: 15
    Last Post: 06-12-2007, 09:25 PM
  5. Replies: 4
    Last Post: 07-31-2006, 03:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •