From: bugzilla-daemon@freedesktop.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 69675] audio broken in 24Hz/24p since 3.11 (regression)
Date: Fri, 01 Nov 2013 14:00:39 +0000 [thread overview]
Message-ID: <bug-69675-502-FS3551iaqO@http.bugs.freedesktop.org/> (raw)
In-Reply-To: <bug-69675-502@http.bugs.freedesktop.org/>
[-- Attachment #1.1: Type: text/plain, Size: 3463 bytes --]
https://bugs.freedesktop.org/show_bug.cgi?id=69675
--- Comment #35 from Pierre Ossman <pierre-bugzilla@ossman.eu> ---
(In reply to comment #28)
> Created attachment 88450 [details] [review]
> use fractional fb div on DCE4+
>
> Does this patch help? This should allow the pll value to more closely match
> the actual requested clock.
Nope. Still glitches around 9 minutes.
The calculations in the table are off though, so I'm not surprised. With
corrected values it works fine. I also changed the algorithm to be able to
calculate these values properly:
static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = {
/* 32kHz 44.1kHz 48kHz */
/* Clock N CTS N CTS N CTS */
{ 25175, 4096, 25175, 28224, 125875, 6144, 25175 }, /* 25,20/1.001
MHz */
{ 25200, 4096, 25200, 6272, 28000, 6144, 25200 }, /* 25.20
MHz */
{ 27000, 4096, 27000, 6272, 30000, 6144, 27000 }, /* 27.00
MHz */
{ 27027, 4096, 27027, 6272, 30030, 6144, 27027 }, /* 27.00*1.001
MHz */
{ 54000, 4096, 54000, 6272, 60000, 6144, 54000 }, /* 54.00
MHz */
{ 54054, 4096, 54054, 6272, 60060, 6144, 54054 }, /* 54.00*1.001
MHz */
{ 74176, 4096, 74176, 5733, 75335, 6144, 74176 }, /* 74.25/1.001
MHz */
{ 74250, 4096, 74250, 6272, 82500, 6144, 74250 }, /* 74.25
MHz */
{ 148352, 4096, 148352, 5733, 150670, 6144, 148352 }, /* 148.50/1.001
MHz */
{ 148500, 4096, 148500, 6272, 165000, 6144, 148500 }, /* 148.50
MHz */
};
/*
* calculate CTS and N values if they are not found in the table
*/
static void r600_hdmi_calc_cts(uint32_t clock, int *CTS, int *N, int freq)
{
int n, cts;
unsigned long div, mul;
/* Safe, but overly large values */
n = 128 * freq;
cts = clock * 1000;
/* Smallest valid fraction */
div = gcd(n, cts);
n /= div;
cts /= div;
/*
* The optimal N is 128*freq/1000. Calculate the closest larger
* value that doesn't truncate any bits.
*/
mul = ((128*freq/1000) + (n-1))/n;
n *= mul;
cts *= mul;
*N = n;
*CTS = cts;
DRM_DEBUG("Calculated ACR timing N=%d CTS=%d for frequency %d\n",
*N, *CTS, freq);
}
struct radeon_hdmi_acr r600_hdmi_acr(uint32_t clock)
{
struct radeon_hdmi_acr res;
u8 i;
/* Precalculated values for common clocks */
for (i = 0; i < ARRAY_SIZE(r600_hdmi_predefined_acr); i++) {
if (r600_hdmi_predefined_acr[i].clock == clock) {
return r600_hdmi_predefined_acr[i];
}
}
/* And odd clocks get manually calculated */
r600_hdmi_calc_cts(clock, &res.cts_32khz, &res.n_32khz, 32000);
r600_hdmi_calc_cts(clock, &res.cts_44_1khz, &res.n_44_1khz, 44100);
r600_hdmi_calc_cts(clock, &res.cts_48khz, &res.n_48khz, 48000);
return res;
}
Two notes here:
1. The 25175 clock at 44.1 kHz is out of spec. There are no correct values to
make it in spec. So either change the clock, rely on hw calculated values, or
hope that sinks tolerate the large N.
2. None the N values for 44100 listed in the HDMI spec are optimal. Not sure
why, so I haven't changed them except where needed.
--
You are receiving this mail because:
You are the assignee for the bug.
[-- Attachment #1.2: Type: text/html, Size: 4678 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
next prev parent reply other threads:[~2013-11-01 14: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
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 [this message]
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-FS3551iaqO@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).