Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mcimx6q-sbc [2017/10/03 13:17] rpjdaymcimx6q-sbc [2017/10/04 18:34] (current) – [Headphone mixers] rpjday
Line 1: Line 1:
-=== Overview ===+==== Overview ====
  
 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''. 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''.
  
-=== System configuration ===+Some ''/sys/kernel/debug/'' files to check out later: 
 + 
 +  * ''/sys/kernel/debug/asoc/<cardname>/<codecname>/dapm/*'' 
 +  * ''/sys/kernel/debug/regmap/<address>/registers'' 
 + 
 +==== System configuration ====
  
   * fully-updated ''poky'' and ''meta-freescale'' layers   * fully-updated ''poky'' and ''meta-freescale'' layers
   * ''MACHINE = imx6qdlsabresd''   * ''MACHINE = imx6qdlsabresd''
   * ''IMAGE_INSTALL_append = " alsa-utils"''   * ''IMAGE_INSTALL_append = " alsa-utils"''
 +  * ''EXTRA_IMAGE_FEATURES = "package-management debug-tweaks"''
 +
 +==== Onboard .wav files ====
 +
 +Part of ''alsa-utils'' package, in ''/usr/share/sounds/alsa/'' (all mono files):
 +
 +<code>
 +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
 +</code>
 +
 +Also manually copied under ''/home/root/'':
 +
 +<code>
 +-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
 +</code>
 +
  
-=== Relevant dmesg output related to WM8962 codec ===+==== Relevant dmesg output related to WM8962 codec ====
  
 <code> <code>
Line 31: Line 56:
 </code> </code>
  
-=== Playing sample mono .wav files ===+==== Playing sample .wav files (both mono and stereo) ====
  
-Package `alsa-utils` comes with sample mono files: +With no other sound or CODEC configuration, first, turn up headphone volume:
- +
-<code> +
-Front_Center.wav +
-Front_Left.wav +
-Front_Right.wav +
-Noise.wav +
-Rear_Center.wav +
-Rear_Left.wav +
-Rear_Right.wav +
-Side_Left.wav +
-Side_Right.wav +
-</code> +
- +
-First, turn up headphone volume:+
  
 <code> <code>
Line 57: Line 68:
 </code> </code>
  
-and play all of them:+In loop, play all mono files in ''/usr/share/sounds/alsa/'', they all play on the left headphone only (which is to be expected):
  
 <code> <code>
Line 66: Line 77:
 </code> </code>
  
-All play only on the left channel, so this is clearly the default configuration for mono files.+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.
  
-=== Playing stereo files === 
  
-Copy more sample files to target:+==== Switching channels for mono files ====
  
-<code> +To verify we can send digital input to the right channelthe digital audio interface supports swapping the channels immediately upon input:
--rw-r--r--    1 root     root         53544 Oct  3  2017 pcm0808m.wav +
--rw-r--r--    1 root     root        107042 Oct  3  2017 pcm0808s.wav +
--rw-r--r--    1 root     root        107042 Oct  3  2017 pcm1608m.wav +
--rw-r--r--    1 root     root        214040 Oct  3  2017 pcm1608s.wav +
-</code> +
- +
-Mono files play only on leftstereo files play on both. +
- +
-=== Switching channels for mono files === +
- +
-By default:+
  
 <code> <code>
Line 92: Line 91:
 </code> </code>
  
-Switch, so mono files play on right headphone:+Switch, so mono files play only on right headphone:
  
 <code> <code>
Line 101: Line 100:
 </code> </code>
  
-Turn off for now. +Verified that that works, so turn this off. All this verifies is that we can route digital input to the right headphone. 
- +==== Headphone mixers ====
-=== Headphone mixers ===+
  
 By default, both HP channels bypass the HP mixers and get their output directly from the DAC: By default, both HP channels bypass the HP mixers and get their output directly from the DAC:
Line 121: Line 119:
 </code> </code>
  
-For the left channel, we can use the mixer and just feed the left channel into the mixer, effectively getting the same result:+The above represents bypassing the headphone mixers on both channels. Experiment with just mono files and try to set the left channel to come through the mixer for that channel. 
 + 
 +Firstswitch to have HPOUTL come from the mixer, not directly from DACL. This should kill the output to the left HP channel (until we configure the mixer properly): 
 + 
 +<code> 
 +# amixer cset name="HPOUTL PGA" Mixer 
 +numid=95,iface=MIXER,name='HPOUTL PGA' 
 +  ; type=ENUMERATED,access=rw------,values=1,items=2 
 +  ; Item #0 'DAC' 
 +  ; Item #1 'Mixer' 
 +  values=1 
 +</code>
  
 <code> <code>
-# amixer set "HPOUTL PGA" Mixer+# amixer get "HPOUTL PGA"
 Simple mixer control 'HPOUTL PGA',0 Simple mixer control 'HPOUTL PGA',0
   Capabilities: enum   Capabilities: enum
Line 131: Line 140:
 </code> </code>
  
-This effectively kills the left output channel until we set the mixer properly:+Indeed, playing mono files now produces no output at all (which is expected). 
 + 
 +Now configure HPMIXL to get input from DACL:
  
 <code> <code>
-# amixer sget "HPMIXL DACL"+# amixer set "HPMIXL DACL" on
 Simple mixer control 'HPMIXL DACL',0 Simple mixer control 'HPMIXL DACL',0
   Capabilities: pswitch pswitch-joined   Capabilities: pswitch pswitch-joined
   Playback channels: Mono   Playback channels: Mono
-  Mono: Playback [off]+  Mono: Playback [on]
 </code> </code>
 +
 +But playing a mono wav file ... no sound. Not good. Oh, wait, must turn on headphone mixer:
  
 <code> <code>
-# amixer sset "HPMIXL DACL" on +# amixer set "Headphone Mixeron,on 
-Simple mixer control 'HPMIXL DACL',0 +Simple mixer control 'Headphone Mixer',0 
-  Capabilities: pswitch pswitch-joined +  Capabilities: pswitch 
-  Playback channels: Mono +  Playback channels: Front Left - Front Right 
-  Mono: Playback [on]+  Mono
 +  Front Left: Playback [on] 
 +  Front Right: Playback [on]
 </code> </code>
 +
 +In short:
 +
 +  * switch ''HPOUTL PGA'' to "Mixer"
 +  * enable ''HPMIXL DACL''
 +  * enable "Headphone Mixer"
 +
 +==== Playing mono .wav files on both headphone channels ====
 +
 +Seems simple enough:
 +
 +  * Switch ''HPOUTR PGA'' to "Mixer"
 +  * Make sure "Headphone Mixer" is enabled
 +  * Enable ''HPMIXR DACL''
  • mcimx6q-sbc.1507036622.txt.gz
  • Last modified: 2017/10/03 13:17
  • by rpjday