I’m getting really close on this one now.
It has something to do with WHEN it is sent.
This VS command MUST be sent to the BT chip for EACH SCO connection. That includes during a call if you switch from BT to headset and back to BT. Note that this is apparently NOT how it is supposed to work, it is not supposed to need the VS command to be sent like that, it is supposed to work even from the BTS script, but that isn’t working. I think that something in the process of setting up a call is causing the PCM configuration to be reset.
Closing and reopening the PCM has no impact, but I found that if I send the VS command just a bit earlier in the process, it creates good sound much more reliably.
I’m currently triggering it from the audio HAL, immediately before opening the pcm.