* Questions about driver implementation (1 I2S controller to 2 codecs)
@ 2022-06-24 20:33 Paul Cercueil
2022-06-25 20:19 ` Aidan MacDonald
0 siblings, 1 reply; 2+ messages in thread
From: Paul Cercueil @ 2022-06-24 20:33 UTC (permalink / raw)
To: alsa-devel; +Cc: Christophe Branchereau
Hi,
I'm trying to add support for a new board that uses the Ingenic JZ4770
SoC.
This SoC has a I2S/AC97 controller, and has an internal codec. The
controller has a register switch to select either the internal codec,
or an external codec; both cannot be enabled at the same time.
On this board, the external speakers / audio line are wired to the
internal codec, while a HDMI chip (ITE66121) is wired as the external
codec.
I'm having a hard time trying to figure out how the codec selection
switch should be exported. Should it be a regular widget, and the user
is responsible for selecting the right codec? Should it be a DAPM, and
plugging the HDMI cable auto-enables the switch? Is this configuration
(one controller to two codecs) already somehow supported by ALSA?
Right now we're using a "simple-audio-card" in the device tree, and
trying to add HDMI sound support. I am not even sure if we should be
using one sound card with the two codecs, or one sound card per codec,
sharing the same I2S controller?
Any thoughts?
Thanks,
-Paul
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Questions about driver implementation (1 I2S controller to 2 codecs)
2022-06-24 20:33 Questions about driver implementation (1 I2S controller to 2 codecs) Paul Cercueil
@ 2022-06-25 20:19 ` Aidan MacDonald
0 siblings, 0 replies; 2+ messages in thread
From: Aidan MacDonald @ 2022-06-25 20:19 UTC (permalink / raw)
To: paul; +Cc: alsa-devel, cbranchereau
Paul Cercueil <paul@crapouillou.net> writes:
> Hi,
>
> I'm trying to add support for a new board that uses the Ingenic JZ4770
> SoC.
>
> This SoC has a I2S/AC97 controller, and has an internal codec. The
> controller has a register switch to select either the internal codec,
> or an external codec; both cannot be enabled at the same time.
>
> On this board, the external speakers / audio line are wired to the
> internal codec, while a HDMI chip (ITE66121) is wired as the external
> codec.
>
> I'm having a hard time trying to figure out how the codec selection
> switch should be exported. Should it be a regular widget, and the user
> is responsible for selecting the right codec? Should it be a DAPM, and
> plugging the HDMI cable auto-enables the switch? Is this configuration
> (one controller to two codecs) already somehow supported by ALSA?
>
> Right now we're using a "simple-audio-card" in the device tree, and
> trying to add HDMI sound support. I am not even sure if we should be
> using one sound card with the two codecs, or one sound card per codec,
> sharing the same I2S controller?
>
> Any thoughts?
>
> Thanks,
> -Paul
I'm also interested in this, although I'm using a different Ingenic SoC
(also using jz4740-i2s). In my case I have a microphone connected to
the internal codec and an external codec for playback.
Some thoughts: maybe DPCM is what we want? There's three DAIs: the CPU,
the internal codec, and the external codec. The I2S controller selects
which codec DAI the CPU DAI is connected to. DPCM seems to be the only
thing in ALSA that deals with dynamic DAI <-> DAI connections. I can't
figure it out though; the documentation is too sparse and DPCM-enabled
drivers are complicated beasts.
Codec selection should probably be left up to userspace though. ALSA
isn't really in a position to make routing decisions like that, there
is no one-size-fits-all approach that'd be suitable for every board.
What ALSA _can_ do is respond to the user's audio routing choice and
look at the machine state (jacks/connectors, muxes, mixers, etc), and
power things up or down as appropriate.
Regards,
Aidan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-25 20:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-24 20:33 Questions about driver implementation (1 I2S controller to 2 codecs) Paul Cercueil
2022-06-25 20:19 ` Aidan MacDonald
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox