* e-mu 1212m and 1820(m) patch
@ 2007-05-11 21:54 Ctirad Fertr
2007-05-12 8:46 ` James Courtier-Dutton
0 siblings, 1 reply; 7+ messages in thread
From: Ctirad Fertr @ 2007-05-11 21:54 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 223 bytes --]
Hello,
here is a little patch which enables ADAT and S/PDIF functionality. It adds
possibility to sync with either S/PDIF or ADAT clock as well. 44.1/48kHz
only, though it works pretty well for me.
Regards,
Ctirad
[-- Attachment #2: adat-ext_sync.diff --]
[-- Type: text/x-diff, Size: 3893 bytes --]
diff -ruN a/pci/emu10k1/emumixer.c b/pci/emu10k1/emumixer.c
--- a/pci/emu10k1/emumixer.c 2007-05-11 19:47:09.000000000 +0200
+++ b/pci/emu10k1/emumixer.c 2007-05-11 19:22:49.000000000 +0200
@@ -500,17 +500,19 @@
static int snd_emu1010_internal_clock_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
- static char *texts[2] = {
- "44100", "48000"
+ static char *texts[4] = {
+ "44100", "48000", "SPDIF", "ADAT"
};
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
- uinfo->value.enumerated.items = 2;
- if (uinfo->value.enumerated.item > 1)
- uinfo->value.enumerated.item = 1;
+ uinfo->value.enumerated.items = 4;
+ if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+ uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0;
+
+
}
static int snd_emu1010_internal_clock_get(struct snd_kcontrol *kcontrol,
@@ -568,6 +570,44 @@
/* Unmute all */
snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
break;
+
+ case 2: /* Take clock from S/PDIF IN */
+ /* Mute all */
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
+ /* Default fallback clock 48kHz */
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K );
+ /* Word Clock source, sync to S/PDIF input */
+ snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
+ EMU_HANA_WCLOCK_HANA_SPDIF_IN | EMU_HANA_WCLOCK_1X );
+ /* Set LEDs on Audio Dock */
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2,
+ EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK );
+ /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */
+ /* Allow DLL to settle */
+ msleep(10);
+ /* Unmute all */
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
+ break;
+
+ case 3:
+ /* Take clock from ADAT IN */
+ /* Mute all */
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
+ /* Default fallback clock 48kHz */
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K );
+ /* Word Clock source, sync to ADAT input */
+ snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
+ EMU_HANA_WCLOCK_HANA_ADAT_IN | EMU_HANA_WCLOCK_1X );
+ /* Set LEDs on Audio Dock */
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK );
+ /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */
+ /* Allow DLL to settle */
+ msleep(10);
+ /* Unmute all */
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
+
+
+ break;
}
}
return change;
diff -ruN a/pci/emu10k1/emu10k1_main.c b/pci/emu10k1/emu10k1_main.c
--- a/pci/emu10k1/emu10k1_main.c 2007-05-11 19:47:09.000000000 +0200
+++ b/pci/emu10k1/emu10k1_main.c 2007-05-10 21:25:57.000000000 +0200
@@ -765,8 +765,8 @@
snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ® );
snd_printk(KERN_INFO "emu1010: Card options=0x%x\n",reg);
snd_emu1010_fpga_read(emu, EMU_HANA_OPTICAL_TYPE, &tmp );
- /* ADAT input. */
- snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x01 );
+ /* Optical -> ADAT I/O */
+ snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, EMU_HANA_OPTICAL_IN_ADAT | EMU_HANA_OPTICAL_OUT_ADAT );
snd_emu1010_fpga_read(emu, EMU_HANA_ADC_PADS, &tmp );
/* Set no attenuation on Audio Dock pads. */
snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, 0x00 );
@@ -1048,7 +1048,7 @@
emu->emu1010.output_source[23] = 28;
/* TEMP: Select SPDIF in/out */
- snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x0); /* Output spdif */
+ //snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x0); /* Output spdif */
/* TEMP: Select 48kHz SPDIF out */
snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x0); /* Mute all */
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: e-mu 1212m and 1820(m) patch
2007-05-11 21:54 e-mu 1212m and 1820(m) patch Ctirad Fertr
@ 2007-05-12 8:46 ` James Courtier-Dutton
2007-05-12 10:02 ` Ctirad Fertr
0 siblings, 1 reply; 7+ messages in thread
From: James Courtier-Dutton @ 2007-05-12 8:46 UTC (permalink / raw)
To: Ctirad Fertr; +Cc: alsa-devel
Ctirad Fertr wrote:
> Hello,
>
> here is a little patch which enables ADAT and S/PDIF functionality. It adds
> possibility to sync with either S/PDIF or ADAT clock as well. 44.1/48kHz
> only, though it works pretty well for me.
>
> Regards,
>
> Ctirad
>
Nice work. Did you manage to do this from just the comments I had placed
in the source code, or did you use some other method?
I would like to put enough comments in the source code so others, like
yourself, can add functionality that I have not had time to.
James
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: e-mu 1212m and 1820(m) patch
2007-05-12 8:46 ` James Courtier-Dutton
@ 2007-05-12 10:02 ` Ctirad Fertr
2007-05-12 14:11 ` James Courtier-Dutton
0 siblings, 1 reply; 7+ messages in thread
From: Ctirad Fertr @ 2007-05-12 10:02 UTC (permalink / raw)
To: alsa-devel
Dne sobota 12 květen 2007 10:46 James Courtier-Dutton napsal(a):
> Nice work. Did you manage to do this from just the comments I had placed
> in the source code, or did you use some other method?
I learned most part form the register names in emu10k1.h. They are quite self
explaining.
> I would like to put enough comments in the source code so others, like
> yourself, can add functionality that I have not had time to.
It would be nice. There is another developer, Dustin, who I meet at local
linux forum. He tries to find a way how to add more 24 bit capture channels
then 8. It is confusing, as we don't have enough informations about
connections between Hana and emu10k2. We belive EMU32 buses are 32bit and not
16 bit. The windows driver can record from (at least) 16 channels, anyway.
Multichannel playback needs to be fixed as well. We need a help or at least a
hint from you as you are only person who have datasheets.
Regards,
Ctirad
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: e-mu 1212m and 1820(m) patch
2007-05-12 10:02 ` Ctirad Fertr
@ 2007-05-12 14:11 ` James Courtier-Dutton
2007-05-12 15:38 ` Ctirad Fertr
0 siblings, 1 reply; 7+ messages in thread
From: James Courtier-Dutton @ 2007-05-12 14:11 UTC (permalink / raw)
To: Ctirad Fertr; +Cc: alsa-devel
Ctirad Fertr wrote:
> Dne sobota 12 květen 2007 10:46 James Courtier-Dutton napsal(a):
>> Nice work. Did you manage to do this from just the comments I had placed
>> in the source code, or did you use some other method?
>
> I learned most part form the register names in emu10k1.h. They are quite self
> explaining.
>
>> I would like to put enough comments in the source code so others, like
>> yourself, can add functionality that I have not had time to.
>
> It would be nice. There is another developer, Dustin, who I meet at local
> linux forum. He tries to find a way how to add more 24 bit capture channels
> then 8. It is confusing, as we don't have enough informations about
> connections between Hana and emu10k2. We belive EMU32 buses are 32bit and not
> 16 bit. The windows driver can record from (at least) 16 channels, anyway.
> Multichannel playback needs to be fixed as well. We need a help or at least a
> hint from you as you are only person who have datasheets.
>
> Regards,
>
> Ctirad
The link between hana and emu10k2 is 32bit.
The link between the emu10k2 and the PCI bus for capture is 16bit and
limited to 16 channels. I decided to instead make this link 32bit, by
using 2 16bit channels, thus resulting in 16/2 = 8 channels.
I do have one datasheet that hints at a 24bit channel from emu10k2 and
the PCI bus, but I have not checked if the 1212m version of the emu10k2
supports it. It might only be the 1616m that supports it, and I have not
added support for that in alsa yet.
James
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: e-mu 1212m and 1820(m) patch
2007-05-12 14:11 ` James Courtier-Dutton
@ 2007-05-12 15:38 ` Ctirad Fertr
2007-05-13 12:03 ` James Courtier-Dutton
0 siblings, 1 reply; 7+ messages in thread
From: Ctirad Fertr @ 2007-05-12 15:38 UTC (permalink / raw)
To: alsa-devel
> The link between hana and emu10k2 is 32bit.
> The link between the emu10k2 and the PCI bus for capture is 16bit and
> limited to 16 channels.
Really? I'm almost sure that emu10k2 is capable of 64 streams at 16/44.1
(48kHz) resolution.
> I decided to instead make this link 32bit, by
> using 2 16bit channels, thus resulting in 16/2 = 8 channels.
> I do have one datasheet that hints at a 24bit channel from emu10k2 and
> the PCI bus, but I have not checked if the 1212m version of the emu10k2
> supports it.
A friend of mine does 16 channel recordings on 1820m under windows, so it's
definitely possible. I have only 1212M (old version) and it's capable of 12
ins and 12 outs at 44.1/48kHz, 8 ins and 8 outs at 96kHz and finally 4 ins
and 4 outs at 192kHz.
> It might only be the 1616m that supports it, and I have not
> added support for that in alsa yet.
How much difference is between current 1820 (old 1010) and 1616 (new 1010)
code? Do you have something working? Anyway, I have good relations with local
e-mu delaer, so I can borrow any e-mu hardware currently available. I also
have gear needed for testing S/PDIF/ADAT/sync card functionality.
Regards,
Ctirad
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: e-mu 1212m and 1820(m) patch
2007-05-12 15:38 ` Ctirad Fertr
@ 2007-05-13 12:03 ` James Courtier-Dutton
2007-05-13 13:37 ` Ctirad Fertr
0 siblings, 1 reply; 7+ messages in thread
From: James Courtier-Dutton @ 2007-05-13 12:03 UTC (permalink / raw)
To: Ctirad Fertr; +Cc: alsa-devel
Ctirad Fertr wrote:
>> The link between hana and emu10k2 is 32bit.
>> The link between the emu10k2 and the PCI bus for capture is 16bit and
>> limited to 16 channels.
>
> Really? I'm almost sure that emu10k2 is capable of 64 streams at 16/44.1
> (48kHz) resolution.
>
For playback, not for capture.
>> I decided to instead make this link 32bit, by
>> using 2 16bit channels, thus resulting in 16/2 = 8 channels.
>> I do have one datasheet that hints at a 24bit channel from emu10k2 and
>> the PCI bus, but I have not checked if the 1212m version of the emu10k2
>> supports it.
>
> A friend of mine does 16 channel recordings on 1820m under windows, so it's
> definitely possible. I have only 1212M (old version) and it's capable of 12
> ins and 12 outs at 44.1/48kHz, 8 ins and 8 outs at 96kHz and finally 4 ins
> and 4 outs at 192kHz.
What resolution? 16bit or 24bit. I could get the above working for 16bit
capture.
>
>> It might only be the 1616m that supports it, and I have not
>> added support for that in alsa yet.
>
> How much difference is between current 1820 (old 1010) and 1616 (new 1010)
> code? Do you have something working? Anyway, I have good relations with local
> e-mu delaer, so I can borrow any e-mu hardware currently available. I also
> have gear needed for testing S/PDIF/ADAT/sync card functionality.
I have not tried the 1616 yet. I expect that it will require different
firmware, but I have to test first.
>
> Regards,
>
> Ctirad
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: e-mu 1212m and 1820(m) patch
2007-05-13 12:03 ` James Courtier-Dutton
@ 2007-05-13 13:37 ` Ctirad Fertr
0 siblings, 0 replies; 7+ messages in thread
From: Ctirad Fertr @ 2007-05-13 13:37 UTC (permalink / raw)
To: alsa-devel
> > A friend of mine does 16 channel recordings on 1820m under windows, so
> > it's definitely possible. I have only 1212M (old version) and it's
> > capable of 12 ins and 12 outs at 44.1/48kHz, 8 ins and 8 outs at 96kHz
> > and finally 4 ins and 4 outs at 192kHz.
>
> What resolution? 16bit or 24bit. I could get the above working for 16bit
> capture.
24 bit. A pro card with 16 bit resolution would be quite a rarity nowdays ;)
Regards,
Ctirad
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-05-13 13:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-11 21:54 e-mu 1212m and 1820(m) patch Ctirad Fertr
2007-05-12 8:46 ` James Courtier-Dutton
2007-05-12 10:02 ` Ctirad Fertr
2007-05-12 14:11 ` James Courtier-Dutton
2007-05-12 15:38 ` Ctirad Fertr
2007-05-13 12:03 ` James Courtier-Dutton
2007-05-13 13:37 ` Ctirad Fertr
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.