Re: Sound lag over HDMI

2013-07-17 Thread Christian Weisgerber
Alexander Motin m...@freebsd.org wrote:

 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.
 
 The only potentially related effect I have noticed is that my receiver 
 eats first second or about that of playback stream.

That's from the receiver examining the incoming data to see if it
is AC-3, DTS, or plain PCM.

-- 
Christian naddy Weisgerber  na...@mips.inka.de

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Sound lag over HDMI

2013-07-15 Thread Ulrich Spörlein
2013/7/12 Alexander Motin m...@freebsd.org:
 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: VGA-compatible display port 0x3000-0x303f mem
 0xe000-0xe03f,0xc000-0xdfff irq 16 at device 2.0 on pci0
 agp0: IvyBridge mobile GT2 IG on vgapci0
 pcm0: Realtek ALC888 (Rear Analog) at nid 20 and 24 on hdaa0
 pcm1: Realtek ALC888 (Rear Digital) at nid 30 and 31 on hdaa0
 pcm2: Intel Panther Point (HDMI/DP 8ch) at nid 6 on hdaa1
 pcm3: Intel Panther Point (HDMI/DP 8ch) at nid 7 on hdaa1
 drmn0: Intel IvyBridge (M) 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.

Hmm, weird. I've rebooted the machine (it was up more than 30d before I ever
started up Xorg or any sound-using application), and maybe that fixed some
contigmalloc issues or something, because I can no longer reproduce
the problem.
I've had problems like this on an old laptop, where if I didn't start
X11 within 24h
of rebooting, it wouldn't start up. This system is using ZFS of
course, so unless
you take memory early on, ZFS will have eaten it :)

Anyway, thanks for your suggestions and I can confirm everything's fine. After
fixing the /dev/dri/card0 permission problem, even XBMC works like a charm
on this system.

Cheers,
Uli
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

Sound lag over HDMI

2013-07-12 Thread Ulrich Spörlein
Hey,

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: VGA-compatible display port 0x3000-0x303f mem 
0xe000-0xe03f,0xc000-0xdfff irq 16 at device 2.0 on pci0
agp0: IvyBridge mobile GT2 IG on vgapci0
pcm0: Realtek ALC888 (Rear Analog) at nid 20 and 24 on hdaa0
pcm1: Realtek ALC888 (Rear Digital) at nid 30 and 31 on hdaa0
pcm2: Intel Panther Point (HDMI/DP 8ch) at nid 6 on hdaa1
pcm3: Intel Panther Point (HDMI/DP 8ch) at nid 7 on hdaa1
drmn0: Intel IvyBridge (M) on vgapci0

Cheers,
Uli
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Sound lag over HDMI

2013-07-12 Thread Alexander Motin

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: VGA-compatible display port 0x3000-0x303f mem 
0xe000-0xe03f,0xc000-0xdfff irq 16 at device 2.0 on pci0
agp0: IvyBridge mobile GT2 IG on vgapci0
pcm0: Realtek ALC888 (Rear Analog) at nid 20 and 24 on hdaa0
pcm1: Realtek ALC888 (Rear Digital) at nid 30 and 31 on hdaa0
pcm2: Intel Panther Point (HDMI/DP 8ch) at nid 6 on hdaa1
pcm3: Intel Panther Point (HDMI/DP 8ch) at nid 7 on hdaa1
drmn0: Intel IvyBridge (M) 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
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org