This is an old revision of the document!


Figure out how to play both mono and stereo .wav files through the headphones on a Freescale MCIMX6Q-SDB running a stock core-image-minimal with only added recipe alsa-utils.

Some /sys/kernel/debug/ files to check out later:

  • /sys/kernel/debug/asoc/<cardname>/<codecname>/dapm/*
  • /sys/kernel/debug/regmap/<address>/registers
  • fully-updated poky and meta-freescale layers
  • MACHINE = imx6qdlsabresd
  • IMAGE_INSTALL_append = “ alsa-utils”
  • EXTRA_IMAGE_FEATURES = “package-management debug-tweaks”

Part of alsa-utils package, in /usr/share/sounds/alsa/ (all mono files):

Front_Center.wav  Front_Right.wav   Rear_Center.wav   Rear_Right.wav    Side_Right.wav
Front_Left.wav    Noise.wav         Rear_Left.wav     Side_Left.wav

Also manually copied under /home/root/:

-rw-r--r--    1 root     root         53544 Oct  4 17:42 pcm0808m.wav
-rw-r--r--    1 root     root        107042 Oct  4 17:42 pcm0808s.wav
-rw-r--r--    1 root     root        107042 Oct  4 17:42 pcm1608m.wav
-rw-r--r--    1 root     root        214040 Oct  4 17:42 pcm1608s.wav
...
Advanced Linux Sound Architecture Driver Initialized.
...
wm8962 0-001a: customer id 0 revision D
fsl-asrc 2034000.asrc: driver registered
input: WM8962 Beep Generator as /devices/soc0/soc/2100000.aips-bus/21a0000.i2c/i2c-0/0-001a/input/input5
imx-wm8962 sound: wm8962 <-> 202c000.ssi mapping ok
imx-wm8962 sound: snd-soc-dummy-dai <-> 2034000.asrc mapping ok
imx-wm8962 sound: wm8962 <-> 202c000.ssi mapping ok
imx-audio-hdmi sound-hdmi: hdmi-hifi <-> soc:hdmi_audio@00120000 mapping ok
...
wm8962-supply: disabling
SW4: disabling
ALSA device list:
  #0: wm8962-audio
  #1: imx-hdmi-soc
...

With no other sound or CODEC configuration, first, turn up headphone volume:

# amixer cset name="Headphone Volume" 100,100
numid=24,iface=MIXER,name='Headphone Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0
  : values=100,100
  | dBscale-min=-121.00dB,step=1.00dB,mute=1

In loop, play all mono files in /usr/share/sounds/alsa/, they all play on the left headphone only (which is to be expected):

# for w in *.wav ; do
> aplay $w
> sleep 1
> done

For .wav files under /home/root/, mono files play only on left HP channel, stereo .wav files play on both channels, so this verifies that both HP channels work, at least with stereo files.

By default:

# amixer cget name="DAC L/R Swap Switch"
numid=20,iface=MIXER,name='DAC L/R Swap Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off

Switch, so mono files play on right headphone:

# amixer cset name="DAC L/R Swap Switch" on
numid=20,iface=MIXER,name='DAC L/R Swap Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on

Turn off for now.

By default, both HP channels bypass the HP mixers and get their output directly from the DAC:

root@imx6qdlsabresd:~# amixer get "HPOUTL PGA"
Simple mixer control 'HPOUTL PGA',0
  Capabilities: enum
  Items: 'DAC' 'Mixer'
  Item0: 'DAC'
root@imx6qdlsabresd:~# amixer get "HPOUTR PGA"
Simple mixer control 'HPOUTR PGA',0
  Capabilities: enum
  Items: 'DAC' 'Mixer'
  Item0: 'DAC'
root@imx6qdlsabresd:~#

For the left channel, we can use the mixer and just feed the left channel into the mixer, effectively getting the same result:

# amixer set "HPOUTL PGA" Mixer
Simple mixer control 'HPOUTL PGA',0
  Capabilities: enum
  Items: 'DAC' 'Mixer'
  Item0: 'Mixer'

This effectively kills the left output channel until we set the mixer properly:

# amixer sget "HPMIXL DACL"
Simple mixer control 'HPMIXL DACL',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
# amixer sset "HPMIXL DACL" on
Simple mixer control 'HPMIXL DACL',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
  • mcimx6q-sbc.1507139815.txt.gz
  • Last modified: 2017/10/04 17:56
  • by rpjday