File:  [NetBSD Developer Wiki] / wikisrc / tutorials / how_to_use_5.1_surround_sound_with_netbsd.mdwn
Revision 1.3: download - view: text, annotated - select for diffs
Thu Apr 4 23:52:10 2019 UTC (10 months, 2 weeks ago) by sevan
Branches: MAIN
CVS tags: HEAD
Remove artifact

    1: **Contents**
    2: 
    3: [[!toc levels=3]]
    4: 
    5: #  System Requirements 
    6: 
    7:   * You will need a 5.1 Capable soundcard. 
    8:   * [NetBSD/i386](Hardware/i386) or [NetBSD/amd64](Hardware/amd64) 2.0 or higher 
    9:   * mplayer or xine software from pkgsrc. 
   10: 
   11: #  Configuration 
   12: 
   13: The soundcard should have been automatically configured by the kernel. The audiolayer is configured by 
   14: 
   15:   * [audioctl(1)](http://netbsd.gw.com/cgi-bin/man-cgi?audioctl+1+NetBSD-current)
   16:   * [mixerctl(1)](http://netbsd.gw.com/cgi-bin/man-cgi?mixerctl+1+NetBSD-current)
   17:   
   18: ##  Syntax 
   19: 
   20: The syntax of audioctl and mixerctl are the same. 
   21:     
   22:     % mixerctl
   23:     mixerctl [-d file] [-v] [-n] name ...
   24:     mixerctl [-d file] [-v] [-n] -w name=value ...
   25:     mixerctl [-d file] [-v] [-n] -a
   26:     %
   27:     
   28: 
   29: ##  Avaible command-line arguments 
   30: 
   31: ##  audioctl 
   32:     
   33:     % audioctl -a
   34:     name=VIA VT8233/8235
   35:     version=0x50
   36:     config=auvia encodings=ulinear:8,mulaw:8*,alaw:8*,slinear:8*,slinear_le:16,ulinear_le:16*,slinear_be:16*,ulinear_be:16* 
   37:     properties=full_duplex,mmap,independent
   38:     full_duplex=0
   39:     fullduplex=0
   40:     blocksize=16384
   41:     hiwat=4
   42:     lowat=3
   43:     monitor_gain=0
   44:     mode=play
   45:     play.rate=48000
   46:     play.channels=4
   47:     play.precision=16
   48:     play.encoding=slinear_le
   49:     play.gain=191
   50:     play.balance=32
   51:     play.port=0x0
   52:     play.avail_ports=0x0
   53:     play.seek=49152
   54:     play.samples=254935040
   55:     play.eof=3509
   56:     play.pause=0
   57:     play.error=1
   58:     play.waiting=0
   59:     play.open=1
   60:     play.active=1
   61:     play.buffer_size=65536
   62:     record.rate=48000
   63:     record.channels=2
   64:     record.precision=16
   65:     record.encoding=slinear_le
   66:     record.gain=0
   67:     record.balance=32
   68:     record.port=0x1
   69:     record.avail_ports=0x7
   70:     record.seek=0
   71:     record.samples=0
   72:     record.eof=0
   73:     record.pause=0
   74:     record.error=0
   75:     record.waiting=0
   76:     record.open=0
   77:     record.active=0
   78:     record.buffer_size=65536
   79:     record.errors=0
   80:     %
   81:     
   82: 
   83: ##  mixerctl
   84:     
   85:     % mixerctl -a
   86:     outputs.master=191,191
   87:     outputs.master.mute=off
   88:     outputs.mono=255
   89:     outputs.mono.mute=on
   90:     outputs.mono.source=mixerout
   91:     outputs.surround=255,255
   92:     outputs.surround.mute=off
   93:     outputs.surround.lineinjack=on
   94:     outputs.surround.mixtofront=on
   95:     outputs.center=127
   96:     outputs.center.mute=off
   97:     outputs.center.micjack=on
   98:     outputs.center.mixtofront=on
   99:     outputs.lfe=127
  100:     outputs.lfe.mute=off
  101:     outputs.lfe.micjack=on
  102:     outputs.lfe.mixtofront=on
  103:     inputs.speaker=255
  104:     inputs.speaker.mute=off
  105:     inputs.phone=191
  106:     inputs.phone.mute=on
  107:     inputs.mic=191
  108:     inputs.mic.mute=on
  109:     inputs.mic.preamp=off
  110:     inputs.mic.source=mic0
  111:     inputs.line=191,191
  112:     inputs.line.mute=off
  113:     inputs.cd=191,191
  114:     inputs.cd.mute=off
  115:     inputs.video=191,191
  116:     inputs.video.mute=off
  117:     inputs.aux=191,191
  118:     inputs.aux.mute=off
  119:     inputs.dac=151,151
  120:     inputs.dac.mute=off
  121:     record.source=mic
  122:     record.volume=0,0
  123:     record.volume.mute=off
  124:     outputs.spatial=off
  125:     outputs.spatial.center=0
  126:     outputs.spatial.depth=0
  127:     %
  128:     
  129: 
  130: ##  Required adjustments
  131: 
  132: ##  Dolby Digital 4.1
  133:     
  134:     % audioctl -w play.channels=4
  135:     % mixerctl -w outputs.master=200,200
  136:     % mixerctl -w outputs.surround.lineinjack=on
  137:     % mixerctl -w outputs.surround.mixtofront=on
  138:     % mixerctl -w outputs.surround=200,200
  139:     
  140: 
  141: You should put this into your /etc/rc.conf 
  142: 
  143: ##  Dolby Digital 5.1
  144:     
  145:     % audioctl -w play.channels=6
  146:     % mixerctl -w outputs.master=200,200 
  147:     % mixerctl -w outputs.surround.lineinjack=on
  148:     % mixerctl -w outputs.surround.mixtofront=on
  149:     % mixerctl -w outputs.surround=200,200
  150:     % mixerctl -w outputs.center=200
  151:     % mixerctl -w outputs.center.micjack=on
  152:     % mixerctl -w outputs.center.mixtofront=on
  153:     % mixerctl -w outputs.lfe=200
  154:     % mixerctl -w outputs.lfe.micjack=on
  155:     % mixerctl -w outputs.lfe.mixtofront=on
  156:     
  157: 
  158: You should put this also into your /etc/rc.conf 
  159: 
  160: #  Supported Players
  161: 
  162: ##  Mplayer
  163: 
  164: Currently mplayer has the best surround sound support. For 4.1 run 
  165:     
  166:     mplayer -channels 4
  167:     
  168: 
  169: and for 5.1 
  170:     
  171:     mplayer -channels 6
  172:     
  173: 
  174: ##  Xine
  175: 
  176: Unfortunately **mplayer** isn't able to handle DTS recorded DVD's. The required libdts (renamed due license restrictions to libdca) is not within the Packages Collection and if you believe several mailinglists it runs currently only on linux. But **xine** with the sun soundriver works fine. At first you have to make some adjustments, because the sound on DTS-DVD's is sampled at 24000 Hz and not 48000 Hz as a normal stereo DVD's. 
  177:     
  178:     $ mixerctl -w outputs.surround.lineinjack=on
  179:     $ mixerctl -w outputs.surround.mixtofront=on
  180:     $ mixerctl -w outputs.master=200,200
  181:     $ mixerctl -w outputs.surround=200,200
  182:     $ audioctl -w play.channels=4
  183:     $ audioctl -w play.rate=24000
  184:     
  185: 
  186: #  Additional Information 
  187: 
  188:   * [audioctl(1)](http://netbsd.gw.com/cgi-bin/man-cgi?audioctl+1+NetBSD-current) Manpage 
  189:   * [mixerctl(1)](http://netbsd.gw.com/cgi-bin/man-cgi?mixerctl+1+NetBSD-current) Manpage 
  190: 

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb