From owner-freebsd-current@FreeBSD.ORG Fri Jul 12 21:38:44 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9CEE478C; Fri, 12 Jul 2013 21:38:44 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com [IPv6:2a00:1450:4010:c04::231]) by mx1.freebsd.org (Postfix) with ESMTP id EBDDD10AF; Fri, 12 Jul 2013 21:38:43 +0000 (UTC) Received: by mail-lb0-f177.google.com with SMTP id 10so7879960lbf.8 for ; Fri, 12 Jul 2013 14:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=3WknHIWlEzQB4+/EE3g4+BQfoTH9BUTnUA+qSBpdZ1Q=; b=M1y0M8Ua4b/aG8b4/FXjeubGN8yUxeywsQH4212f1YdyxuOOQZVnJhM7w/bHlgKaGG P+qe8JK3nsDcjjD9AxzkZpaYWteQng+JIqHghNR/7rAvBE2vRMOzvz+JbccYP1NAEPtu SUjCTk6GxWcTB5h97N1D3okUjSiFMRSBXbs0T4c8AAAqlKwKJUGdU01n74dQFlOEZ6Bm UwCkBkqWoAhIo/8okh90pqRgTMtVZjcDLV34oq64hBvqBZiPkRsXu04zD25pegqbMVuS WeACh/Q0mM9O0okuTdqwaK+ck9rJ9/6jK/9wew0SSvMVVyTI17xRhN48A3P4/YQRNMEl HR9A== X-Received: by 10.112.13.199 with SMTP id j7mr20506551lbc.25.1373665122774; Fri, 12 Jul 2013 14:38:42 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPSA id v18sm14576964lbd.5.2013.07.12.14.38.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Jul 2013 14:38:41 -0700 (PDT) Sender: Alexander Motin Message-ID: <51E0775F.3070805@FreeBSD.org> Date: Sat, 13 Jul 2013 00:38:39 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130616 Thunderbird/17.0.6 MIME-Version: 1.0 To: uqs@FreeBSD.org Subject: Re: Sound lag over HDMI References: <20130712205446.GB2198@acme.spoerlein.net> In-Reply-To: <20130712205446.GB2198@acme.spoerlein.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jul 2013 21:38:44 -0000 On 12.07.2013 23:54, Ulrich Spörlein wrote: > I'm trying to setup XBMC on a -CURRENT box with an IvyBridge CPU and > GPU. While testing playback via mplayer on a LG TV over HDMI, I noticed > that sound is lagging video by about 100-200ms or so. When I switch to > using the jack outputs powered by some Realtek chip, audio is perfectly > fine. > > Is HDMI lag a known problem? Can this be fixed? > > root@coyote:~# dmesg | egrep vgapci\|pcm > vgapci0: port 0x3000-0x303f mem 0xe0000000-0xe03fffff,0xc0000000-0xdfffffff irq 16 at device 2.0 on pci0 > agp0: on vgapci0 > pcm0: at nid 20 and 24 on hdaa0 > pcm1: at nid 30 and 31 on hdaa0 > pcm2: at nid 6 on hdaa1 > pcm3: at nid 7 on hdaa1 > drmn0: on vgapci0 I don't know what to say. I am now using HDMI audio from NVIDIA card to quite old external 5.1 receiver with XBMC every day, and I haven't noticed lags. Before that I've also successfully used SPDIF connection for the long time. Though I've never specially tested it somehow other then watching movies. :) If you have some good testing methodology -- please, welcome to share. By the HDA driver HDMI is handled exactly the same way as analog output from the point of data buffering, so I would not expect there major differences. You may try to experiment with hw.snd.latency sysctl to tune buffering in kernel to see whether it affect the result. Also you may compare delays when doing AC3/DTS pass-through with case of software decoding and discrete (multichannel) PCM playback. The only potentially related effect I have noticed is that my receiver eats first second or about that of playback stream. It makes short sounds like GUI event notifications inaudible sometimes. I guess that could be made to restore audio sync after some unavoidable startup delay, but that is only my guess. -- Alexander Motin