* ice1724/Audiotrak Prodigy 7.1 HiFi
@ 2006-09-15 19:11 Julian Scheel
2006-09-19 9:27 ` Takashi Iwai
0 siblings, 1 reply; 13+ messages in thread
From: Julian Scheel @ 2006-09-15 19:11 UTC (permalink / raw)
To: alsa-devel
I just got a Audiotrak Prodigy 7.1 HiFi card, which is baed upon a Envy24HT
chipset in combination with one WM8776 codec for front out and a WM8766 for
channel 3-8.
I made the front out working, taking the code from pontis.c - Now I'd like to
add support for the other channels, therefore I need to figure out the
I2C-base-address for the WM8766 registers.
Can you provide me with some help on how to figure that out? I'm a newbie to
alsa/soundcard driver development.
Reading the envy24ht-specs didn't help me, yet.
One more question: Should I merge my code into pontis.c, which would blow it a
bit up, but would avoid duplicate code, or should I open a new
prodigy_hifi.c/h?
Cheers,
Julian
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ice1724/Audiotrak Prodigy 7.1 HiFi
2006-09-15 19:11 Julian Scheel
@ 2006-09-19 9:27 ` Takashi Iwai
2006-09-19 9:40 ` Julian Scheel
0 siblings, 1 reply; 13+ messages in thread
From: Takashi Iwai @ 2006-09-19 9:27 UTC (permalink / raw)
To: Julian Scheel; +Cc: alsa-devel
At Fri, 15 Sep 2006 21:11:03 +0200,
Julian Scheel wrote:
>
> I just got a Audiotrak Prodigy 7.1 HiFi card, which is baed upon a Envy24HT
> chipset in combination with one WM8776 codec for front out and a WM8766 for
> channel 3-8.
> I made the front out working, taking the code from pontis.c - Now I'd like to
> add support for the other channels, therefore I need to figure out the
> I2C-base-address for the WM8766 registers.
> Can you provide me with some help on how to figure that out? I'm a newbie to
> alsa/soundcard driver development.
First you should make clear whether the codec chip is connected via
the vt1724's standard connection or 3-wired SPI connection via GPIO.
The most boards use the latter method while pontis board uses the
former. In the latter case, the address is usually 2 bit, so you can
do a wild guess more easily.
> Reading the envy24ht-specs didn't help me, yet.
>
> One more question: Should I merge my code into pontis.c, which would blow it a
> bit up, but would avoid duplicate code, or should I open a new
> prodigy_hifi.c/h?
Depends. Send us a patch, and let's decide this later.
Takashi
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ice1724/Audiotrak Prodigy 7.1 HiFi
2006-09-19 9:27 ` Takashi Iwai
@ 2006-09-19 9:40 ` Julian Scheel
2006-09-19 11:56 ` Julian Scheel
0 siblings, 1 reply; 13+ messages in thread
From: Julian Scheel @ 2006-09-19 9:40 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
Am Dienstag, 19. September 2006 11:27 schrieb Takashi Iwai:
> At Fri, 15 Sep 2006 21:11:03 +0200,
> First you should make clear whether the codec chip is connected via
> the vt1724's standard connection or 3-wired SPI connection via GPIO.
> The most boards use the latter method while pontis board uses the
> former. In the latter case, the address is usually 2 bit, so you can
> do a wild guess more easily.
I figured out that the WM8766 is connected through a 3-wired SPI-connection. I
also figured out that the GPIOs 16,17,18 are used.
pontis.c already includes a SPI-implementation, but according to the WM8766
specs (look at wolfsonmico.com) this device does not await an address, but
only 2 bytes of data: register address/values.
Actually trying to initializing the chip leads to silence, in comparison to
the noise coming out before, when the chip was in default mode.
I assume that there must be some timing problem with the data-transmission or
similiar. I will do some more testing today.
Maybe I'll send in a patch if I can't find a problem, anyway.
-Julian
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ice1724/Audiotrak Prodigy 7.1 HiFi
2006-09-19 9:40 ` Julian Scheel
@ 2006-09-19 11:56 ` Julian Scheel
2006-09-20 9:52 ` Julian Scheel
0 siblings, 1 reply; 13+ messages in thread
From: Julian Scheel @ 2006-09-19 11:56 UTC (permalink / raw)
To: alsa-devel; +Cc: Takashi Iwai
[-- Attachment #1: Type: text/plain, Size: 1460 bytes --]
Am Dienstag, 19. September 2006 11:40 schrieb Julian Scheel:
> Am Dienstag, 19. September 2006 11:27 schrieb Takashi Iwai:
> > At Fri, 15 Sep 2006 21:11:03 +0200,
> > First you should make clear whether the codec chip is connected via
> > the vt1724's standard connection or 3-wired SPI connection via GPIO.
> > The most boards use the latter method while pontis board uses the
> > former. In the latter case, the address is usually 2 bit, so you can
> > do a wild guess more easily.
>
> I figured out that the WM8766 is connected through a 3-wired
> SPI-connection. I also figured out that the GPIOs 16,17,18 are used.
> pontis.c already includes a SPI-implementation, but according to the WM8766
> specs (look at wolfsonmico.com) this device does not await an address, but
> only 2 bytes of data: register address/values.
> Actually trying to initializing the chip leads to silence, in comparison to
> the noise coming out before, when the chip was in default mode.
> I assume that there must be some timing problem with the data-transmission
> or similiar. I will do some more testing today.
> Maybe I'll send in a patch if I can't find a problem, anyway.
Ok, attached is now what I've done so far. (patch against 1.0.13rc2) This
causes the WM8766 to be silent. Only way to get the noise back is restarting
the system without the init-code.
Couldn't find a reason for that behaviour. Maybe you have an idea what could
be wrong with that code?
-Julian
[-- Attachment #2: prodigy71_hifi.patch --]
[-- Type: text/x-diff, Size: 5622 bytes --]
diff -ru alsa-driver-1.0.13rc2.orig/alsa-kernel/pci/ice1712/pontis.c alsa-driver-1.0.13rc2/alsa-kernel/pci/ice1712/pontis.c
--- alsa-driver-1.0.13rc2.orig/alsa-kernel/pci/ice1712/pontis.c 2006-09-12 15:40:57.000000000 +0200
+++ alsa-driver-1.0.13rc2/alsa-kernel/pci/ice1712/pontis.c 2006-09-19 13:52:55.000000000 +0200
@@ -67,6 +67,22 @@
#define WM_OUT_MUX 0x16
#define WM_RESET 0x17
+/* WM8766 registers */
+#define WM8766_DAC_CTRL 0x02 /* DAC Control */
+#define WM8766_INT_CTRL 0x03 /* Interface Control */
+#define WM8766_DAC_CTRL2 0x09
+#define WM8766_DAC_CTRL3 0x0a
+#define WM8766_RESET 0x1f
+#define WM8766_LDA1 0x00
+#define WM8766_LDA2 0x04
+#define WM8766_LDA3 0x06
+#define WM8766_RDA1 0x01
+#define WM8766_RDA2 0x05
+#define WM8766_RDA3 0x07
+#define WM8766_MUTE1 0x0C
+#define WM8766_MUTE2 0x0F
+
+
/*
* GPIO
*/
@@ -75,6 +91,10 @@
#define PONTIS_CS_RDATA (1<<6) /* CS8416 -> VT1720 */
#define PONTIS_CS_WDATA (1<<7) /* VT1720 -> CS8416 */
+#define WM8766_SPI_CLK (1<<17) /* CLK, Pin97 on ICE1724 */
+#define WM8766_SPI_MD (1<<16) /* DATA VT1724 -> WM8766, Pin96 */
+#define WM8766_SPI_ML (1<<18) /* Latch, Pin98 */
+
/*
* get the current register value of WM codec
@@ -353,7 +373,12 @@
tmp |= bit;
else
tmp &= ~bit;
- snd_ice1712_gpio_write(ice, tmp);
+/*printk("BIT: %08x\n", bit);
+printk("GPIO W: %08x\n", tmp);*/
+ snd_ice1712_gpio_write(ice, tmp);
+/* udelay(1);
+tmp = snd_ice1712_gpio_read(ice);
+printk("GPIO R: %08x\n", tmp);*/
}
static void spi_send_byte(struct snd_ice1712 *ice, unsigned char data)
@@ -428,6 +453,39 @@
return val;
}
+/*
+ * SPI implementation for WM8766 codec - only writing supported, no readback
+ */
+
+static void wm8766_spi_send_byte(struct snd_ice1712 *ice, unsigned char data)
+{
+ int i;
+ for (i = 0; i < 8; i++) {
+ set_gpio_bit(ice, WM8766_SPI_CLK, 0);
+ udelay(1);
+ set_gpio_bit(ice, WM8766_SPI_MD, data & 0x80);
+ udelay(1);
+ set_gpio_bit(ice, WM8766_SPI_CLK, 1);
+ udelay(1);
+ data <<= 1;
+ }
+}
+
+static void wm8766_spi_write(struct snd_ice1712 *ice, unsigned int reg, unsigned int data)
+{
+ snd_ice1712_gpio_set_dir(ice, WM8766_SPI_MD|WM8766_SPI_CLK|WM8766_SPI_ML);
+ snd_ice1712_gpio_set_mask(ice, ~(WM8766_SPI_MD|WM8766_SPI_CLK|WM8766_SPI_ML));
+ set_gpio_bit(ice, WM8766_SPI_ML, 0); /* latch must be low when writing */
+ wm8766_spi_send_byte(ice, reg); /* REGISTER ADDRESS */
+ wm8766_spi_send_byte(ice, data); /* DATA */
+ /* release latch */
+ set_gpio_bit(ice, WM8766_SPI_ML, 1);
+ udelay(1);
+ /* restore */
+ snd_ice1712_gpio_set_mask(ice, ice->gpio.write_mask);
+ snd_ice1712_gpio_set_dir(ice, ice->gpio.direction);
+}
+
/*
* SPDIF input source
@@ -776,6 +834,21 @@
WM_DAC_MUTE, 0x0000, /* DAC unmute */
WM_ADC_MUX, 0x0003, /* ADC unmute, both CD/Line On */
};
+ static unsigned short wm8766_inits[] = {
+/* WM8766_RESET, 0x01,*/
+ WM8766_DAC_CTRL, 0x90,
+ WM8766_INT_CTRL, 0x22, /* I2S Normal Mode, 24 bit */
+ WM8766_DAC_CTRL2, 0x00,
+ WM8766_DAC_CTRL3, 0x10,
+ WM8766_LDA1, 0xff,
+ WM8766_LDA2, 0xff,
+ WM8766_LDA3, 0xff,
+ WM8766_RDA1, 0xff,
+ WM8766_RDA2, 0xff,
+ WM8766_RDA3, 0xff,
+ WM8766_MUTE1, 0x20,
+ WM8766_MUTE2, 0x10,
+ };
static unsigned char cs_inits[] = {
0x04, 0x80, /* RUN, RXP0 */
0x05, 0x05, /* slave, 24bit */
@@ -788,12 +861,19 @@
ice->vt1720 = 1;
ice->num_total_dacs = 2;
ice->num_total_adcs = 2;
+ ice->akm_codecs = 1;
+
+ switch (ice->eeprom.subvendor) {
+ case VT1720_SUBDEVICE_PRODIGY71_HIFI:
+ ice->vt1720 = 0;
+ ice->num_total_dacs = 8;
+ ice->akm_codecs = 2;
+ }
/* to remeber the register values */
- ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
+ ice->akm = kcalloc(ice->akm_codecs, sizeof(struct snd_akm4xxx), GFP_KERNEL);
if (! ice->akm)
return -ENOMEM;
- ice->akm_codecs = 1;
/* HACK - use this as the SPDIF source.
* don't call snd_ice1712_gpio_get/put(), otherwise it's overwritten
@@ -807,6 +887,13 @@
for (i = 0; i < ARRAY_SIZE(wm_inits2); i += 2)
wm_put(ice, wm_inits2[i], wm_inits2[i+1]);
+ /* initialize WM8766 codec */
+ for (i = 0; i < ARRAY_SIZE(wm8766_inits); i += 2)
+{
+printk("SET WM8766 REGISTER\n");
+ wm8766_spi_write(ice, wm8766_inits[i], wm8766_inits[i+1]);
+}
+
/* initialize CS8416 codec */
/* assert PRST#; MT05 bit 7 */
outb(inb(ICEMT1724(ice, AC97_CMD)) | 0x80, ICEMT1724(ice, AC97_CMD));
@@ -853,5 +940,14 @@
.eeprom_size = sizeof(pontis_eeprom),
.eeprom_data = pontis_eeprom,
},
+ {
+ .subvendor = VT1720_SUBDEVICE_PRODIGY71_HIFI,
+ .name = "Audiotrak Prodigy 7.1 HiFi",
+ .model = "prodigy71hifi",
+ .chip_init = pontis_init,
+ .build_controls = pontis_add_controls,
+ .eeprom_size = sizeof(pontis_eeprom),
+ .eeprom_data = pontis_eeprom,
+ },
{ } /* terminator */
};
Only in alsa-driver-1.0.13rc2/alsa-kernel/pci/ice1712: pontis.c.orig
diff -ru alsa-driver-1.0.13rc2.orig/alsa-kernel/pci/ice1712/pontis.h alsa-driver-1.0.13rc2/alsa-kernel/pci/ice1712/pontis.h
--- alsa-driver-1.0.13rc2.orig/alsa-kernel/pci/ice1712/pontis.h 2006-09-12 15:40:57.000000000 +0200
+++ alsa-driver-1.0.13rc2/alsa-kernel/pci/ice1712/pontis.h 2006-09-19 13:52:55.000000000 +0200
@@ -27,6 +27,7 @@
#define PONTIS_DEVICE_DESC "{Pontis,MS300},"
#define VT1720_SUBDEVICE_PONTIS_MS300 0x00020002 /* a dummy id for MS300 */
+#define VT1720_SUBDEVICE_PRODIGY71_HIFI 0x38315441 /* audiotrak prodigy */
extern struct snd_ice1712_card_info snd_vt1720_pontis_cards[];
[-- Attachment #3: Type: text/plain, Size: 348 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #4: Type: text/plain, Size: 161 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ice1724/Audiotrak Prodigy 7.1 HiFi
2006-09-19 11:56 ` Julian Scheel
@ 2006-09-20 9:52 ` Julian Scheel
2006-09-29 14:44 ` James Courtier-Dutton
0 siblings, 1 reply; 13+ messages in thread
From: Julian Scheel @ 2006-09-20 9:52 UTC (permalink / raw)
To: alsa-devel; +Cc: Takashi Iwai
Am Dienstag, 19. September 2006 13:56 schrieb Julian Scheel:
> Ok, attached is now what I've done so far. (patch against 1.0.13rc2) This
> causes the WM8766 to be silent. Only way to get the noise back is
> restarting the system without the init-code.
> Couldn't find a reason for that behaviour. Maybe you have an idea what
> could be wrong with that code?
>
One more note about that patch:
I know coding-style is quite horrible and it'd probably break pontis. It's
just what I hacked together for testing, and as the DAC doesn't seem to
understand what I am sending I'd like to get some feedback on the
SPI-implementation, maybe that one is faulty? (The WM8766 sheet isn't very
detailed about that)
-Julian
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ice1724/Audiotrak Prodigy 7.1 HiFi
2006-09-20 9:52 ` Julian Scheel
@ 2006-09-29 14:44 ` James Courtier-Dutton
2006-09-29 15:37 ` Julian Scheel
0 siblings, 1 reply; 13+ messages in thread
From: James Courtier-Dutton @ 2006-09-29 14:44 UTC (permalink / raw)
To: Julian Scheel; +Cc: Takashi Iwai, alsa-devel
Julian Scheel wrote:
> Am Dienstag, 19. September 2006 13:56 schrieb Julian Scheel:
>
>> Ok, attached is now what I've done so far. (patch against 1.0.13rc2) This
>> causes the WM8766 to be silent. Only way to get the noise back is
>> restarting the system without the init-code.
>> Couldn't find a reason for that behaviour. Maybe you have an idea what
>> could be wrong with that code?
>>
>>
>
> One more note about that patch:
> I know coding-style is quite horrible and it'd probably break pontis. It's
> just what I hacked together for testing, and as the DAC doesn't seem to
> understand what I am sending I'd like to get some feedback on the
> SPI-implementation, maybe that one is faulty? (The WM8766 sheet isn't very
> detailed about that)
>
> -Julian
>
After our conversation on IRC and the resulting help I was able to give
you, I understand that you managed to fix this.
When are you going to post the completed patch?
James
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ice1724/Audiotrak Prodigy 7.1 HiFi
2006-09-29 14:44 ` James Courtier-Dutton
@ 2006-09-29 15:37 ` Julian Scheel
2006-09-29 15:44 ` Takashi Iwai
0 siblings, 1 reply; 13+ messages in thread
From: Julian Scheel @ 2006-09-29 15:37 UTC (permalink / raw)
To: James Courtier-Dutton; +Cc: Takashi Iwai, alsa-devel
James Courtier-Dutton schrieb:
> Julian Scheel wrote:
>> Am Dienstag, 19. September 2006 13:56 schrieb Julian Scheel:
>>
>>> Ok, attached is now what I've done so far. (patch against 1.0.13rc2)
>>> This
>>> causes the WM8766 to be silent. Only way to get the noise back is
>>> restarting the system without the init-code.
>>> Couldn't find a reason for that behaviour. Maybe you have an idea what
>>> could be wrong with that code?
>>>
>>>
>>
>> One more note about that patch:
>> I know coding-style is quite horrible and it'd probably break pontis.
>> It's just what I hacked together for testing, and as the DAC doesn't
>> seem to understand what I am sending I'd like to get some feedback on
>> the SPI-implementation, maybe that one is faulty? (The WM8766 sheet
>> isn't very detailed about that)
>>
>> -Julian
>>
>
> After our conversation on IRC and the resulting help I was able to give
> you, I understand that you managed to fix this.
> When are you going to post the completed patch?
>
> James
>
Sadly if been out of work for several days now, because of a tonsilitis.
That's the reason, why I haven't finished up the work yet. Hopefully
I'll do so next week and post the result then.
Though I haven't yet worked with digital out, which might need some more
work, too. But I think I'd post analog-only patches first.
-Julian
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ice1724/Audiotrak Prodigy 7.1 HiFi
2006-09-29 15:37 ` Julian Scheel
@ 2006-09-29 15:44 ` Takashi Iwai
0 siblings, 0 replies; 13+ messages in thread
From: Takashi Iwai @ 2006-09-29 15:44 UTC (permalink / raw)
To: Julian Scheel; +Cc: alsa-devel, James Courtier-Dutton
At Fri, 29 Sep 2006 17:37:31 +0200,
Julian Scheel wrote:
>
> James Courtier-Dutton schrieb:
> > Julian Scheel wrote:
> >> Am Dienstag, 19. September 2006 13:56 schrieb Julian Scheel:
> >>
> >>> Ok, attached is now what I've done so far. (patch against 1.0.13rc2)
> >>> This
> >>> causes the WM8766 to be silent. Only way to get the noise back is
> >>> restarting the system without the init-code.
> >>> Couldn't find a reason for that behaviour. Maybe you have an idea what
> >>> could be wrong with that code?
> >>>
> >>>
> >>
> >> One more note about that patch:
> >> I know coding-style is quite horrible and it'd probably break pontis.
> >> It's just what I hacked together for testing, and as the DAC doesn't
> >> seem to understand what I am sending I'd like to get some feedback on
> >> the SPI-implementation, maybe that one is faulty? (The WM8766 sheet
> >> isn't very detailed about that)
> >>
> >> -Julian
> >>
> >
> > After our conversation on IRC and the resulting help I was able to give
> > you, I understand that you managed to fix this.
> > When are you going to post the completed patch?
> >
> > James
> >
>
> Sadly if been out of work for several days now, because of a tonsilitis.
> That's the reason, why I haven't finished up the work yet. Hopefully
> I'll do so next week and post the result then.
> Though I haven't yet worked with digital out, which might need some more
> work, too. But I think I'd post analog-only patches first.
Good to hear. The patch will be a 2.6.20-kernel material, so we have
a couple of months until a complete version :)
Anyway, ALSA-1.0.13 is out, and the new patches are open for merge
now. Please post a patch fore review at any time.
thanks,
Takashi
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* ice1724/Audiotrak Prodigy 7.1 HiFi
@ 2007-01-02 15:11 Konstantin Kletschke
2007-01-03 18:53 ` Re : " Elie Morisse
0 siblings, 1 reply; 13+ messages in thread
From: Konstantin Kletschke @ 2007-01-02 15:11 UTC (permalink / raw)
To: alsa-devel
Hi Folks!
Currently I am awaiting my Audiotrak Prodigy 7.1 HiFi soundcard to be
delivered as I realize, that some work needs to be put into the driver
for it. I revealed a thread from September started by julian
investigating the stuff. As I found nothing of the results in 1.0.14_rc1
(did not investigate mercurial so far) I ask here, if some help is need
to finish and if I can help sorting things out.
I could investigate the hardware and code kernel driver with datasheets
and oscilloscope (doing this mainly @work with very boring stuff :-P),
or, julian, if you are too busy to tidy up your patches I could check
them also and commit them to ml.
Regards, Konstantin Kletschke
PS.: Is there any other soundcard with an analog output stage as good as
of this card (terratec phase22, audiophile192, and maya44 are not
looking bad, but not as good as the prodigy 7.1 hifi...)?
--
GPG KeyID EF62FCEF
Fingerprint: 13C9 B16B 9844 EC15 CC2E A080 1E69 3FDA EF62 FCEF
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re : ice1724/Audiotrak Prodigy 7.1 HiFi
2007-01-02 15:11 ice1724/Audiotrak Prodigy 7.1 HiFi Konstantin Kletschke
@ 2007-01-03 18:53 ` Elie Morisse
2007-01-05 10:13 ` Konstantin Kletschke
2007-01-05 12:52 ` Konstantin Kletschke
0 siblings, 2 replies; 13+ messages in thread
From: Elie Morisse @ 2007-01-03 18:53 UTC (permalink / raw)
To: Konstantin Kletschke; +Cc: alsa-devel@lists.sourceforge.net
Le 02.01.2007 19:11:09, Konstantin Kletschke a écrit :
> Hi Folks!
>
> Currently I am awaiting my Audiotrak Prodigy 7.1 HiFi soundcard to be
> delivered as I realize, that some work needs to be put into the driver
> for it. I revealed a thread from September started by julian
> investigating the stuff. As I found nothing of the results in 1.0.14_rc1
> (did not investigate mercurial so far) I ask here, if some help is need
> to finish and if I can help sorting things out.
>
> I could investigate the hardware and code kernel driver with datasheets
> and oscilloscope (doing this mainly @work with very boring stuff :-P),
> or, julian, if you are too busy to tidy up your patches I could check
> them also and commit them to ml.
>
> Regards, Konstantin Kletschke
>
> PS.: Is there any other soundcard with an analog output stage as good as
> of this card (terratec phase22, audiophile192, and maya44 are not
> looking bad, but not as good as the prodigy 7.1 hifi...)?
>
> --
> GPG KeyID EF62FCEF
> Fingerprint: 13C9 B16B 9844 EC15 CC2E A080 1E69 3FDA EF62 FCEF
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
>
>
Hi!
This card is quite similar to the Hercules Fortissimo IV, take a look at this :
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1556
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Re : ice1724/Audiotrak Prodigy 7.1 HiFi
2007-01-03 18:53 ` Re : " Elie Morisse
@ 2007-01-05 10:13 ` Konstantin Kletschke
2007-01-05 12:52 ` Konstantin Kletschke
1 sibling, 0 replies; 13+ messages in thread
From: Konstantin Kletschke @ 2007-01-05 10:13 UTC (permalink / raw)
To: alsa-devel@lists.sourceforge.net
Am 2007-01-03 22:53 +0400 schrieb Elie Morisse:
> This card is quite similar to the Hercules Fortissimo IV, take a look at this :
> https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1556
Indeed, this Fortissimo 4 looks almost identical. It looks so similair
that its driver could work with Audiotrak Prodigy 7.1 Hifi out of the
box :-)
Yesterday I started hacking applying the patch Julian provided in
http://thread.gmane.org/gmane.linux.alsa.devel/40350/focus=40350
The card gets detected and the module loads. In alsamixer one PCM mixer
appears which indeed makes playback volume louder or silent.
Yes, playback works. _BUT_ far too fast :-) Someone is misinterpreting
sampling rates so everythings sounds like Mickie Mouse :-)
How is the current status of
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1556#13327
I will test this approach since you point out your card works well with
it. Still I am trying to get used to alsa-driver infrastructure to get
to know what where to code :-)
Regards, Konsti
--
GPG KeyID EF62FCEF
Fingerprint: 13C9 B16B 9844 EC15 CC2E A080 1E69 3FDA EF62 FCEF
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Re : ice1724/Audiotrak Prodigy 7.1 HiFi
2007-01-03 18:53 ` Re : " Elie Morisse
2007-01-05 10:13 ` Konstantin Kletschke
@ 2007-01-05 12:52 ` Konstantin Kletschke
2007-01-05 17:23 ` Konstantin Kletschke
1 sibling, 1 reply; 13+ messages in thread
From: Konstantin Kletschke @ 2007-01-05 12:52 UTC (permalink / raw)
To: alsa-devel@lists.sourceforge.net
[-- Attachment #1: Type: text/plain, Size: 4088 bytes --]
Am 2007-01-03 22:53 +0400 schrieb Elie Morisse:
> https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1556
Well, I tryed this approach and things went pretty well. To simplify my
coding approach I put prodigy_hifi among fortissimo4.
But for now remote hacking was stopped :(
Jan 5 12:44:28 anita ACPI: PCI Interrupt 0000:
01:07.0[A] -> Link [APC2] -> GSI 17 (level, low) -> IRQ 17
Jan 5 12:44:28 anita ich bins, konsti!!!
Jan 5 12:44:28 anita Unable to handle kernel NULL pointer dereference at 000000000000003a RIP:
Jan 5 12:44:28 anita [<ffffffff88189237>] :snd_ice1724:wm_put+0x28/0x43
Jan 5 12:44:28 anita PGD 71831067 PUD 70f01067 PMD 0
Jan 5 12:44:28 anita Oops: 0002 [1] PREEMPT SMP
Jan 5 12:44:28 anita CPU 1
Jan 5 12:44:28 anita Modules linked in: snd_ice1724 snd_seq_midi snd_seq_midi_event snd_seq snd_hda_intel snd_hda_
codec snd_ens1371 snd_ice17xx_ak4xxx snd_ac97_codec snd_ac97_bus snd_ak4114 snd_pcm snd_timer snd_page_alloc snd_pt
2258 snd_i2c snd_ak4xxx_adda snd_mpu401_uart snd_rawmidi snd_seq_device snd soundcore rtc evdev usbhid xfs ehci_hcd
ohci_hcd usbcore forcedeth
Jan 5 12:44:28 anita Pid: 19618, comm: modprobe Not tainted 2.6.19-gentoo-r2 #4
Jan 5 12:44:28 anita RIP: 0010:[<ffffffff88189237>] [<ffffffff88189237>] :snd_ice1724:wm_put+0x28/0x43
Jan 5 12:44:28 anita RSP: 0018:ffff810076c3fce8 EFLAGS: 00010256
Jan 5 12:44:28 anita RAX: 0000000000000000 RBX: ffff81007c128028 RCX: 0000000000000000
Jan 5 12:44:28 anita RDX: 000000000000002a RSI: 000000000000002a RDI: ffff81007c128288
Jan 5 12:44:28 anita RBP: 0000000000000003 R08: ffff810076c3e000 R09: ffff81007b3a5b38
Jan 5 12:44:28 anita R10: 0000000000000000 R11: ffffffff8022c4d7 R12: 0000000000000015
Jan 5 12:44:28 anita R13: 0000000000000006 R14: 0000000000000000 R15: ffff81007c128428
Jan 5 12:44:28 anita FS: 00002abf06204ae0(0000) GS:ffff81007e20bd40(0000) knlGS:0000000000000000
Jan 5 12:44:28 anita CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
Jan 5 12:44:28 anita CR2: 000000000000003a CR3: 000000007922c000 CR4: 00000000000006e0
Jan 5 12:44:28 anita Process modprobe (pid: 19618, threadinfo ffff810076c3e000, task ffff81007db41080)
Jan 5 12:44:28 anita Stack: ffff81007c128028 0000000000000001 0000000038315441 ffffffff88189738
Jan 5 12:44:28 anita ffff81007c128028 0000000000000000 ffff81007c128028 ffffffff88183082
Jan 5 12:44:28 anita 0000000000000001 0000000000000000 ffff81007dbda800 ffff81007c12843c
Jan 5 12:44:28 anita Call Trace:
Jan 5 12:44:28 anita [<ffffffff88189738>] :snd_ice1724:prodigy_hifi_init+0x59/0x95
Jan 5 12:44:28 anita [<ffffffff88183082>] :snd_ice1724:snd_vt1724_probe+0x6ec/0xd80
Jan 5 12:44:28 anita [<ffffffff8027852e>] task_rq_lock+0x3d/0x6f
Jan 5 12:44:28 anita [<ffffffff802799b9>] set_cpus_allowed+0xa5/0xb2
Jan 5 12:44:28 anita [<ffffffff8022a990>] __wake_up+0x38/0x4e
Jan 5 12:44:28 anita [<ffffffff80303dec>] pci_device_probe+0xcd/0x135
Jan 5 12:44:28 anita [<ffffffff8034b02e>] really_probe+0x4c/0xe5
Jan 5 12:44:28 anita [<ffffffff8034b1d8>] __driver_attach+0x0/0x92
Jan 5 12:44:28 anita [<ffffffff8034b232>] __driver_attach+0x5a/0x92
Jan 5 12:44:28 anita [<ffffffff8034a636>] bus_for_each_dev+0x43/0x6e
Jan 5 12:44:28 anita [<ffffffff8034a97e>] bus_add_driver+0x6b/0x18d
Jan 5 12:44:28 anita [<ffffffff80303ffa>] __pci_register_driver+0x8d/0xb3
Jan 5 12:44:28 anita [<ffffffff802908d3>] sys_init_module+0xaf/0x227
Jan 5 12:44:28 anita [<ffffffff80256c3e>] system_call+0x7e/0x83
Jan 5 12:44:28 anita
Jan 5 12:44:28 anita
Jan 5 12:44:28 anita Code: 88 44 0a 10 8d 56 01 48 8b 83 10 02 00 00 48 63 d2 40 88 6c
Jan 5 12:44:28 anita RIP [<ffffffff88189237>] :snd_ice1724:wm_put+0x28/0x43
Jan 5 12:44:28 anita RSP <ffff810076c3fce8>
Jan 5 12:44:28 anita CR2: 000000000000003a
Could somebody of you experienced alsa coders tell me where it
possibly crashed?
wm_put() in my new prodigy_hifi.c looks similiar to the one in pontis.c
(also wm_put_nocache()), the latter worked yesterday...
Kind Regards, Konsti
--
GPG KeyID EF62FCEF
Fingerprint: 13C9 B16B 9844 EC15 CC2E A080 1E69 3FDA EF62 FCEF
[-- Attachment #2: prodigy_hifi.c --]
[-- Type: text/x-csrc, Size: 16812 bytes --]
#include <sound/driver.h>
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/tlv.h>
#include "ice1712.h"
#include "envy24ht.h"
#include "prodigy_hifi.h"
/* I2C addresses */
#define WM_DEV 0x34
// #define CS_DEV 0x20
/* WM8776 registers */
#define WM_HP_ATTEN_L 0x00 /* headphone left attenuation */
#define WM_HP_ATTEN_R 0x01 /* headphone left attenuation */
#define WM_HP_MASTER 0x02 /* headphone master (both channels), override LLR */
#define WM_DAC_ATTEN_L 0x03 /* digital left attenuation */
#define WM_DAC_ATTEN_R 0x04
#define WM_DAC_MASTER 0x05
#define WM_PHASE_SWAP 0x06 /* DAC phase swap */
#define WM_DAC_CTRL1 0x07
#define WM_DAC_MUTE 0x08
#define WM_DAC_CTRL2 0x09
#define WM_DAC_INT 0x0a
#define WM_ADC_INT 0x0b
#define WM_MASTER_CTRL 0x0c
#define WM_POWERDOWN 0x0d
#define WM_ADC_ATTEN_L 0x0e
#define WM_ADC_ATTEN_R 0x0f
#define WM_ALC_CTRL1 0x10
#define WM_ALC_CTRL2 0x11
#define WM_ALC_CTRL3 0x12
#define WM_NOISE_GATE 0x13
#define WM_LIMITER 0x14
#define WM_ADC_MUX 0x15
#define WM_OUT_MUX 0x16
#define WM_RESET 0x17
// Analog Recording Source :- Mic, LineIn, CD/Video,
/* implement capture source select control for WM8776 */
#define WM_AIN1 "Line In"
#define WM_AIN2 "Mic"
#define WM_AIN3 "CD/Video"
#define WM_AIN4 "AIN4"
#define WM_AIN5 "AIN5"
// /*
// * GPIO
// */
// #define PONTIS_CS_CS (1<<4) /* CS */
// #define PONTIS_CS_CLK (1<<5) /* CLK */
// #define PONTIS_CS_RDATA (1<<6) /* CS8416 -> VT1720 */
// #define PONTIS_CS_WDATA (1<<7) /* VT1720 -> CS8416 */
/*
* get the current register value of WM codec
*/
static unsigned short wm_get(struct snd_ice1712 *ice, int reg)
{
reg <<= 1;
return ((unsigned short)ice->akm[0].images[reg] << 8) |
ice->akm[0].images[reg + 1];
}
/*
* set the register value of WM codec and remember it
*/
static void wm_put_nocache(struct snd_ice1712 *ice, int reg, unsigned short val)
{
unsigned short cval;
cval = (reg << 9) | val;
snd_vt1724_write_i2c(ice, WM_DEV, cval >> 8, cval & 0xff);
}
static void wm_put(struct snd_ice1712 *ice, int reg, unsigned short val)
{
wm_put_nocache(ice, reg, val);
reg <<= 1;
ice->akm[0].images[reg] = val >> 8;
ice->akm[0].images[reg + 1] = val;
}
/*
* DAC volume attenuation mixer control (-64dB to 0dB)
*/
#define DAC_0dB 0xff
#define DAC_RES 128
#define DAC_MIN (DAC_0dB - DAC_RES)
static int wm_dac_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = 0; /* mute */
uinfo->value.integer.max = DAC_RES; /* 0dB, 0.5dB step */
return 0;
}
static int wm_dac_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned short val;
int i;
mutex_lock(&ice->gpio_mutex);
for (i = 0; i < 2; i++) {
val = wm_get(ice, WM_DAC_ATTEN_L + i) & 0xff;
val = val > DAC_MIN ? (val - DAC_MIN) : 0;
ucontrol->value.integer.value[i] = val;
}
mutex_unlock(&ice->gpio_mutex);
return 0;
}
static int wm_dac_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned short oval, nval;
int i, idx, change = 0;
mutex_lock(&ice->gpio_mutex);
for (i = 0; i < 2; i++) {
nval = ucontrol->value.integer.value[i];
nval = (nval ? (nval + DAC_MIN) : 0) & 0xff;
idx = WM_DAC_ATTEN_L + i;
oval = wm_get(ice, idx) & 0xff;
if (oval != nval) {
wm_put(ice, idx, nval);
wm_put_nocache(ice, idx, nval | 0x100);
change = 1;
}
}
mutex_unlock(&ice->gpio_mutex);
return change;
}
/* KONSTI */
static int wm_adc_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char* texts[32] = {"NULL", WM_AIN1, WM_AIN2, WM_AIN1 "+" WM_AIN2,
WM_AIN3, WM_AIN1 "+" WM_AIN3, WM_AIN2 "+" WM_AIN3,
WM_AIN1 "+" WM_AIN2 "+" WM_AIN3,
WM_AIN4, WM_AIN1 "+" WM_AIN4, WM_AIN2 "+" WM_AIN4,
WM_AIN1 "+" WM_AIN2 "+" WM_AIN4,
WM_AIN3 "+" WM_AIN4, WM_AIN1 "+" WM_AIN3 "+" WM_AIN4,
WM_AIN2 "+" WM_AIN3 "+" WM_AIN4,
WM_AIN1 "+" WM_AIN2 "+" WM_AIN3 "+" WM_AIN4,
WM_AIN5, WM_AIN1 "+" WM_AIN5, WM_AIN2 "+" WM_AIN5,
WM_AIN1 "+" WM_AIN2 "+" WM_AIN5,
WM_AIN3 "+" WM_AIN5, WM_AIN1 "+" WM_AIN3 "+" WM_AIN5,
WM_AIN2 "+" WM_AIN3 "+" WM_AIN5,
WM_AIN1 "+" WM_AIN2 "+" WM_AIN3 "+" WM_AIN5,
WM_AIN4 "+" WM_AIN5, WM_AIN1 "+" WM_AIN4 "+" WM_AIN5,
WM_AIN2 "+" WM_AIN4 "+" WM_AIN5,
WM_AIN1 "+" WM_AIN2 "+" WM_AIN4 "+" WM_AIN5,
WM_AIN3 "+" WM_AIN4 "+" WM_AIN5,
WM_AIN1 "+" WM_AIN3 "+" WM_AIN4 "+" WM_AIN5,
WM_AIN2 "+" WM_AIN3 "+" WM_AIN4 "+" WM_AIN5,
WM_AIN1 "+" WM_AIN2 "+" WM_AIN3 "+" WM_AIN4 "+" WM_AIN5};
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 32;
if (uinfo->value.enumerated.item > 31)
uinfo->value.enumerated.item = 31;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0;
}
static int wm_adc_mux_enum_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
mutex_lock(&ice->gpio_mutex);
ucontrol->value.integer.value[0]=wm_get(ice, WM_ADC_MUX) & 0x1f;
mutex_unlock(&ice->gpio_mutex);
return 0;
}
static int wm_adc_mux_enum_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned short oval, nval;
mutex_lock(&ice->gpio_mutex);
oval = wm_get(ice, WM_ADC_MUX);
nval = ( oval & 0xe0 ) | ucontrol->value.integer.value[0] ;
if ( nval != oval ) {
wm_put(ice, WM_ADC_MUX, nval);
}
mutex_unlock(&ice->gpio_mutex);
return 0;
}
/* KONSTI */
/*
* ADC gain mixer control (-64dB to 0dB)
*/
#define ADC_0dB 0xcf
#define ADC_RES 128
#define ADC_MIN (ADC_0dB - ADC_RES)
static int wm_adc_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = 0; /* mute (-64dB) */
uinfo->value.integer.max = ADC_RES; /* 0dB, 0.5dB step */
return 0;
}
static int wm_adc_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned short val;
int i;
mutex_lock(&ice->gpio_mutex);
for (i = 0; i < 2; i++) {
val = wm_get(ice, WM_ADC_ATTEN_L + i) & 0xff;
val = val > ADC_MIN ? (val - ADC_MIN) : 0;
ucontrol->value.integer.value[i] = val;
}
mutex_unlock(&ice->gpio_mutex);
return 0;
}
static int wm_adc_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned short ovol, nvol;
int i, idx, change = 0;
mutex_lock(&ice->gpio_mutex);
for (i = 0; i < 2; i++) {
nvol = ucontrol->value.integer.value[i];
nvol = nvol ? (nvol + ADC_MIN) : 0;
idx = WM_ADC_ATTEN_L + i;
ovol = wm_get(ice, idx) & 0xff;
if (ovol != nvol) {
wm_put(ice, idx, nvol);
change = 1;
}
}
mutex_unlock(&ice->gpio_mutex);
return change;
}
/*
* ADC input mux mixer control
*/
static int wm_adc_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 1;
return 0;
}
static int wm_adc_mux_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int bit = kcontrol->private_value;
mutex_lock(&ice->gpio_mutex);
ucontrol->value.integer.value[0] = (wm_get(ice, WM_ADC_MUX) & (1 << bit)) ? 1 : 0;
mutex_unlock(&ice->gpio_mutex);
return 0;
}
static int wm_adc_mux_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int bit = kcontrol->private_value;
unsigned short oval, nval;
int change;
mutex_lock(&ice->gpio_mutex);
nval = oval = wm_get(ice, WM_ADC_MUX);
if (ucontrol->value.integer.value[0])
nval |= (1 << bit);
else
nval &= ~(1 << bit);
change = nval != oval;
if (change) {
wm_put(ice, WM_ADC_MUX, nval);
}
mutex_unlock(&ice->gpio_mutex);
return 0;
}
/*
* Analog bypass (In -> Out)
*/
static int wm_bypass_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 1;
return 0;
}
static int wm_bypass_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
mutex_lock(&ice->gpio_mutex);
ucontrol->value.integer.value[0] = (wm_get(ice, WM_OUT_MUX) & 0x04) ? 1 : 0;
mutex_unlock(&ice->gpio_mutex);
return 0;
}
static int wm_bypass_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned short val, oval;
int change = 0;
mutex_lock(&ice->gpio_mutex);
val = oval = wm_get(ice, WM_OUT_MUX);
if (ucontrol->value.integer.value[0])
val |= 0x04;
else
val &= ~0x04;
if (val != oval) {
wm_put(ice, WM_OUT_MUX, val);
change = 1;
}
mutex_unlock(&ice->gpio_mutex);
return change;
}
/*
* Left/Right swap
*/
static int wm_chswap_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 1;
return 0;
}
static int wm_chswap_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
mutex_lock(&ice->gpio_mutex);
ucontrol->value.integer.value[0] = (wm_get(ice, WM_DAC_CTRL1) & 0xf0) != 0x90;
mutex_unlock(&ice->gpio_mutex);
return 0;
}
static int wm_chswap_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned short val, oval;
int change = 0;
mutex_lock(&ice->gpio_mutex);
oval = wm_get(ice, WM_DAC_CTRL1);
val = oval & 0x0f;
if (ucontrol->value.integer.value[0])
val |= 0x60;
else
val |= 0x90;
if (val != oval) {
wm_put(ice, WM_DAC_CTRL1, val);
wm_put_nocache(ice, WM_DAC_CTRL1, val);
change = 1;
}
mutex_unlock(&ice->gpio_mutex);
return change;
}
static DECLARE_TLV_DB_SCALE(db_scale_volume, -6400, 50, 1);
/*
* mixers
*/
static struct snd_kcontrol_new prodigy_hifi_controls[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
SNDRV_CTL_ELEM_ACCESS_TLV_READ),
.name = "PCM Playback Volume",
.info = wm_dac_vol_info,
.get = wm_dac_vol_get,
.put = wm_dac_vol_put,
.tlv = { .p = db_scale_volume },
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
SNDRV_CTL_ELEM_ACCESS_TLV_READ),
.name = "Capture Volume",
.info = wm_adc_vol_info,
.get = wm_adc_vol_get,
.put = wm_adc_vol_put,
.tlv = { .p = db_scale_volume },
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "CD Capture Switch",
.info = wm_adc_mux_info,
.get = wm_adc_mux_get,
.put = wm_adc_mux_put,
.private_value = 0,
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Line Capture Switch",
.info = wm_adc_mux_info,
.get = wm_adc_mux_get,
.put = wm_adc_mux_put,
.private_value = 1,
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Analog Bypass Switch",
.info = wm_bypass_info,
.get = wm_bypass_get,
.put = wm_bypass_put,
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Swap Output Channels",
.info = wm_chswap_info,
.get = wm_chswap_get,
.put = wm_chswap_put,
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Analog Capture Source",
.info = wm_adc_mux_enum_info,
.get = wm_adc_mux_enum_get,
.put = wm_adc_mux_enum_put,
},
};
/*
* WM codec registers
*/
static void wm_proc_regs_write(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{
struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
char line[64];
unsigned int reg, val;
mutex_lock(&ice->gpio_mutex);
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(line, "%x %x", ®, &val) != 2)
continue;
if (reg <= 0x17 && val <= 0xffff)
wm_put(ice, reg, val);
}
mutex_unlock(&ice->gpio_mutex);
}
static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{
struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
int reg, val;
mutex_lock(&ice->gpio_mutex);
for (reg = 0; reg <= 0x17; reg++) {
val = wm_get(ice, reg);
snd_iprintf(buffer, "%02x = %04x\n", reg, val);
}
mutex_unlock(&ice->gpio_mutex);
}
static void wm_proc_init(struct snd_ice1712 *ice)
{
struct snd_info_entry *entry;
if (! snd_card_proc_new(ice->card, "wm_codec", &entry)) {
snd_info_set_text_ops(entry, ice, wm_proc_regs_read);
entry->mode |= S_IWUSR;
entry->c.text.write = wm_proc_regs_write;
}
}
static int __devinit prodigy_hifi_add_controls(struct snd_ice1712 *ice)
{
unsigned int i;
int err;
for (i = 0; i < ARRAY_SIZE(prodigy_hifi_controls); i++) {
err = snd_ctl_add(ice->card, snd_ctl_new1(&prodigy_hifi_controls[i], ice));
if (err < 0)
return err;
}
wm_proc_init(ice);
// cs_proc_init(ice);
return 0;
}
/*
* initialize the chip
*/
static int __devinit prodigy_hifi_init(struct snd_ice1712 *ice)
{
static unsigned short wm_inits[] = {
/* These come first to reduce init pop noise */
WM_ADC_MUX, 0x0003, /* ADC mute */
/* 0x00c0 replaced by 0x0003 */
WM_DAC_MUTE, 0x0001, /* DAC softmute */
WM_DAC_CTRL1, 0x0000, /* DAC mute */
WM_POWERDOWN, 0x0008, /* All power-up except HP */
WM_RESET, 0x0000, /* reset */
};
static unsigned short wm_inits2[] = {
WM_MASTER_CTRL, 0x0022, /* 256fs, slave mode */
WM_DAC_INT, 0x0022, /* I2S, normal polarity, 24bit */
WM_ADC_INT, 0x0022, /* I2S, normal polarity, 24bit */
WM_DAC_CTRL1, 0x0090, /* DAC L/R */
WM_OUT_MUX, 0x0001, /* OUT DAC */
WM_HP_ATTEN_L, 0x0179, /* HP 0dB */
WM_HP_ATTEN_R, 0x0179, /* HP 0dB */
WM_DAC_ATTEN_L, 0x0000, /* DAC 0dB */
WM_DAC_ATTEN_L, 0x0100, /* DAC 0dB */
WM_DAC_ATTEN_R, 0x0000, /* DAC 0dB */
WM_DAC_ATTEN_R, 0x0100, /* DAC 0dB */
// WM_DAC_MASTER, 0x0100, /* DAC master muted */
WM_PHASE_SWAP, 0x0000, /* phase normal */
WM_DAC_CTRL2, 0x0000, /* no deemphasis, no ZFLG */
WM_ADC_ATTEN_L, 0x0000, /* ADC muted */
WM_ADC_ATTEN_R, 0x0000, /* ADC muted */
#if 0
WM_ALC_CTRL1, 0x007b, /* */
WM_ALC_CTRL2, 0x0000, /* */
WM_ALC_CTRL3, 0x0000, /* */
WM_NOISE_GATE, 0x0000, /* */
#endif
WM_DAC_MUTE, 0x0000, /* DAC unmute */
WM_ADC_MUX, 0x0003, /* ADC unmute, both CD/Line On */
};
unsigned int i;
ice->vt1724 = 1;
ice->num_total_dacs = 1;
ice->num_total_adcs = 1;
printk("ich bins, konsti!!!\n");
/* HACK - use this as the SPDIF source.
* don't call snd_ice1712_gpio_get/put(), otherwise it's overwritten
*/
ice->gpio.saved[0] = 0;
/* initialize WM8776 codec */
for (i = 0; i < ARRAY_SIZE(wm_inits); i += 2)
wm_put(ice, wm_inits[i], wm_inits[i+1]);
schedule_timeout_uninterruptible(1);
for (i = 0; i < ARRAY_SIZE(wm_inits2); i += 2)
wm_put(ice, wm_inits2[i], wm_inits2[i+1]);
return 0;
}
static unsigned char prodigy_hifi_eeprom[] __devinitdata = {
0x08, /* SYSCONF: clock 256, mpu401, spdif-in/ADC, 1DAC */
0x80, /* ACLINK: I2S */
0xf8, /* I2S: vol, 96k, 24bit, 192k */
0xc3, /* SPDIF: out-en, out-int, spdif-in */
0x07, /* GPIO_DIR */
0x00, /* GPIO_DIR1 */
0x00, /* GPIO_DIR2 (ignored) */
0x0f, /* GPIO_MASK (4-7 reserved for CS8416) */
0xff, /* GPIO_MASK1 */
0x00, /* GPIO_MASK2 (ignored) */
0x06, /* GPIO_STATE (0-low, 1-high, 2-high) */
0x00, /* GPIO_STATE1 */
0x00, /* GPIO_STATE2 (ignored) */
};
/* entry point */
struct snd_ice1712_card_info snd_vt1724_prodigy_hifi_cards[] __devinitdata = {
{
.subvendor = VT1724_SUBDEVICE_PRODIGY_HIFI,
.name = "Audiotrak Prodigy 7.1 HiFi",
.model = "prodigy71hifi",
.chip_init = prodigy_hifi_init,
.build_controls = prodigy_hifi_add_controls,
.eeprom_size = sizeof(prodigy_hifi_eeprom),
.eeprom_data = prodigy_hifi_eeprom,
/*
.eeprom_size = 0,
.eeprom_data = NULL,
*/
},
{ } /* terminator */
};
[-- Attachment #3: Type: text/plain, Size: 347 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #4: Type: text/plain, Size: 161 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Re : ice1724/Audiotrak Prodigy 7.1 HiFi
2007-01-05 12:52 ` Konstantin Kletschke
@ 2007-01-05 17:23 ` Konstantin Kletschke
0 siblings, 0 replies; 13+ messages in thread
From: Konstantin Kletschke @ 2007-01-05 17:23 UTC (permalink / raw)
To: alsa-devel
Okay, I read Bug 0001556 again and I read that
ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
if (! ice->akm)
return -ENOMEM;
ice->akm_codecs = 1;
is required for the quick Hack not to Oops, thats the case here also and
putting it back let me load the module and inspect some stuff with
alsamixer.
But, as my first approach with the pontis.c modification, audio plays at
double speed.
As I am a greenhorn writing alsa drivers, where start I search for a bug
or what debug output is of interest now?
Konsti
--
GPG KeyID EF62FCEF
Fingerprint: 13C9 B16B 9844 EC15 CC2E A080 1E69 3FDA EF62 FCEF
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-01-05 17:23 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-02 15:11 ice1724/Audiotrak Prodigy 7.1 HiFi Konstantin Kletschke
2007-01-03 18:53 ` Re : " Elie Morisse
2007-01-05 10:13 ` Konstantin Kletschke
2007-01-05 12:52 ` Konstantin Kletschke
2007-01-05 17:23 ` Konstantin Kletschke
-- strict thread matches above, loose matches on Subject: below --
2006-09-15 19:11 Julian Scheel
2006-09-19 9:27 ` Takashi Iwai
2006-09-19 9:40 ` Julian Scheel
2006-09-19 11:56 ` Julian Scheel
2006-09-20 9:52 ` Julian Scheel
2006-09-29 14:44 ` James Courtier-Dutton
2006-09-29 15:37 ` Julian Scheel
2006-09-29 15:44 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox