I was able to get the speaker running with the following commands (under Android).
# Enable Speaker and Play:
tinymix 'PRI_MI2S_RX Audio Mixer MultiMedia1' 1
tinymix 'RX3 MIX1 INP1' 'RX1'
tinymix 'SPK DAC Switch' 1
tinyplay /data/audio/test.wav
# Disable Sequence:
tinymix 'PRI_MI2S_RX Audio Mixer MultiMedia1' 0
tinymix 'RX3 MIX1 INP1' 'ZERO'
tinymix 'SPK DAC Switch' 0
This worked for the headset audio out
tinymix 'PRI_MI2S_RX Audio Mixer MultiMedia1' 1
tinymix 'RX1 MIX1 INP1' 'RX1'
tinymix 'RX2 MIX1 INP1' 'RX2'
tinymix 'RDAC2 MUX' 'RX2'
tinymix 'HPHL' 'Switch'
tinymix 'HPHR' 'Switch'
tinymix 'MI2S_RX Channels' 'Two'
tinyplay /data/audio/test.wav
tinyplay /data/audio/left.wav
tinyplay /data/audio/right.wav
and the headset microphone
# Enable Headset mic capture:
#---------------------------
tinymix 'MultiMedia1 Mixer TERT_MI2S_TX' 1
tinymix 'DEC1 MUX' 'ADC2'
tinymix 'ADC2 MUX' 'INP2'
tinycap /data/audio/capture_hs.wav -D 0 -d 0 -c 1 -r 48000 -b 16 &
# note PID, and when done capturing audio
kill -2 <PID>
tinyplay /data/audio/capture_hs.wav
#Disable Headset mic capture:
#----------------------------
tinymix 'MultiMedia1 Mixer TERT_MI2S_TX' 0
tinymix 'DEC1 MUX' 'ZERO'
tinymix 'ADC2 MUX' 'ZERO'
Full Disclosure: I am an employee of Qualcomm Canada, any opinions expressed in this post or any other post may not reflect the opinions of my employer.