Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F83BC19F2A for ; Thu, 11 Aug 2022 10:46:13 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D242614E; Thu, 11 Aug 2022 12:45:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D242614E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1660214770; bh=H61td1qt4uOuQl9C9WSfD/5OWnwPWpUoZVtG9+brf1U=; h=From:To:In-Reply-To:References:Subject:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gYELA+NYqaj/2kp3f9YIva1OoPfT+cD0YrYfFM8cU9TAzIN3V+/tYdVJ2eR+aeM0A u8ZI+gS1d2BMSG80Ea9AdGoN8hyoN5N5BGr6eTQ1KXRxMb8EJPnu/KDCdpfE1jxqB8 O6xUeQS033NHCXUaj+O5VB8jFbU95Lm+Umsjc14Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5C739F800FB; Thu, 11 Aug 2022 12:45:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C15BCF80246; Thu, 11 Aug 2022 12:45:17 +0200 (CEST) Received: from webhooks-bot.alsa-project.org (gate.perex.cz [77.48.224.242]) by alsa1.perex.cz (Postfix) with ESMTP id 4F2E7F800FB for ; Thu, 11 Aug 2022 12:45:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4F2E7F800FB MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit From: GitHub issues - opened To: alsa-devel@alsa-project.org In-Reply-To: <1660214714498842955-webhooks-bot@alsa-project.org> References: <1660214714498842955-webhooks-bot@alsa-project.org> Subject: snd_pcm_hw_params_current() always returning zero for periods and buffer_time Message-Id: <20220811104517.C15BCF80246@alsa1.perex.cz> Date: Thu, 11 Aug 2022 12:45:17 +0200 (CEST) X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" alsa-project/alsa-lib issue #258 was opened from ossilator: as can be reproduced rather easily using pyalsaaudio's pcm.dumpinfo(), snd_pcm_hw_params_current() seems to always return zero for periods and buffer_time, at least for playback streams (i didn't test capture). the sequence is basically this: ``` snd_pcm_hw_params_any(...); ... unsigned periods = 4; snd_pcm_hw_params_set_periods_near(..., &periods, ...); // periods is still fine here snd_pcm_hw_params(...); snd_pcm_hw_params_current(...); snd_pcm_hw_params_get_periods(..., &periods, ...); // nope, zero periods ``` i tested this with two completely different setups on two different machines (one a raw driver, another one with pipewire), so it doesn't appear related to the driver. from the other returned parameters it can be inferred that the period count is actually fine. one thing i noticed is that snd_pcm_hw_params_current() uses snd_interval_copy() instead of snd_interval_set_value() for exactly these two parameters. but min & max are both zero. i wasn't able to trace it down so far; both the library and the kernel code look fine. Issue URL : https://github.com/alsa-project/alsa-lib/issues/258 Repository URL: https://github.com/alsa-project/alsa-lib