dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: bugzilla-daemon@freedesktop.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 69675] audio broken in 24Hz/24p since 3.11 (regression)
Date: Wed, 25 Sep 2013 21:00:45 +0000	[thread overview]
Message-ID: <bug-69675-502-n5IQ7wOD3u@http.bugs.freedesktop.org/> (raw)
In-Reply-To: <bug-69675-502@http.bugs.freedesktop.org/>


[-- Attachment #1.1: Type: text/plain, Size: 2829 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=69675

--- Comment #5 from Anssi Hannula <anssi@mageia.org> ---
To expand a bit on my earlier comment that Alex pasted:

HDMI sends ACR packets in the stream that will allow the sink to recover the
audio clock. Two values are sent:

N: Divisor used on the audio reference clock (128 * samplerate).
CTS: Amount of TMDS clock cycles per one N-divided audio reference clock cycle.

AFAICS normally the source hardware is expected to measure the CTS in real-time
by counting the cycles. If the audio/video clocks are perfectly in sync and N
is selected optimally (if possible), CTS will of course stay constant. In other
cases it is expected to alternate between several values.

The HDMI specification has some recommended N values (and corresponding
expected CTS values) for common TMDS clocks. The recommended values result in a
constant CTS if the clocks are synchronous (constant CTS is "recommended
whenever possible").
The recommendation table does include TMDS clock 74.25/1.001, which is the one
used for 1080p23.976. However, the provided N will result in constant CTS only
if the clock is exactly 74.25/1.001 without rounding (and the modeline is of
course rounded, unless something in the driver or hw does something to try to
restore the fractional rate - I have no idea if that is the case).

The radeon driver contains the recommended table and hardwires N/CTS values. If
the TMDS clock is not found in the table, recommended N is selected and the CTS
is simply directly calculated and set as constant.

The table in question contains N/CTS 11648/140625 for 48kHz and 74.175 MHz
(74.175 is down-rounded 74.25/1.001). However, if the TMDS freq is actually
exactly 74.175 Mhz and not 74.25/1.001 (74175.824) (i.e. nothing corrects
74.175 => 74.25/1.001), the N/CTS values are already wrong
(74175000*11648/(48000*128) = 140623.4375 != 140625.

The driver calculated N/CTS (for clocks not in the table) are correct only if
the TMDS clock is exactly the value used (relative to audio clock). I have a
feeling that might not be the case (evidenced by e.g. this bug), though I
didn't look at the radeon driver internals that closely.


To me it would seem like using hardware measurement for CTS value would be
better than to deal with all this. According to header comments radeon hw seems
to support that, but for some reason that is not used and driver-wired values
are used instead.
Alex' attached patch should switch the ACR to hw measured CTS. If that actually
works, hopefully it fixes the audio synchronization issues...

(In reply to comment #4)
> Something like this:

Not really, the selection doesn't work like that - clock has to match exactly
to the table value, it is not an upper bound.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 3681 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2013-09-25 21:00 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-22 13:24 [Bug 69675] New: audio broken in 24Hz/24p since 3.11 (regression) bugzilla-daemon
2013-09-25 19:55 ` [Bug 69675] " bugzilla-daemon
2013-09-25 20:00 ` bugzilla-daemon
2013-09-25 20:12 ` bugzilla-daemon
2013-09-25 20:20 ` bugzilla-daemon
2013-09-25 21:00 ` bugzilla-daemon [this message]
2013-09-25 21:32 ` bugzilla-daemon
2013-09-25 22:09 ` bugzilla-daemon
2013-09-25 22:39 ` bugzilla-daemon
2013-09-26  4:47 ` bugzilla-daemon
2013-09-26  4:48 ` bugzilla-daemon
2013-09-26  4:49 ` bugzilla-daemon
2013-09-26  6:54 ` bugzilla-daemon
2013-09-26 13:58 ` bugzilla-daemon
2013-09-27 16:29 ` bugzilla-daemon
2013-09-27 17:23 ` bugzilla-daemon
2013-09-27 22:28 ` bugzilla-daemon
2013-09-27 22:29 ` bugzilla-daemon
2013-09-27 22:30 ` bugzilla-daemon
2013-09-27 23:17 ` bugzilla-daemon
2013-09-30 15:43 ` bugzilla-daemon
2013-09-30 15:45 ` bugzilla-daemon
2013-10-13 15:42 ` bugzilla-daemon
2013-10-13 15:49 ` bugzilla-daemon
2013-10-26 20:12 ` bugzilla-daemon
2013-10-26 21:36 ` bugzilla-daemon
2013-10-28 16:28 ` bugzilla-daemon
2013-10-31 19:48 ` bugzilla-daemon
2013-10-31 20:27 ` bugzilla-daemon
2013-10-31 20:38 ` bugzilla-daemon
2013-10-31 21:02 ` bugzilla-daemon
2013-11-01  8:31 ` bugzilla-daemon
2013-11-01  8:34 ` bugzilla-daemon
2013-11-01 13:27 ` bugzilla-daemon
2013-11-01 13:39 ` bugzilla-daemon
2013-11-01 14:00 ` bugzilla-daemon
2013-11-01 14:06 ` bugzilla-daemon
2013-11-01 14:09 ` bugzilla-daemon
2013-11-01 14:13 ` bugzilla-daemon
2013-11-01 14:17 ` bugzilla-daemon
2013-11-01 14:18 ` bugzilla-daemon
2013-11-01 15:03 ` bugzilla-daemon
2013-11-02 11:17 ` bugzilla-daemon
2013-11-02 11:44 ` bugzilla-daemon
2013-11-02 11:50 ` bugzilla-daemon
2013-11-02 14:02 ` bugzilla-daemon
2013-11-06 17:26 ` bugzilla-daemon
2013-11-06 17:35 ` bugzilla-daemon
2013-11-06 19:12 ` bugzilla-daemon
2013-11-06 19:13 ` bugzilla-daemon
2013-11-06 19:13 ` bugzilla-daemon
2013-11-06 19:50 ` bugzilla-daemon
2013-11-06 20:05 ` bugzilla-daemon
2013-11-17 14:21 ` bugzilla-daemon
2013-11-18  6:52 ` bugzilla-daemon
2013-11-18 11:33 ` bugzilla-daemon
2019-10-14 13:20 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-69675-502-n5IQ7wOD3u@http.bugs.freedesktop.org/ \
    --to=bugzilla-daemon@freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).