Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Stephen Gordon <gordoste@iinet.net.au>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Jaroslav Kysela <perex@perex.cz>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH v2 0/6] ASoC: extra format on each DAI
Date: Mon, 30 Dec 2024 17:02:34 +1100	[thread overview]
Message-ID: <bbdced52-a155-4c9c-9afd-187200fa5371@iinet.net.au> (raw)
In-Reply-To: <86c91aa6-f185-496f-b4d4-4eea1e67fa27@iinet.net.au>

On 28/12/2024 10:18 pm, Stephen Gordon wrote:
> On 27/12/2024 11:21 pm, Stephen Gordon wrote:
>> On 23/12/2024 1:01 pm, Kuninori Morimoto wrote:
>>>
>>>
>>>> [   27.333830] asoc-audio-graph-card2 soc@107c000000:sound: probe with
>>>> driver asoc-audio-graph-card2 failed with error -12
> 
> In turn, this is because the linked list of siblings is actually in 
> reverse order due to the way populate_node() (drivers/of/fdt.c) adds 
> them. 

It looks like the node order is fixed up later...
https://github.com/torvalds/linux/blob/fc033cf25e612e840e545f8d5ad2edd6ba613ed5/drivers/of/fdt.c#L330

However drivers/ot/dynamic.c uses similar node insertion code, but 
without any reordering. I guess this is what is used on my machine 
(Raspberry Pi 5) - perhaps your DT is just built differently :)

> I get a playback DAI visible in aplay, however the capture DAI is not 
> visible in arecord. If I swap the order of the codec ports in multi/ 
> ports, then I get a capture DAI visible in arecord, but the playback DAI 
> is missing :)

This was because of the playback-only and capture-only flags in my 
previous DTS. These flags are actually on the dai_link, so specifying 
this flag on a port/endpoint affects the whole link. Since I specified 
both, whichever one is processed last takes effect.

I think we should either:
- Make this a flag at the link level
	e.g. 	links = <&link0 PLAYBACK_ONLY>
or
- Document the behaviour

Anyway, once I removed those flags, the DTS works, as long as the CPU 
port is listed _last_ inside the 'multi' node. This is equivalent to a 
requirement to list the CPU port _first_ on other platforms.

gordoste@rpi5:~/i2smulti $ diff graph-working.dts graph-broken.dts
48,50c48,50
<                       port@0 { reg = <0>; link_dac: endpoint { 
remote-endpoint = <&codec_dac>;  };};
<                       port@1 { reg = <1>; link_adc: endpoint { 
remote-endpoint = <&codec_adc>;  };};
<                       port@2 { reg = <2>; link_cpu: endpoint { 
remote-endpoint = <&cpu_i2s>;    };};
---
 >                       port@0 { reg = <0>; link_cpu: endpoint { 
remote-endpoint = <&cpu_i2s>;    };};
 >                       port@1 { reg = <1>; link_dac: endpoint { 
remote-endpoint = <&codec_dac>;  };};
 >                       port@2 { reg = <2>; link_adc: endpoint { 
remote-endpoint = <&codec_adc>;  };};


Regards
Stephen

  reply	other threads:[~2024-12-30  6:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19  0:34 [PATCH v2 0/6] ASoC: extra format on each DAI Kuninori Morimoto
2024-12-19  0:35 ` [PATCH v2 1/6] ASoC: audio-graph-card2: use __free(device_node) for device node Kuninori Morimoto
2024-12-19  0:35 ` [PATCH v2 2/6] ASoC: audio-graph-card: " Kuninori Morimoto
2024-12-19  0:35 ` [PATCH v2 3/6] ASoC: simple-card: " Kuninori Morimoto
2024-12-19  0:35 ` [PATCH v2 4/6] ASoC: soc-core: return 0 if np was NULL on snd_soc_daifmt_parse_clock_provider_raw() Kuninori Morimoto
2024-12-19  0:35 ` [PATCH v2 5/6] ASoC: soc-core: Enable to use extra format on each DAI Kuninori Morimoto
2024-12-19  0:35 ` [PATCH v2 6/6] ASoC: audio-graph-card2: Use " Kuninori Morimoto
2024-12-20  0:01 ` [PATCH v2 0/6] ASoC: " Stephen Gordon
2024-12-23  2:01   ` Kuninori Morimoto
2024-12-27 12:21     ` Stephen Gordon
2024-12-28 11:18       ` Stephen Gordon
2024-12-30  6:02         ` Stephen Gordon [this message]
2024-12-30 12:41           ` Stephen Gordon
2025-01-06  2:47             ` Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bbdced52-a155-4c9c-9afd-187200fa5371@iinet.net.au \
    --to=gordoste@iinet.net.au \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox