[Letux-kernel] Letux/Alpha 400: small progress with sound

H. Nikolaus Schaller hns at goldelico.com
Thu Apr 29 13:48:13 CEST 2021


Hi Maarten,

> Am 29.04.2021 um 13:31 schrieb Maarten ter Huurne <maarten at treewalker.org>:
> 
> On Thursday, 29 April 2021 09:49:47 CEST H. Nikolaus Schaller wrote:
>> [...]
>> 
>> So my plan was to compare to CI20.
>> 
>> But it turns out that the CI20 has no sound. We can try to port it
>> from FreeBSD:
>> 
>> 	https://github.com/freebsd/freebsd-src/blob/master/sys/gnu/
> dts/mips/i
>> ngenic/jz4780.dtsi
>> 
>> But it uses the internal codec:
>> 
>> 		codec: codec at 100200a4 {
>> 			compatible = "ingenic,jz4780-codec";
>> 			reg = <0x100200a4 0x8>;
>> 
>> 			clocks = <&cgu JZ4780_CLK_I2SPLL>;
>> 			clock-names = "i2s";
>> 
>> 		};
>> 
>> for which we have no Linux driver :(
> 
> There is a Linux driver for the JZ4770 internal codec, Paul Cercueil is 
> maintaining it. A quick look at both programming manuals suggests it 
> won't work as-is, but the 4780 codec is an evolution of the 4770 one, so 
> a lot of code could be re-used. Register numbers are different, but most 
> of the names and bit fields within the registers are the same.

Good to know! So at least this is a good starting point for debugging...

I'll give it a try what happens if we use the ingenic,jz4770-codec on
the CI20.

Alternatively we could check if one of the other codecs (4725, 4740, 4760)
is more similar to find the best starting point.

BTW: there seems to be a typo in the DTS node name/address of jz4770.dtsi

	codec: audio-codec at 100200a0 {
		reg = <0x100200a4 0x8>;

> 
> By the way, when debugging sound issues on the JZ4770, I found debugfs 
> very useful. It allows you to inspect the ALSA power management graph 
> (problems here can also lead to no sound playing) and allows live 
> inspection of register banks that are accessed via regmap (such as the 
> codec registers).

For the jz4730 there is only an external codec (ak4642). And that appears
to work.

Potential issues so far were with pinctrl (has been verified to be ok).

But there seems to be an initialization bug in jz4740-i2s. So I wonder
how it can work on some other boards. But the issue (clock dividers need
to be set up before being able to write to JZ_REG_AIC_CONF) may be
jz4730 specific.

And somehow DMA seems to be stuck. But we know that DMA on the jz4730
isn't working yet...

BR and thanks,
Nikolaus



More information about the Letux-kernel mailing list