2022–08–21: Sound on
Pinephone Pro
I've gotten back to playing with audio codec on Pinephone Pro, after writing
the initial device tree support for it last year. Last year I just did a few
quick tests, without delving deep into the codec.
This time, I've analyzed it in detail, and mapped ALSA controls to codec audio paths in the
process. I noticed several issues with the codec, while trying various
configurations:
- The codec doesn't work right after boot, before some app plays
something.
- Modifying some controls while headphone/speaker output is enabled sometimes
breaks the headphone output.
- Sound playback stutters when serial console is enabled on kernel command
line (console=ttyS2)
- HP out kill switch doesn't have effect on this. The stutter comes from
headphone output typing characters into the console. (I had dmesg full of sysrq
messages, so I guess audio coupling to the serial console was triggering sysrq
very often, which caused underruns, because some sysrqs are expensive to
handle.)
- Some driver controls didn't match the datasheet. (mostly on OUTMIX, but also
on RECMIX)
- Main microphone (in the phone's body) is a digital mic that should skip the
analog part of the codec and somehow feeds to digital mixers right after the
ADC. It's a bit weird, though, because its audio is not affected by IN1 Boost
(as expected), its audio can be heard if IN1 input to RECMIX is disabled (as
expected), but ADC boost affects it (unexpected), and Stereo ADC2 Mux turns it
off (despite ADC not feeding into this Mux at all). So all in all a bit bizarre,
but workable. :)
- In any case, I have no clue what people who report that IN1 Boost affects
mic input volume are doing or hearing, but it does not affect it for me
at all.
I've made
patches to fix all of the issues I've found so far.