i.mx6q android 2 x hdmi audio problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx6q android 2 x hdmi audio problem

Jump to solution
1,787 Views
bingking88
Contributor I

I have 2 hdmi output in android system, but the only way hdmi sound output,

ssi902x ---> mxc-spdif-0

mxc-hdmi -----> mxc-hdmi-soc-0

how to configure so that two hdmi has sound output.thanks!:smileyplain:

my hardware audio equipment

root@android:/ # alsa_aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: sgtl5000audio [sgtl5000-audio], device 0: HiFi sgtl5000-0 []

Subdevices: 1/1

Subdevice #0: subdevice #0

card 1: imxspdif [imx-spdif], device 0: IMX SPDIF mxc-spdif-0 []

Subdevices: 1/1

Subdevice #0: subdevice #0

card 2: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 []

Subdevices: 1/1

Subdevice #0: subdevice #0

Labels (4)
0 Kudos
1 Solution
821 Views
juangutierrez
NXP Employee
NXP Employee

Hi

If what you are trying to do is to render the same audio trough both hdmi and spdif at same time. You can add something like this in your /system/etc/asound.conf

================ /system/etc/asound.conf ====================

pcm.both {        # change name "pcm.both" for pcm.!default to make it the default configuration

  type plug;

  slave.pcm {

      type multi;

      slaves.a.pcm "hw:0,0";   #in your case hw:1,0 for spdif (card1, dev 0)

      slaves.b.pcm "hw:2,0";   # hdmi card 2, dev 0

      slaves.a.channels 2;      # this is for stereo, you can set 4, 6, or 8 channels spdif

      slaves.b.channels 2;      # this is for stereo, you can set 4, 6, or 8 channels spdif

      bindings.0.slave a;         # binding channels to slave a, Add bindings if you add channels

      bindings.0.channel 0;

      bindings.1.slave a;

      bindings.1.channel 1;

      bindings.2.slave b;          # binding channels to slave a. Add bindings if you add channels

      bindings.2.channel 0;

      bindings.3.slave b;

      bindings.3.channel 1;

  }

  ttable.0.0 1;

  ttable.1.1 1;

  ttable.0.2 1;

  ttable.1.3 1;

}

=====================================================

The you can play audio with alsa like

aplay -Dboth file.wav   (I think in android is alsa_aplay)

If you replace the pcm.both name with pcm.!default then the command is just like

aplay file.wav

I tested this using cs42888 in card0 and hdmi as card2 and I was able to hear same audio in my headphones and in the hdmi monitor at same time. Also I did it in a Gnome FS, not Android but I guess should be similar.

View solution in original post

0 Kudos
3 Replies
821 Views
AlejandroSierra
NXP Employee
NXP Employee

You need to register another imx-hdmi-soc-dai.

Take the HDMI 0 as a base.

This file arch/arm/plat-mxc/devices/platform-imx-hdmi-soc-dai.c registers HDMI-SOC-0.

0 Kudos
821 Views
bingking88
Contributor I

Dear Alejandro Sierra Guiza

    Thank you for your acvtive reply,In the default configuration ,spdif  audio has been configured in arch/arm/plat-mxc/devices/platform-imx-spdif-dai.c . my android patch r13.4 ,in android hal ,I add Support spdif audio ,but hmdi audio output only spdif audio,Could you tell me what should I do to make dual HDMI  output sound ? Thanks again

0 Kudos
822 Views
juangutierrez
NXP Employee
NXP Employee

Hi

If what you are trying to do is to render the same audio trough both hdmi and spdif at same time. You can add something like this in your /system/etc/asound.conf

================ /system/etc/asound.conf ====================

pcm.both {        # change name "pcm.both" for pcm.!default to make it the default configuration

  type plug;

  slave.pcm {

      type multi;

      slaves.a.pcm "hw:0,0";   #in your case hw:1,0 for spdif (card1, dev 0)

      slaves.b.pcm "hw:2,0";   # hdmi card 2, dev 0

      slaves.a.channels 2;      # this is for stereo, you can set 4, 6, or 8 channels spdif

      slaves.b.channels 2;      # this is for stereo, you can set 4, 6, or 8 channels spdif

      bindings.0.slave a;         # binding channels to slave a, Add bindings if you add channels

      bindings.0.channel 0;

      bindings.1.slave a;

      bindings.1.channel 1;

      bindings.2.slave b;          # binding channels to slave a. Add bindings if you add channels

      bindings.2.channel 0;

      bindings.3.slave b;

      bindings.3.channel 1;

  }

  ttable.0.0 1;

  ttable.1.1 1;

  ttable.0.2 1;

  ttable.1.3 1;

}

=====================================================

The you can play audio with alsa like

aplay -Dboth file.wav   (I think in android is alsa_aplay)

If you replace the pcm.both name with pcm.!default then the command is just like

aplay file.wav

I tested this using cs42888 in card0 and hdmi as card2 and I was able to hear same audio in my headphones and in the hdmi monitor at same time. Also I did it in a Gnome FS, not Android but I guess should be similar.

0 Kudos