Re: [alsa-devel] Creative X-Fi Titanium HD ctxfi bugs 5378 5218 4868
At Sat, 11 Jun 2011 18:25:36 +0800, Harry Butterworth wrote:
Hi,
I have redone the patch against today's git repositories.
Creative have not yet got back to me about the PLL initialization. Perhaps we can fix that later.
I have only put the PCI ID in the pci_ids_compat.h.in file. Is it
going to be necessary to add the PCI device ID somewhere in the kernel tree to avoid breaking the kernel build?
Yes, include/linux/pci_ids.h is the place to change. But I can fix it by myself, too.
A few comment about the patch:
- Instead of adding have_dedicated_mic and have_output_switch
callbacks in every place, I'd put some bit flags indicating the capabilities, and set at the initialization appropriately.
I had a go at this in the patch 0002-ALSA...
- A few easy coding-style issues; run scripts/checkpatch.pl and fix
the errors appropriately.
checkpatch now reports no errors.
I've only tested these changes with my Titanium HD card. I don't have any of the other X-Fi cards so I couldn't do any regression testing.
If there's anything else I need to do, please let me know.
I'm going to check patches in a more detail tomorrow.
Thanks!
Takashi
At Sun, 12 Jun 2011 18:48:27 +0200, Takashi Iwai wrote:
At Sat, 11 Jun 2011 18:25:36 +0800, Harry Butterworth wrote:
Hi,
I have redone the patch against today's git repositories.
Creative have not yet got back to me about the PLL initialization. Perhaps we can fix that later.
I have only put the PCI ID in the pci_ids_compat.h.in file. Is it
going to be necessary to add the PCI device ID somewhere in the kernel tree to avoid breaking the kernel build?
Yes, include/linux/pci_ids.h is the place to change. But I can fix it by myself, too.
A few comment about the patch:
- Instead of adding have_dedicated_mic and have_output_switch
callbacks in every place, I'd put some bit flags indicating the capabilities, and set at the initialization appropriately.
I had a go at this in the patch 0002-ALSA...
- A few easy coding-style issues; run scripts/checkpatch.pl and fix
the errors appropriately.
checkpatch now reports no errors.
I've only tested these changes with my Titanium HD card. I don't have any of the other X-Fi cards so I couldn't do any regression testing.
If there's anything else I need to do, please let me know.
I'm going to check patches in a more detail tomorrow.
Now both patches were applied to sound git tree. Just minor fixes were applied in addition (coding-style issues in the second patch and added the definition in include/linux/pci_ids.h in the first patch).
thanks,
Takashi
Great. Creative got back to me today with a proposed solution for the PLL initialization. I'll follow up with another patch in the next week probably.
Harry
On 14 June 2011 13:38, Takashi Iwai tiwai@suse.de wrote:
At Sun, 12 Jun 2011 18:48:27 +0200, Takashi Iwai wrote:
At Sat, 11 Jun 2011 18:25:36 +0800, Harry Butterworth wrote:
Hi,
I have redone the patch against today's git repositories. Creative have not yet got back to me about the PLL initialization. Perhaps we can fix that later.
I have only put the PCI ID in the pci_ids_compat.h.in file. Is it going to be necessary to add the PCI device ID somewhere in the kernel tree to avoid breaking the kernel build?
Yes, include/linux/pci_ids.h is the place to change. But I can fix it by myself, too.
A few comment about the patch:
- Instead of adding have_dedicated_mic and have_output_switch
callbacks in every place, I'd put some bit flags indicating the capabilities, and set at the initialization appropriately.
I had a go at this in the patch 0002-ALSA...
- A few easy coding-style issues; run scripts/checkpatch.pl and fix
the errors appropriately.
checkpatch now reports no errors.
I've only tested these changes with my Titanium HD card. I don't have any of the other X-Fi cards so I couldn't do any regression testing.
If there's anything else I need to do, please let me know.
I'm going to check patches in a more detail tomorrow.
Now both patches were applied to sound git tree. Just minor fixes were applied in addition (coding-style issues in the second patch and added the definition in include/linux/pci_ids.h in the first patch).
thanks,
Takashi
On 14 June 2011 16:23, Harry Butterworth heb1001@gmail.com wrote:
Great. Creative got back to me today with a proposed solution for the PLL initialization. I'll follow up with another patch in the next week probably.
Here's the change from Creative for the PLL initialization. It works for me and hasn't failed yet but it didn't fail that often before and I don't have the chip spec so I can't vouch for the new magic numbers.
Harry
At Thu, 16 Jun 2011 08:32:15 +0800, Harry Butterworth wrote:
On 14 June 2011 16:23, Harry Butterworth heb1001@gmail.com wrote:
Great. Creative got back to me today with a proposed solution for the PLL initialization. I'll follow up with another patch in the next week probably.
Here's the change from Creative for the PLL initialization. It works for me and hasn't failed yet but it didn't fail that often before and I don't have the chip spec so I can't vouch for the new magic numbers.
Thanks, I applied it now. Let's see whether this breaks others.
Takashi
Harry [2 0003-ALSA-ctxfi-Change-PLL-initialization-code.patch <text/x-patch; US-ASCII (base64)>] From 27b2ddf7343d569764da750d39dd403d1648cf06 Mon Sep 17 00:00:00 2001 From: Harry Butterworth heb1001@gmail.com Date: Tue, 14 Jun 2011 23:09:12 +0800 Subject: [PATCH - ALSA:ctxfi 3/3] ALSA: ctxfi: Change PLL initialization code
This is a reworked patch from Creative to change the PLL code to address unreliable 44100Hz initialization.
Signed-off-by: Harry Butterworth heb1001@gmail.com
diff --git a/pci/ctxfi/cthw20k2.c b/pci/ctxfi/cthw20k2.c index ea559a9..4101a8e 100644 --- a/pci/ctxfi/cthw20k2.c +++ b/pci/ctxfi/cthw20k2.c @@ -1316,21 +1316,18 @@ static int hw_pll_init(struct hw *hw, unsigned int rsr)
pllenb = 0xB; hw_write_20kx(hw, PLL_ENB, pllenb);
- pllctl = 0x20D00000;
- set_field(&pllctl, PLLCTL_FD, 16 - 4);
- pllctl = 0x20C00000;
- set_field(&pllctl, PLLCTL_B, 0);
- set_field(&pllctl, PLLCTL_FD, 48000 == rsr ? 16 - 4 : 147 - 4);
- set_field(&pllctl, PLLCTL_RD, 48000 == rsr ? 1 - 1 : 10 - 1); hw_write_20kx(hw, PLL_CTL, pllctl); mdelay(40);
- pllctl = hw_read_20kx(hw, PLL_CTL);
- set_field(&pllctl, PLLCTL_B, 0);
- if (48000 == rsr) {
set_field(&pllctl, PLLCTL_FD, 16 - 2);
set_field(&pllctl, PLLCTL_RD, 1 - 1); /* 3000*16/1 = 48000 */
- } else { /* 44100 */
set_field(&pllctl, PLLCTL_FD, 147 - 2);
set_field(&pllctl, PLLCTL_RD, 10 - 1); /* 3000*147/10 = 44100 */
- }
- set_field(&pllctl, PLLCTL_FD, 48000 == rsr ? 16 - 2 : 147 - 2); hw_write_20kx(hw, PLL_CTL, pllctl); mdelay(40);
- for (i = 0; i < 1000; i++) { pllstat = hw_read_20kx(hw, PLL_STAT); if (get_field(pllstat, PLLSTAT_PD))
-- 1.7.0.4
participants (2)
-
Harry Butterworth
-
Takashi Iwai