From owner-freebsd-multimedia@FreeBSD.ORG Tue Mar 12 22:58:35 2013 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A40F8790 for ; Tue, 12 Mar 2013 22:58:35 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 28AB7EB5 for ; Tue, 12 Mar 2013 22:58:35 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id 12so3831531wgh.1 for ; Tue, 12 Mar 2013 15:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=OeroWeB4yPDDYG56aWAM1TWa07g3pYKfbVmuaZIyP0A=; b=dZtP59z0tkLr8MALvKxV2xwQ5ABW3MfmXXGo+kgpyVsFUr7Awjbw/1oZaUluB4o22o 1hWQdP8w6vCifEi3UkT2OaDMibwb0GTPwOeRufA7NXtnJ5hf3vaMScEUsPGWTQLiEXDh t/jHNG2ni/mdgarzw3ykhB85vo6RcXo2bGn/YVQIBeX4s/c4KgzWqIUzZ95lnWEuwyrL I2DDjFoY7sTaCFAlJwoUHCJ7K6ItESsTIITx5R9w/JQn7tGv0sg4Ttd29BG7hNmuxwHc ywY2vIEmmFmCKkTo3IVrC87BneBsJ9yyLJg+rV40IVNizaMIIFZl//iGF0WLVSfGv2J9 dN6Q== MIME-Version: 1.0 X-Received: by 10.194.87.229 with SMTP id bb5mr30027503wjb.32.1363129114340; Tue, 12 Mar 2013 15:58:34 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.111.201 with HTTP; Tue, 12 Mar 2013 15:58:34 -0700 (PDT) In-Reply-To: References: Date: Tue, 12 Mar 2013 15:58:34 -0700 X-Google-Sender-Auth: O4kS4VUH_Cb5cSVVv6Cx1c6yAko Message-ID: Subject: Re: FreeBSD OSS + Alsa - what's the right behaviour for non-blocking IO? From: Adrian Chadd To: freebsd-multimedia@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Mar 2013 22:58:35 -0000 On 12 March 2013 15:31, Adrian Chadd wrote: > So I'll go and tinker with the ALSA setup side in order to see what > the story is (it's almost certain I'm setting things up incorrectly > for non-blocking IO here and I need to to wave the right magic wand to > get the low watermark reset right. > > However, there's definitely a behavioural difference here - FreeBSD > shouldn't be returning POLLOUT on the dsp device, only to find that > there's no space in the playback FIFO. As a follow-up, I hacked the alsa oss plugin to see what was going on, and here's what is happening inside oss_pointer(): oss_pointer: bi.bytes=3764, bi.fragments=0, bi.fragstotal=32, bi.fragsize=4096 (and 100 more of the above..) oss_pointer: bi.bytes=5644, bi.fragments=1, bi.fragstotal=32, bi.fragsize=4096 oss_pointer: bi.bytes=5644, bi.fragments=1, bi.fragstotal=32, bi.fragsize=4096 each one of those is from a trip through poll() -> alsa get navail. So I think the kernel sound code is returning that the FD is ready even though there's no space in the write FIFO. Is this enough for a PR? Thanks, Adrian