Need help understanding DPCM

Aidan MacDonald amachronic at protonmail.com
Fri Feb 25 21:34:27 CET 2022


Hi all. I want to extend an existing ASoC driver (jz4740-i2s) so it can be used with an external (discrete) codec; currently it is hardcoded to use a SoC internal codec. I'd like to be able to switch between the two codecs at runtime.

Switching between the internal and external codecs is done by toggling a bit in a register. The switch determines where the I2S signals get routed: to the internal codec or the external one. Because of this only one of the codecs can be used at a time.

It sounds like I need DPCM to handle this sort of thing - I have a single FIFO on the CPU for audio data (an FE DAI?) and it can connect to one of two codecs (the BE DAIs?) via a switch. But most of the drivers I see using DPCM look way more complicated: big DSP chips, and CPUs with a lot of DAIs. I am having a hard time separating out the essential bits from the overall "mess." The documentation is not very helpful either.

Could someone helpfully explain what a (presumably) very basic DPCM setup for this situation would look like? Or is DPCM overkill - should I be doing something else entirely? I want to do this the "right" way so I can send patches upstream.

If possible, I'd like to use one of the 'generic' audio card drivers like simple-audio-card. BTW, what is the difference between simple-audio-card, audio-graph-card, and audio-graph-card2? They all seem to do very similar things and share a lot of code.

Thanks!

Best regards,
Aidan


More information about the Alsa-devel mailing list