wm: doc

ref: 453b9bd07592f8d40329b43971ab0ea3d419c6c4
dir: /audio.ms/

View raw version
.TL
Audio

.PP
If the sound card is detected: 

.P1
; ls '#A'
\'#A/audio'
\'#A/audioctl'
\'#A/audiostat'
\'#A/volume'
; ls /dev/audiostat
.P2
  
.PP
You can check which pins are being used for input and output (output for Thinkpad x200): 

.P1
; cat /dev/audiostat
bufsize   1024 buffered      0
codec 0 pin 25 inpin 29
aout 16 c1d
aout 17 c1d
aout 18 211
beep 19 70000c
ain 20 100d1b ← pin 29, pin 23
ain 21 100d1b ← pin 24
pin 22 out jack ext right hpout green ← aout 16, aout 17
pin 23 in nothing sep rear micin pink
pin 24 in jack ext right micin pink
pin 25 out nothing sep rear hpout green ← aout 16, aout 17
pin 26 out fix int N/A speaker ? eapd ← aout 16, aout 17
pin 27 out nothing ext N/A other ? eapd ← aout 16, aout 17
pin 28 out nothing ext N/A other ? ← aout 18
pin 29 in fix int N/A micin ?
beep 30 f00000
outpath aout 16 → pin 26
outamp aout 16
inpath pin 29 → ain 20
inamp ain 20
.P2
    
.PP
This line `codec 0 pin 25 inpin 29` shows that pin 25 is being used for output
and pin 29 used for input. On my laptop, it is necessary to set the output pin
to 26: 

.P1
; echo pin 26 > /dev/audioctl
.P2
    
.PP
Now it's possible to play music: 

.P1
; audio/oggdec < music.ogg >/dev/audio
; audio/mp3dec < music.mp3 >/dev/audio
.P2

.FS
.IP *
http://nopenopenope.net/posts/audio
.IP *
https://git.sr.ht/~ft/jacksense
.FE