Advertisement
Guest User

Untitled

a guest
Sep 6th, 2011
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.40 KB | None | 0 0
  1. # ~/.asoundrc or /etc/asound.conf
  2. # ALSA configuration file
  3.  
  4. ##### USAGE #####
  5. # Save this file as "~/.asoundrc" (for user-specific sound configuration) or
  6. # "/etc/asound.conf" (for system-wide sound configuration) and specify ALSA
  7. # device names ad described in the next section.
  8.  
  9.  
  10. ##### DEVICE NAMES #####
  11. # This configuration file defines four devices for use by the user.  Those
  12. # devices are "analog", "mixed-analog", "digital", and "mixed-digital".  The
  13. # user may also re-define "default" to be identical to one of the above-named
  14. # devices (i.e. to send all sound output to the digital output unless otherwise
  15. # specified).  Use the device names as described below:
  16. #  - "analog" outputs to the analog output directly and (at least on software
  17. #  sound cards) blocks other audio output.  After playback completes, "queued"
  18. #  sounds are output in sequence.
  19. #  - "mixed-analog" mixes audio output from multiple programs into the analog
  20. #  output (so you can hear beeps, alerts, and other noises while playing back
  21. #  an audio stream).
  22. #  - "digital" outputs to the digital output directly.  Since most (all?)
  23. #  digital outputs expect 48kHz PCM audio, this may not work for some playback
  24. #  (i.e. CD's--which are 44.1kHz PCM audio--or 32kHz audio streams from TV
  25. #  recordings, etc.).
  26. #  - "mixed-digital"
  27.  
  28. # All other devices created within this file are used only by the configuration
  29. # file itself and should /not/ be used directly.  In other words, do not use
  30. # the devices "analog-hw", "dmix-analog", "digital-hw", or "dmix-digital".
  31.  
  32.  
  33. ##### IMPORTANT #####
  34. # To make this ALSA configuration file work with your sound card, you will need
  35. # to define the appropriate card and device information for the "analog-hw" and
  36. # "digital-hw" devices below.  You can find the card and device information
  37. # using "aplay -l".
  38.  
  39.  
  40. ##### Configuration File #####
  41.  
  42. # Override the default output used by ALSA.  If you do not override the
  43. # default, your default device is identical to the (unmixed) "analog" device
  44. # shown below.  If you prefer mixed and/or digital output, uncomment the
  45. # appropriate four lines below (only one slave.pcm line).
  46. #
  47. # Note, also, that as of ALSA 1.0.9, "software" sound cards have been modified
  48. # such that their default "default" device is identical to the "mixed-analog"
  49. # device.  Whether using an ALSA version before or after 1.0.9, it does no harm
  50. # and has no affect on performance to redefine the device (even if the
  51. # redefinition does not change anything).  Also, by using this ALSA
  52. # configuration file, you once again have access to unmixed analog output using
  53. # the "analog" device.
  54. pcm.!default {
  55.   type plug
  56. ## Uncomment the following to use (unmixed) "analog" by default
  57. #  slave.pcm "analog-hw"
  58. ## Uncomment the following to use "mixed-analog" by default
  59.   slave.pcm "dmix-analog"
  60. ## Uncomment the following to use (unmixed) "digital" by default
  61. #  slave.pcm "digital-hw"
  62. ## Uncomment the following to use "mixed-digital" by default
  63. #  slave.pcm "dmix-digital"
  64. }
  65.  
  66. # Control device (mixer, etc.) for the card
  67. ctl.!default {
  68.   type hw
  69.   card 0
  70. }
  71.  
  72. # Alias for (converted) analog output on the card
  73. # - This is identical to the device named "default"--which always exists and
  74. # refers to hw:0,0 (unless overridden)
  75. # - Therefore, we can specify "hw:0,0", "default", or "analog" to access analog
  76. # output on the card
  77. # - Note that as of ALSA 1.0.9, "software" sound card definitions redefine
  78. # "default" to do mixing, meaning this device is different from "default" and
  79. # allows playback while blocking other sound sources (until playback
  80. # completes).
  81. pcm.analog {
  82.   type plug
  83.   slave.pcm "analog-hw"
  84.   hint {
  85.     show on
  86.     description "Analog Output - Use analog outputs, converting samples, format, and rate as necessary."
  87.   }
  88. }
  89.  
  90. # Control device (mixer, etc.) for the card
  91. ctl.analog {
  92.   type hw
  93.   card 0
  94. }
  95.  
  96. # Alias for (converted) mixed analog output on the card
  97. # - This will accept audio input--regardless of rate--and convert to the rate
  98. # required for the dmix plugin (in this case 48000Hz)
  99. # - Note that as of ALSA 1.0.9, "software" sound card definitions redefine
  100. # "default" to do mixing, meaning this device is identical to "default" for
  101. # "software" sound cards.
  102. pcm.mixed-analog {
  103.   type plug
  104.   slave.pcm "dmix-analog"
  105.   hint {
  106.     show on
  107.     description "Mixed Analog Output - Use analog outputs, converting samples, format, and rate as necessary. Allows mixing with system sounds."
  108.   }
  109. }
  110.  
  111. # Control device (mixer, etc.) for the card
  112. ctl.mixed-analog {
  113.   type hw
  114.   card 0
  115. }
  116.  
  117. # Alias for (converted) digital (S/PDIF) output on the card
  118. # - This will accept audio input--regardless of rate--and convert to the rate
  119. # required for the S/PDIF hardware (in this case 48000Hz)
  120. pcm.digital {
  121.   type plug
  122.   slave.pcm "digital-hw"
  123.   hint {
  124.     show on
  125.     description "Digital Output - Use digital outputs, converting samples, format, and rate as necessary."
  126.   }
  127. }
  128.  
  129. # Control device (mixer, etc.) for the card
  130. ctl.digital {
  131.   type hw
  132.   card 0
  133. }
  134.  
  135. # Alias for mixed (converted) digital (S/PDIF) output on the card
  136. #  - This will accept audio input--regardless of rate--and convert to the rate
  137. #  required for the S/PDIF hardware (in this case 48000Hz)
  138. pcm.mixed-digital {
  139.   type plug
  140.   slave.pcm "dmix-digital"
  141.   hint {
  142.     show on
  143.     description "Mixed Digital Output - Use digital outputs, converting samples, format, and rate as necessary. Allows mixing with system sounds."
  144.   }
  145. }
  146.  
  147. # Control device (mixer, etc.) for the card
  148. ctl.mixed-digital {
  149.   type hw
  150.   card 0
  151. }
  152.  
  153. # The following devices are not useful by themselves.  They require specific
  154. # rates, channels, and formats.  Therefore, you probably do not want to use
  155. # them directly.  Instead use of of the devices defined above.
  156.  
  157. # Alias for analog output on the card
  158. # Do not use this directly--it requires specific rate, channels, and format
  159. pcm.analog-hw {
  160.   type hw
  161.   card 0
  162.   # The default value for device is 0, so no need to specify
  163. #  - Uncomment one of the below or create a new "device N" line as appropriate
  164. #    for your sound card
  165. #  device 1
  166. #  device 4
  167. }
  168.  
  169. # Control device (mixer, etc.) for the card
  170. ctl.analog-hw {
  171.   type hw
  172.   card 0
  173. }
  174.  
  175. # Alias for digital (S/PDIF) output on the card
  176. # Do not use this directly--it requires specific rate, channels, and format
  177. pcm.digital-hw {
  178.   type hw
  179.   card 0
  180.   device 1
  181. #  - Comment out "device 1" above and uncomment one of the below or create a
  182. #    new "device N" line as appropriate for your sound card
  183. #  device 2
  184. #  device 4
  185. }
  186.  
  187. # Control device (mixer, etc.) for the card
  188. ctl.digital-hw {
  189.   type hw
  190.   card 0
  191. }
  192.  
  193. # Direct software mixing plugin for analog output on the card
  194. # Do not use this directly--it requires specific rate, channels, and format
  195. pcm.dmix-analog {
  196.   type dmix
  197.   ipc_key 1234
  198.   slave {
  199.     pcm "analog-hw"
  200.     period_time 0
  201.     period_size 1024
  202.     buffer_size 4096
  203.     rate 48000
  204.   }
  205. }
  206.  
  207. # Control device (mixer, etc.) for the card
  208. ctl.dmix-analog {
  209.   type hw
  210.   card 0
  211. }
  212.  
  213. # Direct software mixing plugin for digital (S/PDIF) output on the card
  214. # Do not use this directly--it requires specific rate, channels, and format
  215. pcm.dmix-digital {
  216.   type dmix
  217.   ipc_key 1235
  218.   slave {
  219.     pcm "digital-hw"
  220.     period_time 0
  221.     period_size 1024
  222.     buffer_size 4096
  223.     rate 48000
  224.   }
  225. }
  226.  
  227. # Control device (mixer, etc.) for the card
  228. ctl.dmix-digital {
  229.   type hw
  230.   card 0
  231. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement