From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F3C27603F for ; Mon, 6 Jan 2025 13:24:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736169862; cv=none; b=TVKZ+mx0hduULS8Kd2GC2ED8gvgTO35rqFgmiqx038AIyAdMkqTUv4vemWnJj8DIYqI0iOGVnx7ak0Rkx9jqcmtdIp86Dzp9NyIm0j4dz2PkZf8AL+ArY/EOcoLSMa+IkOVmeRf1eeP0aWxC3qjyQqnT9AivHgFz2Pgh1EzsFfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736169862; c=relaxed/simple; bh=dkSYDb0qQi545zqCwN1aWjjhu3oBvhjT+5nxkeMCONo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=i3gyXY0qqAxSbcS09vB0e7rDeS7abrvsqt8JsElvjejGz88YDAUHUAVw+5u37wrlOXC/7+pVLzmnDes8puSaUMgzKhtizD2qvAMWx0VHJjokXu4CTRiwmC1XxRXD47LXhGqGzvk4SERYdDBEmPyyTUBhfWBvbJ/LYAlfCuz33Cs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=qbLLnbCe; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="qbLLnbCe" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-436249df846so99372045e9.3 for ; Mon, 06 Jan 2025 05:24:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736169856; x=1736774656; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wh7y9ZL8IHaZKAw4Kx4QJ+0Dl9iHJaYj8tnVocIhEBI=; b=qbLLnbCe0BY3IeJj9CCAX8kx/CxgtNFQ5JstX0+dmXmAlVnkaiQMmuZRPLhz5pPb8v Ftkfek0Zv9KxBw6abeiLGUhtE9qDYIrljpFAD+D07cdvuaiZgX1XaSDicMCDngombXks t42MPfthzrEwKyEOnF6A3coJTq/JK7s3J/BmKC+iPPzFtVPqJgqOTmkMbce5S+rpYxwW kLGu8gSMRSZcGBGNaor24qsZJPHT+gfj3GFHmHNXIf6/cNFVF4QYFsnpa4J3dxWBkRLQ FIDtDYNDMnDkMg4Le3KmfHiJrVPqXuF1U/YOx35qNBkD+aFnfQHNpAuL/wuOw3QHXl4/ yQQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736169856; x=1736774656; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wh7y9ZL8IHaZKAw4Kx4QJ+0Dl9iHJaYj8tnVocIhEBI=; b=tYqzzEj+BSABrOgHh/+ZEd+1WUi40rg/La4GFLYlSMHCwrug1tzhMIZeA58yhrDWfg TI83Jbu8zB0DmSoscZ9uhrhs4Kmm/YYhHDUikXVVSfyIkntlcmxJS2yLLT2BKPEKpOLM ddQBUXbOkA/eXF748yNOh6WEMOehktvA9jg9VJ8JuyjLTaY/I4WKxYUobwKpC85Ii1S1 X9RDLDZtcXK/qH1Bxr5X4Mp1qQYziUJ7NNDiPn32za8GOszpP5w3PmewucQSZP4PA1CH z2gM6uimJxn+dm5kZ1I5M5ZU8OVd9vYoEVrDAPUcNMG+OT/4fLcGI1DfqDU00X4hZ3tF 7XUg== X-Forwarded-Encrypted: i=1; AJvYcCXKUBbphC61ynZb8BBEqIe0wACZxqHLszmWyWHkt7H5y4Tw8iFsLKzpkYdVPmqDTHFfVDJ2nIfTTrGyHME=@vger.kernel.org X-Gm-Message-State: AOJu0Yz9O+VIeOvvZ7THisJWLyZrVaR0+QHW8rfCxJ7gib9yizLz4j3K ywEcTzYI6RDi1v7Ky9ATdoHuDrIOMM8A5qD57HqsZm2FepUZOI17xtkDHfS9vv8= X-Gm-Gg: ASbGncsz9o9Cqd2iGyMxLBs5iiNwRXqSohFS0xR1Db1nvdQjHiOn0ViM0HOiN1lEywo qU1tp2AUzzqq91nrOsT98P2zOv/KtJc86bfgcL5do4oAstbvniyuy5taRbL1zWSrmY93XdtHSx/ nuB7PEPFiYzGnRoZL4sr3jZxfTHS0DElIELqCWVg/8gu3mv9pfL/IML9crpr3b7Yg4tSMY+SfP9 VaoC8AdUOsCg295szQukh9ZecxEgxBaXM6O8CXZFz+Rjd6TkeiFDyEp X-Google-Smtp-Source: AGHT+IEYX2sk1R9ukeY4XWDMmDErFBY6fzPWeg/ypRYwHmYveU89A+VrD/4Ey7f29RphiwDzBZmMKg== X-Received: by 2002:a05:6000:178b:b0:385:e303:8dd8 with SMTP id ffacd0b85a97d-38a221ffda0mr51262438f8f.26.1736169856421; Mon, 06 Jan 2025 05:24:16 -0800 (PST) Received: from localhost ([2a01:e0a:3c5:5fb1:2a4a:e041:e2ff:6b41]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8330e0sm47133587f8f.34.2025.01.06.05.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 05:24:16 -0800 (PST) From: Jerome Brunet To: Martin Blumenstingl Cc: linux-amlogic@lists.infradead.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dmitry.baryshkov@linaro.org Subject: Re: meson-aiu: HDMI codec .prepare() callback not called In-Reply-To: (Martin Blumenstingl's message of "Mon, 6 Jan 2025 13:49:44 +0100") References: <1ja5c4b4rt.fsf@starbuckisacylon.baylibre.com> User-Agent: mu4e 1.12.7; emacs 29.4 Date: Mon, 06 Jan 2025 14:24:15 +0100 Message-ID: <1j4j2caxds.fsf@starbuckisacylon.baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon 06 Jan 2025 at 13:49, Martin Blumenstingl wrote: > Hi Jerome, > > On Mon, Jan 6, 2025 at 11:44=E2=80=AFAM Jerome Brunet wrote: > [...] >> > I have further verified that the gx-card parsing does find the HDMi >> > controller and links it correctly. >> > To me it's odd that only the .prepare() callback is not called, all >> > others (as mentioned above: .hw_params, .startup, ...) are working >> > fine. >> >> I think the problem you are seeing comes from the quirk of >> codec-to-codec links. The hdmi codec link is such a link on Amlogic >> because further digital routing is required after the backend. >> >> Those type of links are not used much beside some >> CPU offloading on Samsung and Amlogic, as far as I know. >> It is possible, even likely, that things are still missing there. >> >> So those C2C links are operated by the DAPM events, not the regualar >> ASoC code. You can start here: >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/= sound/soc/soc-dapm.c#n3995 > Thank you - that is indeed the root cause! > >> You'll see that .prepare() is not called, same as .trigger() >> That should propably be fixed :/ > Since I'm still very much clueless about all of this I just came up > with an experimental patch. Any feedback on it is welcome (I can send > it as RFC patch - but prepare for me needing support). It is probably a good idea to send it to get more feedback, yes. > With the attached patch I now see hdmi-codec's .prepare callback being ca= lled: Looks like a good start :) Couples of nitpicks: You might want to check the stream validity in the function you've introduced, like in soc_dai_trigger() It may also be nice to update snd_soc_pcm_dai_prepare() with the introduced function. > $ speaker-test -c2 > > speaker-test 1.2.13 > > Playback device is default > Stream parameters are 48000Hz, S16_LE, 2 channels > Using 16 octaves of pink noise > Rate set to 48000Hz (requested 48000Hz) > Buffer size range from 128 to 262144 > Period size range from 64 to 131072 > Periods =3D 4 > [ 42.043413] hdmi-audio-codec hdmi-audio-codec.0.auto: > hdmi_codec_hw_params() width 16 rate 48000 channels 2 > [ 42.047916] hdmi-audio-codec hdmi-audio-codec.0.auto: > hdmi_codec_prepare() width 16 rate 48000 channels 2 > > > > Best regards, > Martin > > [2. text/x-patch; soc-damp-call-prepare.diff]... --=20 Jerome