PCM multichannel (LPCM) in X96 Air


I have a X96 air box and I am unable to get multi channel PCM working. According to [SOLVED] PCM multichannel (LPCM?) with N2 it seems like multi channel PCM should be working. I tried both stable and nightly builds and could not get it to work. I get only 2 channels (left and right)

I am not sure if this is a dtb issue or something else. I have used sm1_s905x3_4g_1gbit.dtb and everything works perfectly except for PCM audio. I tried “speaker-test -D surround71 -c 6” but I can only hear noise in left and right channels. Here are the dmesg logs from the speaker-test run (not sure if they are useful)

[ 5519.813758@2] aml_tdm_open
[ 5519.813982@2] audio_ddr_mngr: frddrs[1] registered by device ff660000.audiobus:i2s2hdmi
[ 5519.816905@2] aml_dai_set_tdm_sysclk(), mpll no change, keep clk
[ 5519.816914@2] aml_dai_set_tdm_sysclk(), mclk no change, keep clk
[ 5519.816925@2] set mclk:12288000, mpll:24576000, get mclk:12287994, mpll:24575987
[ 5519.816930@2] asoc aml_dai_set_tdm_fmt, 0x4001, ffffffc0a4e86c18, id(2), clksel(2)
[ 5519.816933@2] aml_dai_set_tdm_fmt(), fmt not change
[ 5519.816938@2] dump_pcm_setting(ffffffc0a4e86c18)
[ 5519.816940@2] pcm_mode(1)
[ 5519.816942@2] sysclk(12288000)
[ 5519.816944@2] sysclk_bclk_ratio(4)
[ 5519.816946@2] bclk(3072000)
[ 5519.816948@2] bclk_lrclk_ratio(64)
[ 5519.816950@2] lrclk(48000)
[ 5519.816952@2] tx_mask(0x3)
[ 5519.816953@2] rx_mask(0x3)
[ 5519.816955@2] slots(2)
[ 5519.816957@2] slot_width(32)
[ 5519.816959@2] lane_mask_in(0x0)
[ 5519.816961@2] lane_mask_out(0xf)
[ 5519.816963@2] lane_oe_mask_in(0x0)
[ 5519.816965@2] lane_oe_mask_out(0x0)
[ 5519.816966@2] lane_lb_mask_in(0x0)
[ 5519.816969@2] aml_dai_set_tdm_sysclk(), mpll no change, keep clk
[ 5519.816971@2] aml_dai_set_tdm_sysclk(), mclk no change, keep clk
[ 5519.816974@2] set mclk:12288000, mpll:24576000, get mclk:12287994, mpll:24575987
[ 5519.816979@2] aml_dai_set_clkdiv, div 4, clksel(2)
[ 5519.816988@2] aml_dai_set_bclk_ratio, select I2S mode
[ 5519.816998@2] aml_dai_tdm_hw_params(), enable mclk for TDM-C
[ 5519.817173@2] aml_tdm_prepare(), reset fddr
[ 5519.817411@2] tdm playback mute: 0, lane_cnt = 4
[ 5519.821909@2] asoc-aml-card auge_sound: tdm playback enable

Let me know if you need any other logs. Thanks in advance!

Did you enable it in the mediacenter settings?

Yes, I did also try kodi settings too. Same result. Left and right audio work but none of the other speakers. I used the HDMI Multi Channel PCM output. Disabled pass through, because I really want the PCM output.

Did you set the correct channels?

Yes, 5.1 which is my speaker configuration.

Any pointers on how I can get started on debugging this issue? Happy to edit source code and build the image, but I don’t even know where to start.

I doubt there is anything to change. The code should work on all generic boxes too. SoC is the same as Odroid C4.
I think it is the settings.

Try setting it to 7.1 and see if there’s any difference.

I tried 7.1, still only 2 channels work :(. My settings are as follows

  1. Audio output device: ALSA:AML-AUGESOUND, HDMI Multi Ch PCM
  2. Number of channels: 7.1 (tried 5.1 too)
  3. Output configuration: Best match (tried optimized and fixed too)
  4. Stereo upmix: off
  5. Allow passthrough: off

Thanks for the help, but seems like something is off. May be X96 Air is different from ODroid C4. I will see if I can find a thread specifically for X96 air and ask someone with the same box if they were able to get LPCM working.

Try Allow Passthrough.

I actually don’t want passthrough. I know it sounds a bit strange, but I want all my media decoded to PCM and played that way. The issue is that my AVR can only decode DD and DTS. The way I have things setup is I set high volume on my AVR and control the volume using the media center remote. Now, when I play movies with DD or DTS and passthrough, the audio is bit streamed and my speakers blare with full sound. I have to control sound using my AVR remote which doesn’t work anymore.

I rather have volume control in one place which coreelec. That is only possible either with LPCM or lossy transcoding. I prefer LPCM since my AVR can handle it. The last option would be to transcode even DD audio so there is volume control. I know it sounds crazy to decode a lossy audio for volume adjustment and then transcode to another lossy format :). But I prefer volume control over some loss of audio quality if it comes to it.

But to your point, I did try passthrough and 5.1 AAC audio still plays only through 2 speakers although I set the number of channels to 5.1.

Or you could use CEC to control the volume of your AVR using the tv remote.

True, but there are some other side effects of CEC that I’d like to avoid. For now it seems like I might have to go with transcoding. If some one confirms LPCM working on X96 Air then I can try their settings. Or may be I will wait for Kodi 19 with linux kernel 5.6 which might get HDMI PCM working for S905X3 boards.

You must wait a long time …
Mainline on Amlogic is still pre alpha

That’s unfortunate. But CoreELEC is doing pretty much everything I need except for LPCM. I guess I can live with it. Thanks to the whole CoreELEC team for making this possible!

But normally you can setup what your AVR is capable of in the audio settings. Can’t you just unset everything? But you say that a 7.1 aac file doesn’t play either right.

Yes I tried unsetting all passthrough formats (but allowed passthrough) and tried AAC file. Still got 2 channels. I pretty much tried all sorts of combinations really :slight_smile:

Why are you so fixated on LPCM ?

For the reasons mentioned in PCM multichannel (LPCM) in X96 Air

In summary, I just want to use one remote (the X96 Air remote) to control volume. If I enable passthrough I need to control volume using AVR remote that does not work.

I don´t understand :thinking:
My AVR is controlled by my Minix A2 remote.
Don´t think it´s any CE issue which could be fixed by the devs