home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / share / doc / setvol.txt < prev    next >
Encoding:
Text File  |  1999-05-17  |  2.7 KB  |  113 lines

  1.  
  2. SetVol 1.1
  3. ==========
  4.  
  5. Are you kidding me??  A readme file is not required for this :)
  6.  
  7. This is just an extremely simple utility that I wrote in order to set
  8. the sound card to the levels i like from the command line.  To be honest
  9. I never understood how linux was doing it on bootup, and just wrote this
  10. to set it in the rc.d files so that I wasn't getting something ludicrous
  11. after a reboot.
  12.  
  13. Compilation
  14. ===========
  15.  
  16. To compile this puppy, just type
  17.  
  18.     gcc -o setvol setvol.c
  19.  
  20. If you have any problems, just email me.  This code should not
  21. cause a single problem to anyone... It's almost embarassing to submit :)
  22.  
  23.  
  24. Usage
  25. =====
  26.  
  27. Just type "setvol" alone to get a usage output from setvol.  But basically
  28. you just give it a device number from this list,
  29.  
  30. SOUND_MIXER_VOLUME      0
  31. SOUND_MIXER_BASS        1
  32. SOUND_MIXER_TREBLE      2
  33. SOUND_MIXER_SYNTH       3
  34. SOUND_MIXER_PCM         4
  35. SOUND_MIXER_SPEAKER     5
  36. SOUND_MIXER_LINE        6
  37. SOUND_MIXER_MIC         7
  38. SOUND_MIXER_CD          8
  39. SOUND_MIXER_IMIX        9
  40. SOUND_MIXER_ALTPCM      10
  41. SOUND_MIXER_RECLEV      11
  42. SOUND_MIXER_IGAIN       12
  43. SOUND_MIXER_OGAIN       13
  44.  
  45. If you give only a device by itself, like
  46.  
  47.     setvol 0
  48.  
  49. the status of that device is returned.  Both the left and right channels
  50. will come out alone.  Nothing else is displayed.  This is easy for
  51. setting variables, like
  52.  
  53.     LEFT_VOLUME=`setvol 0 | awk '{print $1}'`
  54.     RIGHT_VOLUME=`setvol 0 | awk '{print $2}'`
  55.  
  56. This will store the left and right values for the volume. 
  57.  
  58. If you want to set the value of a device, call it like this
  59.  
  60.     setvol 0 50
  61.  
  62. to set the value of the mixer volume to half of its maximum.  If there is a
  63. left and right channel then this will set both to 50.
  64.  
  65. To set the two channels of a device individually, call like this,
  66.  
  67.     setvol 0 20 50
  68.  
  69. to set the value of the left channel to 20 and the right to 50.
  70.  
  71.  
  72. Bugs
  73. ====
  74.  
  75. I don't know of any.  If you find any, send me a patch, or at least a good
  76. description.  SetVol should decide if your device is supported or not, and
  77. should also know if that device is stereo or not.  There have been some
  78. other 'preventative error' methods taken, but there are bound to be some
  79. bugs.
  80.  
  81.  
  82. License
  83. =======
  84.  
  85. Licensing is GPL... you have all rights to do whatever you want with this.  
  86. I just don't care. :)
  87.  
  88. For information about GPL goto http://www.gnu.org
  89.  
  90.  
  91. Thanks to
  92. =========
  93.  
  94. Phil Pennock
  95. Valerica Vatafu
  96.  
  97. These two guys submitted some cool stuff, in the beginning of 1999.  I was
  98. just VERY slow to get it out.  Sorry about that.  Some stuff I kept, some I 
  99. tossed. 
  100.  
  101. Regardless, the combination of the two generated some useful stuff.  Thanks
  102. guys.  We all appreciate it.
  103.  
  104.  
  105. Bye
  106. ===
  107.  
  108. Take care,
  109.  
  110. Derek Wyatt
  111. derek@scar.utoronto.ca
  112.  
  113.