From mboxrd@z Thu Jan 1 00:00:00 1970 From: tom@dbservice.com Subject: Re: alsa pulse bugs Date: Mon, 05 May 2008 12:22:10 +0200 Message-ID: <20080505122210.sbwpuulog00cos4c@dbservice.com> References: <20080505103410.zv8dezd9z44cksoc@dbservice.com> <20080505111126.lhtr3bwyo0sg4wc4@dbservice.com> Reply-To: General PulseAudio Discussion Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: pulseaudio-discuss-bounces@mail.0pointer.de Errors-To: pulseaudio-discuss-bounces@mail.0pointer.de To: Colin Guthrie Cc: pulseaudio-discuss@mail.0pointer.de, alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org Quoting Colin Guthrie : > Actually just having a very quick glance at the Alsa API docs, it > doesn't mention that this value should be 0 if there are no samples to play: > > http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#ga0d9e14a4be65209eb549e48a9f07302 > > Closest it says is: "It's positive and less than buffer size in normal > situation". > > So perhaps this is an invalid assumption at the wine side? However this part: Delay is distance between current application frame position and sound frame position. suggests that it indeed can be zero. Or why would a soundcard have a gap between the read and write positions if it has played everything? If Wine uses a wrong assumption, then please clarify the function description. > Is there perhaps a more appropriate API call they can use to do whatever > test they are doing? What Wine needs to know, is whether a particular sample has already been played or not. It does 'bytes_written - delay_in_bytes' to find out how much of the written data the soundcard has already played. If there is a better test for it, please explain. tom