From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1.perex.cz (mail1.perex.cz [77.48.224.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA758364D2 for ; Thu, 2 May 2024 08:02:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=77.48.224.245 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714636973; cv=none; b=aw5Fd0+w8jErLjBm0w6I8KolR+73rWUyY/SwgSDLjsByaPhk2FlWCZgaqxoAesoDYVoCXKnFVAqfmRPJQwhzxeqKaPc5Np1YiZjg1trfKpxJ6ek7VjXE5s+wZns2k+RD0p/9u7CSQ+UKlHp9Jy0cPsNZLDYunbtlLDWhJJy1OiE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714636973; c=relaxed/simple; bh=BzY1wpsfAeganyYmgPtL8R8fKwdRae+3ydAQczPu8AY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aKCrv4Q1H/RFqP/SqWCgj85G0PtXGuSiNP4/CGegR8Ric1mrhdlV3Gq7eHKeOkP7qiqIxhjhHXljWRh1CYx6T25tYd2JQPFursS2UdVY1/zg4K3TB5byrxis3rISPqIPJUh7IvxHMcRL01Z8vQnnesycWEBHUBU8VR8pl6Aqm4U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=perex.cz; spf=pass smtp.mailfrom=perex.cz; dkim=pass (1024-bit key) header.d=perex.cz header.i=@perex.cz header.b=UXabCJTa; arc=none smtp.client-ip=77.48.224.245 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=perex.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=perex.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=perex.cz header.i=@perex.cz header.b="UXabCJTa" Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id DC5929B1; Thu, 2 May 2024 10:02:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz DC5929B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1714636960; bh=5W6UAsS7msezh7UospoxsxQWw5Pf++cOlMp6vW3dCEE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=UXabCJTaUpB/UYkg9gWAKGrbYFNCDwOWGCQGkZ3ijwqlKU2YDTjjnusnG9JIyy6AY 5MPH8tuVto4A/DZsEdAO+9uSPkX6/he3zdXn7WnFknh0mvwrFBTjRyQikuTNEEQze4 w6M8BEwJNbjzYZ+R7YJnmciJWiSlOkYV7OVkzTio= Received: from [192.168.100.98] (unknown [192.168.100.98]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Thu, 2 May 2024 10:02:37 +0200 (CEST) Message-ID: Date: Thu, 2 May 2024 10:02:36 +0200 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ALSA: pcm: reinvent the stream synchronization ID API Content-Language: en-US To: Takashi Iwai Cc: linux-sound@vger.kernel.org, Takashi Sakamoto References: <20240430161012.4011064-1-perex@perex.cz> <87v83wk6ue.wl-tiwai@suse.de> From: Jaroslav Kysela Autocrypt: addr=perex@perex.cz; keydata= xsFNBFvNeCsBEACUu2ZgwoGXmVFGukNPWjA68/7eMWI7AvNHpekSGv3z42Iy4DGZabs2Jtvk ZeWulJmMOh9ktP9r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AQABwsF2BBgBCAAgFiEEXt/stl6kzdRO+axFMKzEfD96UwkFAlvNeCsCGwwACgkQ MKzEfD96Uwlkjg/+MZVS4M/vBbIkH3byGId/MWPy13QdDzBvV0WBqfnr6n99lf7tKKp85bpB y7KRAPtXu+9WBzbbIe42sxmWJtDFIeT0HJxPn64l9a1btPnaILblE1mrfZYAxIOMk3UZA3PH uFdyhQDJbDGi3LklDhsJFTAhBZI5xMSnqhaMmWCL99OWwfyJn2omp8R+lBfAJZR31vW6wzsj ssOvKIbgBpV/o3oGyAofIXPYzhY+jhWgOYtiPw9bknu748K+kK3fk0OeEG6doO4leB7LuWig dmLZkcLlJzSE6UhEwHZ8WREOMIGJnMF51WcF0A3JUeKpYYEvSJNDEm7dRtpb0x/Y5HIfrg5/ qAKutAYPY7ClQLu5RHv5uqshiwyfGPaiE8Coyphvd5YbOlMm3mC/DbEstHG7zA89fN9gAzsJ 0TFL5lNz1s/fo+//ktlG9H28EHD8WOwkpibsngpvY+FKUGfJgIxpmdXVOkiORWQpndWyRIqw k8vz1gDNeG7HOIh46GnKIrQiUXVzAuUvM5vI9YaW3YRNTcn3pguQRt+Tl9Y6G+j+yvuLL173 m4zRUU6DOygmpQAVYSOJvKAJ07AhQGaWAAi5msM6BcTU4YGcpW7FHr6+xaFDlRHzf1lkvavX WoxP1IA1DFuBMeYMzfyi4qDWjXc+C51ZaQd39EulYMh+JVaWRoY= In-Reply-To: <87v83wk6ue.wl-tiwai@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 02. 05. 24 9:31, Takashi Iwai wrote: > On Tue, 30 Apr 2024 18:10:12 +0200, > Jaroslav Kysela wrote: >> >> Until the commit e11f0f90a626 ("ALSA: pcm: remove SNDRV_PCM_IOCTL1_INFO >> internal command"), there was a possibility to pass information >> about the synchronized streams to the user space. The mentioned >> commit removed blindly the appropriate code with an irrelevant comment. >> >> The revert may be appropriate, but since this API was lost for several >> years without any complains, it's time to improve it. The hardware >> parameters may change the used stream clock source (e.g. USB hardware) >> so move this synchronization ID to hw_params as read-only field. > > What's the benefit of moving to hw_params? The current inquiry via > ioctl can also follow the dynamic change, no? I'm not entirely > objecting to the idea, but need to understand better. In the removed code, there was a comment from Abramo that this ioctl is not so much appropriate to carry this information because it depends on the runtime status. Also, this info ioctl is callable through the control API thus the result depends on the stream open state. The revert is just a simple solution, but given the fact that the API was suspended for several years, we can do this cleanup now IMHO. >> It seems that pipewire can benefit from this API (disable adaptive >> resampling for perfectly synchronized PCM streams) now. > > If the support by pipewire is planned, it'd be good to revive the > feature, yes. Pipewire would like to be able to detect the synchronized streams and Wim is aware about sync_id API, but it does not work now without obsoleting this in alsa-lib. I think that we did a wrong job here. >> --- a/include/uapi/sound/asound.h >> +++ b/include/uapi/sound/asound.h > (snip) >> @@ -334,6 +334,7 @@ union snd_pcm_sync_id { >> unsigned char id[16]; >> unsigned short id16[8]; >> unsigned int id32[4]; >> + __u64 id64[2]; >> }; > > What's the reason for this __u64 addition? For the easiness of > zero-compare? Basically yes, but this extensions is aligned with other fields. Also, I think that it may be usable to work with 64-bit words here. Perhaps, other fields may use __uXX declarations, too. Jaroslav -- Jaroslav Kysela Linux Sound Maintainer; ALSA Project; Red Hat, Inc.