All of lore.kernel.org
 help / color / mirror / Atom feed
* Amlogic DPCM audio card(s) speaker placement issue
@ 2021-12-10 11:06 ` Christian Hewitt
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Hewitt @ 2021-12-10 11:06 UTC (permalink / raw)
  To: alsa-devel, linux-amlogic; +Cc: Matthias Reichl, Jerome Brunet

Hello alsa-dev / linux-amlogic,

I’d like to describe a problem with speaker placement seen with the Amlogic
(meson) AIU and AXG audio drivers. Playing media in Kodi I’d noticed that
placement is consistently wrong; meaning the incorrect placement remains
the same over different media and Amlogic hardwares.

This was traced to a failure to get the channel map via snd_pcm_get_chmap()
and further analysis showed this failed because the PCM controls are exposed
on a different device than the PCM stream.

e.g. on LibreTech LePotato with DPCM routing configured for HDMI output,
the hw PCM is on the single frontend device 0 but the PCM controls are
on device 2:

LePotato:~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: LIBRETECHCC [LIBRETECH-CC], device 0: fe.dai-link-0 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

LePotato:~ # amixer controls
numid=19,iface=MIXER,name='PCM Playback Volume'
numid=18,iface=MIXER,name='ACODEC Left DAC Sel'
numid=7,iface=MIXER,name='ACODEC Mute Ramp Switch'
numid=2,iface=MIXER,name='ACODEC Playback Channel Mode'
numid=3,iface=MIXER,name='ACODEC Playback Switch'
numid=4,iface=MIXER,name='ACODEC Playback Volume'
numid=5,iface=MIXER,name='ACODEC Ramp Rate'
numid=17,iface=MIXER,name='ACODEC Right DAC Sel'
numid=8,iface=MIXER,name='ACODEC Unmute Ramp Switch'
numid=6,iface=MIXER,name='ACODEC Volume Ramp Switch'
numid=1,iface=MIXER,name='AIU ACODEC I2S Lane Select'
numid=16,iface=MIXER,name='AIU ACODEC OUT EN Switch'
numid=15,iface=MIXER,name='AIU ACODEC SRC'
numid=14,iface=MIXER,name='AIU HDMI CTRL SRC'
numid=13,iface=MIXER,name='AIU SPDIF SRC SEL'
numid=12,iface=PCM,name='ELD',device=2
numid=11,iface=PCM,name='IEC958 Playback Default',device=2
numid=10,iface=PCM,name='IEC958 Playback Mask',device=2
numid=9,iface=PCM,name='Playback Channel Map',device=2

https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts#L136-L188

or on a Wetek Play 2:

WP2:~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: WETEKPLAY2 [WETEK-PLAY2], device 0: fe.dai-link-0 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: WETEKPLAY2 [WETEK-PLAY2], device 1: fe.dai-link-1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

WP2:~ # amixer controls
numid=7,iface=MIXER,name='PCM Playback Volume'
numid=6,iface=MIXER,name='AIU HDMI CTRL SRC'
numid=5,iface=MIXER,name='AIU SPDIF SRC SEL'
numid=4,iface=PCM,name='ELD',device=4
numid=3,iface=PCM,name='IEC958 Playback Default',device=4
numid=2,iface=PCM,name='IEC958 Playback Mask',device=4
numid=1,iface=PCM,name='Playback Channel Map',device=4

https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts#L51-L97

It looks like the PCM controls of the backend hdmi-codec are not routed
through the DPCM driver the same way as PCM streams. We discussed that
issue with Jerome, the driver author, but it’s not clear which bits we
are missing. i.e. if it's something ASoC DPCM should be handling or if
some further plumbing in the card driver or userspace is needed?

Any hints into the right direction would be highly appreciated!

Christian


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Amlogic DPCM audio card(s) speaker placement issue
@ 2021-12-10 11:06 ` Christian Hewitt
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Hewitt @ 2021-12-10 11:06 UTC (permalink / raw)
  To: alsa-devel, linux-amlogic; +Cc: Matthias Reichl, Jerome Brunet

Hello alsa-dev / linux-amlogic,

I’d like to describe a problem with speaker placement seen with the Amlogic
(meson) AIU and AXG audio drivers. Playing media in Kodi I’d noticed that
placement is consistently wrong; meaning the incorrect placement remains
the same over different media and Amlogic hardwares.

This was traced to a failure to get the channel map via snd_pcm_get_chmap()
and further analysis showed this failed because the PCM controls are exposed
on a different device than the PCM stream.

e.g. on LibreTech LePotato with DPCM routing configured for HDMI output,
the hw PCM is on the single frontend device 0 but the PCM controls are
on device 2:

LePotato:~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: LIBRETECHCC [LIBRETECH-CC], device 0: fe.dai-link-0 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

LePotato:~ # amixer controls
numid=19,iface=MIXER,name='PCM Playback Volume'
numid=18,iface=MIXER,name='ACODEC Left DAC Sel'
numid=7,iface=MIXER,name='ACODEC Mute Ramp Switch'
numid=2,iface=MIXER,name='ACODEC Playback Channel Mode'
numid=3,iface=MIXER,name='ACODEC Playback Switch'
numid=4,iface=MIXER,name='ACODEC Playback Volume'
numid=5,iface=MIXER,name='ACODEC Ramp Rate'
numid=17,iface=MIXER,name='ACODEC Right DAC Sel'
numid=8,iface=MIXER,name='ACODEC Unmute Ramp Switch'
numid=6,iface=MIXER,name='ACODEC Volume Ramp Switch'
numid=1,iface=MIXER,name='AIU ACODEC I2S Lane Select'
numid=16,iface=MIXER,name='AIU ACODEC OUT EN Switch'
numid=15,iface=MIXER,name='AIU ACODEC SRC'
numid=14,iface=MIXER,name='AIU HDMI CTRL SRC'
numid=13,iface=MIXER,name='AIU SPDIF SRC SEL'
numid=12,iface=PCM,name='ELD',device=2
numid=11,iface=PCM,name='IEC958 Playback Default',device=2
numid=10,iface=PCM,name='IEC958 Playback Mask',device=2
numid=9,iface=PCM,name='Playback Channel Map',device=2

https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts#L136-L188

or on a Wetek Play 2:

WP2:~ # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: WETEKPLAY2 [WETEK-PLAY2], device 0: fe.dai-link-0 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: WETEKPLAY2 [WETEK-PLAY2], device 1: fe.dai-link-1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

WP2:~ # amixer controls
numid=7,iface=MIXER,name='PCM Playback Volume'
numid=6,iface=MIXER,name='AIU HDMI CTRL SRC'
numid=5,iface=MIXER,name='AIU SPDIF SRC SEL'
numid=4,iface=PCM,name='ELD',device=4
numid=3,iface=PCM,name='IEC958 Playback Default',device=4
numid=2,iface=PCM,name='IEC958 Playback Mask',device=4
numid=1,iface=PCM,name='Playback Channel Map',device=4

https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts#L51-L97

It looks like the PCM controls of the backend hdmi-codec are not routed
through the DPCM driver the same way as PCM streams. We discussed that
issue with Jerome, the driver author, but it’s not clear which bits we
are missing. i.e. if it's something ASoC DPCM should be handling or if
some further plumbing in the card driver or userspace is needed?

Any hints into the right direction would be highly appreciated!

Christian


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-10 11:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 11:06 Amlogic DPCM audio card(s) speaker placement issue Christian Hewitt
2021-12-10 11:06 ` Christian Hewitt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.