shithub: docs.9front.org

ref: f6ff8302f18a936f5b4d41a2a371346a24daf48c
dir: /audio.md/

View raw version
Audio
=====

With Intel HDA audio one most likely will need to set a proper "pin"
for the sound to play on the correct output, and "inpin" for recorded
samples to come from the right input.

The easy way to check which pins you have is, for output:

	grep ' out ' /dev/audiostat

For input:

	grep ' in ' /dev/audiostat

The output produced should give some idea about what those pins are.

In order to check the currently used ones:

	grep path /dev/audiostat

As an example, on a Thinkpad T480s the interesting pins (output and
input) are:

	pin 20 out fix int N/A speaker ? eapd ← aout 2
	pin 33 out jack ext right hpout black eapd ← aout 2, aout 3

	pin 18 in fix int N/A micin ?
	pin 25 in jack ext right micin black

Pin 20 is the built-in speaker, 33 is headphones jack.  Pin 18 is the
built-in mic, 25 is the mic input on the same jack that 33 is on.

By doing `echo pin 20 >/dev/audioctl; echo 50 >/dev/volume` the output
is switched to built-in speaker and the volume is set to 50, to avoid
blasting with full volume immediately.

`echo inpin 18 >/dev/audioctl` will make reads from `/dev/audio`
produce samples captured from the built-in mic.  You can adjust mic
gain by doing `echo recgain 50 >/dev/volume`.  To test the mic you can
run the following command (preferably while using headphones):

	audio/pcmconv -i s16c1r44100 < '#A/audio' > /dev/audio

`#A/audio` is used here due to the fact that `audio/mixfs` (if you
have it running) binds on top of `/dev/audio` and can only be used for
output.

Specifically on Thinkpad T480s 9front seems to have trouble playing
audio on headphones jack, the sound will be garbled.  To avoid that
you can switch the input to pin 25, and perhaps back to 18.  That
somehow fixes the issue.