aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-23 19:36:08 -0400
committerTakashi Iwai <tiwai@suse.de>2009-03-23 19:36:08 -0400
commitfe506d6bc5d7b9c0c1d630eecb32241c1d362462 (patch)
treea74c60ddad5dcd1df84caeb454758e30f1781e3d
parentc9294e4b3793e2bd397691ae015283eecca29562 (diff)
parent730d45f9130f81fd49009301e9dfbd19fe2b3e1f (diff)
Merge branch 'topic/emu10k1' into for-linus
-rw-r--r--sound/pci/emu10k1/emu10k1_callback.c7
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c11
-rw-r--r--sound/pci/emu10k1/emufx.c11
-rw-r--r--sound/pci/emu10k1/emupcm.c37
-rw-r--r--sound/pci/emu10k1/io.c4
-rw-r--r--sound/pci/emu10k1/p16v.c100
-rw-r--r--sound/pci/emu10k1/voice.c12
7 files changed, 132 insertions, 50 deletions
diff --git a/sound/pci/emu10k1/emu10k1_callback.c b/sound/pci/emu10k1/emu10k1_callback.c
index 0e649dcdbf64..7ef949d99a50 100644
--- a/sound/pci/emu10k1/emu10k1_callback.c
+++ b/sound/pci/emu10k1/emu10k1_callback.c
@@ -103,7 +103,10 @@ snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw)
103 int ch; 103 int ch;
104 vp = &emu->voices[best[i].voice]; 104 vp = &emu->voices[best[i].voice];
105 if ((ch = vp->ch) < 0) { 105 if ((ch = vp->ch) < 0) {
106 //printk("synth_get_voice: ch < 0 (%d) ??", i); 106 /*
107 printk(KERN_WARNING
108 "synth_get_voice: ch < 0 (%d) ??", i);
109 */
107 continue; 110 continue;
108 } 111 }
109 vp->emu->num_voices--; 112 vp->emu->num_voices--;
@@ -335,7 +338,7 @@ start_voice(struct snd_emux_voice *vp)
335 return -EINVAL; 338 return -EINVAL;
336 emem->map_locked++; 339 emem->map_locked++;
337 if (snd_emu10k1_memblk_map(hw, emem) < 0) { 340 if (snd_emu10k1_memblk_map(hw, emem) < 0) {
338 // printk("emu: cannot map!\n"); 341 /* printk(KERN_ERR "emu: cannot map!\n"); */
339 return -ENOMEM; 342 return -ENOMEM;
340 } 343 }
341 mapped_offset = snd_emu10k1_memblk_offset(emem) >> 1; 344 mapped_offset = snd_emu10k1_memblk_offset(emem) >> 1;
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 101a1c13a20d..f18bd6207c50 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -711,8 +711,7 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 *emu, const char *filena
711static int emu1010_firmware_thread(void *data) 711static int emu1010_firmware_thread(void *data)
712{ 712{
713 struct snd_emu10k1 *emu = data; 713 struct snd_emu10k1 *emu = data;
714 int tmp, tmp2; 714 u32 tmp, tmp2, reg;
715 int reg;
716 int err; 715 int err;
717 716
718 for (;;) { 717 for (;;) {
@@ -758,7 +757,8 @@ static int emu1010_firmware_thread(void *data)
758 snd_printk(KERN_INFO "emu1010: Audio Dock Firmware loaded\n"); 757 snd_printk(KERN_INFO "emu1010: Audio Dock Firmware loaded\n");
759 snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp); 758 snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp);
760 snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2); 759 snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2);
761 snd_printk("Audio Dock ver:%d.%d\n", tmp, tmp2); 760 snd_printk(KERN_INFO "Audio Dock ver: %u.%u\n",
761 tmp, tmp2);
762 /* Sync clocking between 1010 and Dock */ 762 /* Sync clocking between 1010 and Dock */
763 /* Allow DLL to settle */ 763 /* Allow DLL to settle */
764 msleep(10); 764 msleep(10);
@@ -804,8 +804,7 @@ static int emu1010_firmware_thread(void *data)
804static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu) 804static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
805{ 805{
806 unsigned int i; 806 unsigned int i;
807 int tmp, tmp2; 807 u32 tmp, tmp2, reg;
808 int reg;
809 int err; 808 int err;
810 const char *filename = NULL; 809 const char *filename = NULL;
811 810
@@ -887,7 +886,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
887 snd_printk(KERN_INFO "emu1010: Hana Firmware loaded\n"); 886 snd_printk(KERN_INFO "emu1010: Hana Firmware loaded\n");
888 snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp); 887 snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp);
889 snd_emu1010_fpga_read(emu, EMU_HANA_MINOR_REV, &tmp2); 888 snd_emu1010_fpga_read(emu, EMU_HANA_MINOR_REV, &tmp2);
890 snd_printk("emu1010: Hana version: %d.%d\n", tmp, tmp2); 889 snd_printk(KERN_INFO "emu1010: Hana version: %u.%u\n", tmp, tmp2);
891 /* Enable 48Volt power to Audio Dock */ 890 /* Enable 48Volt power to Audio Dock */
892 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, EMU_HANA_DOCK_PWR_ON); 891 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, EMU_HANA_DOCK_PWR_ON);
893 892
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 7dba08f0ab8e..191e1cd9997d 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -1519,7 +1519,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1519 /* A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS); */ 1519 /* A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS); */
1520 if (emu->card_capabilities->emu_model) { 1520 if (emu->card_capabilities->emu_model) {
1521 /* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */ 1521 /* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */
1522 snd_printk("EMU outputs on\n"); 1522 snd_printk(KERN_INFO "EMU outputs on\n");
1523 for (z = 0; z < 8; z++) { 1523 for (z = 0; z < 8; z++) {
1524 if (emu->card_capabilities->ca0108_chip) { 1524 if (emu->card_capabilities->ca0108_chip) {
1525 A_OP(icode, &ptr, iACC3, A3_EMU32OUT(z), A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + z), A_C_00000000, A_C_00000000); 1525 A_OP(icode, &ptr, iACC3, A3_EMU32OUT(z), A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + z), A_C_00000000, A_C_00000000);
@@ -1567,7 +1567,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1567 1567
1568 if (emu->card_capabilities->emu_model) { 1568 if (emu->card_capabilities->emu_model) {
1569 if (emu->card_capabilities->ca0108_chip) { 1569 if (emu->card_capabilities->ca0108_chip) {
1570 snd_printk("EMU2 inputs on\n"); 1570 snd_printk(KERN_INFO "EMU2 inputs on\n");
1571 for (z = 0; z < 0x10; z++) { 1571 for (z = 0; z < 0x10; z++) {
1572 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, 1572 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp,
1573 bit_shifter16, 1573 bit_shifter16,
@@ -1575,10 +1575,13 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1575 A_FXBUS2(z*2) ); 1575 A_FXBUS2(z*2) );
1576 } 1576 }
1577 } else { 1577 } else {
1578 snd_printk("EMU inputs on\n"); 1578 snd_printk(KERN_INFO "EMU inputs on\n");
1579 /* Capture 16 (originally 8) channels of S32_LE sound */ 1579 /* Capture 16 (originally 8) channels of S32_LE sound */
1580 1580
1581 /* printk("emufx.c: gpr=0x%x, tmp=0x%x\n",gpr, tmp); */ 1581 /*
1582 printk(KERN_DEBUG "emufx.c: gpr=0x%x, tmp=0x%x\n",
1583 gpr, tmp);
1584 */
1582 /* For the EMU1010: How to get 32bit values from the DSP. High 16bits into L, low 16bits into R. */ 1585 /* For the EMU1010: How to get 32bit values from the DSP. High 16bits into L, low 16bits into R. */
1583 /* A_P16VIN(0) is delayed by one sample, 1586 /* A_P16VIN(0) is delayed by one sample,
1584 * so all other A_P16VIN channels will need to also be delayed 1587 * so all other A_P16VIN channels will need to also be delayed
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index cf9276ddad42..78f62fd404c2 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -44,7 +44,7 @@ static void snd_emu10k1_pcm_interrupt(struct snd_emu10k1 *emu,
44 if (epcm->substream == NULL) 44 if (epcm->substream == NULL)
45 return; 45 return;
46#if 0 46#if 0
47 printk("IRQ: position = 0x%x, period = 0x%x, size = 0x%x\n", 47 printk(KERN_DEBUG "IRQ: position = 0x%x, period = 0x%x, size = 0x%x\n",
48 epcm->substream->runtime->hw->pointer(emu, epcm->substream), 48 epcm->substream->runtime->hw->pointer(emu, epcm->substream),
49 snd_pcm_lib_period_bytes(epcm->substream), 49 snd_pcm_lib_period_bytes(epcm->substream),
50 snd_pcm_lib_buffer_bytes(epcm->substream)); 50 snd_pcm_lib_buffer_bytes(epcm->substream));
@@ -146,7 +146,11 @@ static int snd_emu10k1_pcm_channel_alloc(struct snd_emu10k1_pcm * epcm, int voic
146 1, 146 1,
147 &epcm->extra); 147 &epcm->extra);
148 if (err < 0) { 148 if (err < 0) {
149 /* printk("pcm_channel_alloc: failed extra: voices=%d, frame=%d\n", voices, frame); */ 149 /*
150 printk(KERN_DEBUG "pcm_channel_alloc: "
151 "failed extra: voices=%d, frame=%d\n",
152 voices, frame);
153 */
150 for (i = 0; i < voices; i++) { 154 for (i = 0; i < voices; i++) {
151 snd_emu10k1_voice_free(epcm->emu, epcm->voices[i]); 155 snd_emu10k1_voice_free(epcm->emu, epcm->voices[i]);
152 epcm->voices[i] = NULL; 156 epcm->voices[i] = NULL;
@@ -737,7 +741,10 @@ static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream,
737 struct snd_emu10k1_pcm_mixer *mix; 741 struct snd_emu10k1_pcm_mixer *mix;
738 int result = 0; 742 int result = 0;
739 743
740 /* printk("trigger - emu10k1 = 0x%x, cmd = %i, pointer = %i\n", (int)emu, cmd, substream->ops->pointer(substream)); */ 744 /*
745 printk(KERN_DEBUG "trigger - emu10k1 = 0x%x, cmd = %i, pointer = %i\n",
746 (int)emu, cmd, substream->ops->pointer(substream))
747 */
741 spin_lock(&emu->reg_lock); 748 spin_lock(&emu->reg_lock);
742 switch (cmd) { 749 switch (cmd) {
743 case SNDRV_PCM_TRIGGER_START: 750 case SNDRV_PCM_TRIGGER_START:
@@ -786,7 +793,10 @@ static int snd_emu10k1_capture_trigger(struct snd_pcm_substream *substream,
786 /* hmm this should cause full and half full interrupt to be raised? */ 793 /* hmm this should cause full and half full interrupt to be raised? */
787 outl(epcm->capture_ipr, emu->port + IPR); 794 outl(epcm->capture_ipr, emu->port + IPR);
788 snd_emu10k1_intr_enable(emu, epcm->capture_inte); 795 snd_emu10k1_intr_enable(emu, epcm->capture_inte);
789 /* printk("adccr = 0x%x, adcbs = 0x%x\n", epcm->adccr, epcm->adcbs); */ 796 /*
797 printk(KERN_DEBUG "adccr = 0x%x, adcbs = 0x%x\n",
798 epcm->adccr, epcm->adcbs);
799 */
790 switch (epcm->type) { 800 switch (epcm->type) {
791 case CAPTURE_AC97ADC: 801 case CAPTURE_AC97ADC:
792 snd_emu10k1_ptr_write(emu, ADCCR, 0, epcm->capture_cr_val); 802 snd_emu10k1_ptr_write(emu, ADCCR, 0, epcm->capture_cr_val);
@@ -857,7 +867,11 @@ static snd_pcm_uframes_t snd_emu10k1_playback_pointer(struct snd_pcm_substream *
857 ptr -= runtime->buffer_size; 867 ptr -= runtime->buffer_size;
858 } 868 }
859#endif 869#endif
860 /* printk("ptr = 0x%x, buffer_size = 0x%x, period_size = 0x%x\n", ptr, runtime->buffer_size, runtime->period_size); */ 870 /*
871 printk(KERN_DEBUG
872 "ptr = 0x%x, buffer_size = 0x%x, period_size = 0x%x\n",
873 ptr, runtime->buffer_size, runtime->period_size);
874 */
861 return ptr; 875 return ptr;
862} 876}
863 877
@@ -1546,7 +1560,11 @@ static void snd_emu10k1_fx8010_playback_tram_poke1(unsigned short *dst_left,
1546 unsigned int count, 1560 unsigned int count,
1547 unsigned int tram_shift) 1561 unsigned int tram_shift)
1548{ 1562{
1549 /* printk("tram_poke1: dst_left = 0x%p, dst_right = 0x%p, src = 0x%p, count = 0x%x\n", dst_left, dst_right, src, count); */ 1563 /*
1564 printk(KERN_DEBUG "tram_poke1: dst_left = 0x%p, dst_right = 0x%p, "
1565 "src = 0x%p, count = 0x%x\n",
1566 dst_left, dst_right, src, count);
1567 */
1550 if ((tram_shift & 1) == 0) { 1568 if ((tram_shift & 1) == 0) {
1551 while (count--) { 1569 while (count--) {
1552 *dst_left-- = *src++; 1570 *dst_left-- = *src++;
@@ -1623,7 +1641,12 @@ static int snd_emu10k1_fx8010_playback_prepare(struct snd_pcm_substream *substre
1623 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number]; 1641 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
1624 unsigned int i; 1642 unsigned int i;
1625 1643
1626 /* printk("prepare: etram_pages = 0x%p, dma_area = 0x%x, buffer_size = 0x%x (0x%x)\n", emu->fx8010.etram_pages, runtime->dma_area, runtime->buffer_size, runtime->buffer_size << 2); */ 1644 /*
1645 printk(KERN_DEBUG "prepare: etram_pages = 0x%p, dma_area = 0x%x, "
1646 "buffer_size = 0x%x (0x%x)\n",
1647 emu->fx8010.etram_pages, runtime->dma_area,
1648 runtime->buffer_size, runtime->buffer_size << 2);
1649 */
1627 memset(&pcm->pcm_rec, 0, sizeof(pcm->pcm_rec)); 1650 memset(&pcm->pcm_rec, 0, sizeof(pcm->pcm_rec));
1628 pcm->pcm_rec.hw_buffer_size = pcm->buffer_size * 2; /* byte size */ 1651 pcm->pcm_rec.hw_buffer_size = pcm->buffer_size * 2; /* byte size */
1629 pcm->pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); 1652 pcm->pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c
index b5a802bdeb7c..4bfc31d1b281 100644
--- a/sound/pci/emu10k1/io.c
+++ b/sound/pci/emu10k1/io.c
@@ -226,7 +226,9 @@ int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu,
226 break; 226 break;
227 227
228 if (timeout > 1000) { 228 if (timeout > 1000) {
229 snd_printk("emu10k1:I2C:timeout status=0x%x\n", status); 229 snd_printk(KERN_WARNING
230 "emu10k1:I2C:timeout status=0x%x\n",
231 status);
230 break; 232 break;
231 } 233 }
232 } 234 }
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c
index 749a21b6bd06..e617acaf10e3 100644
--- a/sound/pci/emu10k1/p16v.c
+++ b/sound/pci/emu10k1/p16v.c
@@ -168,7 +168,7 @@ static void snd_p16v_pcm_free_substream(struct snd_pcm_runtime *runtime)
168 struct snd_emu10k1_pcm *epcm = runtime->private_data; 168 struct snd_emu10k1_pcm *epcm = runtime->private_data;
169 169
170 if (epcm) { 170 if (epcm) {
171 //snd_printk("epcm free: %p\n", epcm); 171 /* snd_printk(KERN_DEBUG "epcm free: %p\n", epcm); */
172 kfree(epcm); 172 kfree(epcm);
173 } 173 }
174} 174}
@@ -183,14 +183,16 @@ static int snd_p16v_pcm_open_playback_channel(struct snd_pcm_substream *substrea
183 int err; 183 int err;
184 184
185 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 185 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
186 //snd_printk("epcm kcalloc: %p\n", epcm); 186 /* snd_printk(KERN_DEBUG "epcm kcalloc: %p\n", epcm); */
187 187
188 if (epcm == NULL) 188 if (epcm == NULL)
189 return -ENOMEM; 189 return -ENOMEM;
190 epcm->emu = emu; 190 epcm->emu = emu;
191 epcm->substream = substream; 191 epcm->substream = substream;
192 //snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id); 192 /*
193 193 snd_printk(KERN_DEBUG "epcm device=%d, channel_id=%d\n",
194 substream->pcm->device, channel_id);
195 */
194 runtime->private_data = epcm; 196 runtime->private_data = epcm;
195 runtime->private_free = snd_p16v_pcm_free_substream; 197 runtime->private_free = snd_p16v_pcm_free_substream;
196 198
@@ -200,10 +202,15 @@ static int snd_p16v_pcm_open_playback_channel(struct snd_pcm_substream *substrea
200 channel->number = channel_id; 202 channel->number = channel_id;
201 203
202 channel->use=1; 204 channel->use=1;
203 //snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use); 205#if 0 /* debug */
204 //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); 206 snd_printk(KERN_DEBUG
205 //channel->interrupt = snd_p16v_pcm_channel_interrupt; 207 "p16v: open channel_id=%d, channel=%p, use=0x%x\n",
206 channel->epcm=epcm; 208 channel_id, channel, channel->use);
209 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n",
210 channel_id, chip, channel);
211#endif /* debug */
212 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
213 channel->epcm = epcm;
207 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 214 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
208 return err; 215 return err;
209 216
@@ -224,14 +231,16 @@ static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream
224 int err; 231 int err;
225 232
226 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 233 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
227 //snd_printk("epcm kcalloc: %p\n", epcm); 234 /* snd_printk(KERN_DEBUG "epcm kcalloc: %p\n", epcm); */
228 235
229 if (epcm == NULL) 236 if (epcm == NULL)
230 return -ENOMEM; 237 return -ENOMEM;
231 epcm->emu = emu; 238 epcm->emu = emu;
232 epcm->substream = substream; 239 epcm->substream = substream;
233 //snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id); 240 /*
234 241 snd_printk(KERN_DEBUG "epcm device=%d, channel_id=%d\n",
242 substream->pcm->device, channel_id);
243 */
235 runtime->private_data = epcm; 244 runtime->private_data = epcm;
236 runtime->private_free = snd_p16v_pcm_free_substream; 245 runtime->private_free = snd_p16v_pcm_free_substream;
237 246
@@ -241,10 +250,15 @@ static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream
241 channel->number = channel_id; 250 channel->number = channel_id;
242 251
243 channel->use=1; 252 channel->use=1;
244 //snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use); 253#if 0 /* debug */
245 //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); 254 snd_printk(KERN_DEBUG
246 //channel->interrupt = snd_p16v_pcm_channel_interrupt; 255 "p16v: open channel_id=%d, channel=%p, use=0x%x\n",
247 channel->epcm=epcm; 256 channel_id, channel, channel->use);
257 printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n",
258 channel_id, chip, channel);
259#endif /* debug */
260 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
261 channel->epcm = epcm;
248 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 262 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
249 return err; 263 return err;
250 264
@@ -334,9 +348,19 @@ static int snd_p16v_pcm_prepare_playback(struct snd_pcm_substream *substream)
334 int i; 348 int i;
335 u32 tmp; 349 u32 tmp;
336 350
337 //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); 351#if 0 /* debug */
338 //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); 352 snd_printk(KERN_DEBUG "prepare:channel_number=%d, rate=%d, "
339 //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->p16v_buffer.addr, emu->p16v_buffer.area, emu->p16v_buffer.bytes); 353 "format=0x%x, channels=%d, buffer_size=%ld, "
354 "period_size=%ld, periods=%u, frames_to_bytes=%d\n",
355 channel, runtime->rate, runtime->format, runtime->channels,
356 runtime->buffer_size, runtime->period_size,
357 runtime->periods, frames_to_bytes(runtime, 1));
358 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, table_base=%p\n",
359 runtime->dma_addr, runtime->dma_area, table_base);
360 snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",
361 emu->p16v_buffer.addr, emu->p16v_buffer.area,
362 emu->p16v_buffer.bytes);
363#endif /* debug */
340 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); 364 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel);
341 switch (runtime->rate) { 365 switch (runtime->rate) {
342 case 44100: 366 case 44100:
@@ -379,7 +403,15 @@ static int snd_p16v_pcm_prepare_capture(struct snd_pcm_substream *substream)
379 struct snd_pcm_runtime *runtime = substream->runtime; 403 struct snd_pcm_runtime *runtime = substream->runtime;
380 int channel = substream->pcm->device - emu->p16v_device_offset; 404 int channel = substream->pcm->device - emu->p16v_device_offset;
381 u32 tmp; 405 u32 tmp;
382 //printk("prepare capture:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1)); 406
407 /*
408 printk(KERN_DEBUG "prepare capture:channel_number=%d, rate=%d, "
409 "format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, "
410 "frames_to_bytes=%d\n",
411 channel, runtime->rate, runtime->format, runtime->channels,
412 runtime->buffer_size, runtime->period_size,
413 frames_to_bytes(runtime, 1));
414 */
383 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); 415 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel);
384 switch (runtime->rate) { 416 switch (runtime->rate) {
385 case 44100: 417 case 44100:
@@ -459,13 +491,13 @@ static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream,
459 runtime = s->runtime; 491 runtime = s->runtime;
460 epcm = runtime->private_data; 492 epcm = runtime->private_data;
461 channel = substream->pcm->device-emu->p16v_device_offset; 493 channel = substream->pcm->device-emu->p16v_device_offset;
462 //snd_printk("p16v channel=%d\n",channel); 494 /* snd_printk(KERN_DEBUG "p16v channel=%d\n", channel); */
463 epcm->running = running; 495 epcm->running = running;
464 basic |= (0x1<<channel); 496 basic |= (0x1<<channel);
465 inte |= (INTE2_PLAYBACK_CH_0_LOOP<<channel); 497 inte |= (INTE2_PLAYBACK_CH_0_LOOP<<channel);
466 snd_pcm_trigger_done(s, substream); 498 snd_pcm_trigger_done(s, substream);
467 } 499 }
468 //snd_printk("basic=0x%x, inte=0x%x\n",basic, inte); 500 /* snd_printk(KERN_DEBUG "basic=0x%x, inte=0x%x\n", basic, inte); */
469 501
470 switch (cmd) { 502 switch (cmd) {
471 case SNDRV_PCM_TRIGGER_START: 503 case SNDRV_PCM_TRIGGER_START:
@@ -558,8 +590,13 @@ snd_p16v_pcm_pointer_capture(struct snd_pcm_substream *substream)
558 ptr -= runtime->buffer_size; 590 ptr -= runtime->buffer_size;
559 printk(KERN_WARNING "buffer capture limited!\n"); 591 printk(KERN_WARNING "buffer capture limited!\n");
560 } 592 }
561 //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); 593 /*
562 594 printk(KERN_DEBUG "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, "
595 "buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n",
596 ptr1, ptr2, ptr, (int)runtime->buffer_size,
597 (int)runtime->period_size, (int)runtime->frame_bits,
598 (int)runtime->rate);
599 */
563 return ptr; 600 return ptr;
564} 601}
565 602
@@ -592,7 +629,10 @@ int snd_p16v_free(struct snd_emu10k1 *chip)
592 // release the data 629 // release the data
593 if (chip->p16v_buffer.area) { 630 if (chip->p16v_buffer.area) {
594 snd_dma_free_pages(&chip->p16v_buffer); 631 snd_dma_free_pages(&chip->p16v_buffer);
595 //snd_printk("period lables free: %p\n", &chip->p16v_buffer); 632 /*
633 snd_printk(KERN_DEBUG "period lables free: %p\n",
634 &chip->p16v_buffer);
635 */
596 } 636 }
597 return 0; 637 return 0;
598} 638}
@@ -604,7 +644,7 @@ int __devinit snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm *
604 int err; 644 int err;
605 int capture=1; 645 int capture=1;
606 646
607 //snd_printk("snd_p16v_pcm called. device=%d\n", device); 647 /* snd_printk("KERN_DEBUG snd_p16v_pcm called. device=%d\n", device); */
608 emu->p16v_device_offset = device; 648 emu->p16v_device_offset = device;
609 if (rpcm) 649 if (rpcm)
610 *rpcm = NULL; 650 *rpcm = NULL;
@@ -631,7 +671,10 @@ int __devinit snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm *
631 snd_dma_pci_data(emu->pci), 671 snd_dma_pci_data(emu->pci),
632 ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0) 672 ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0)
633 return err; 673 return err;
634 //snd_printk("preallocate playback substream: err=%d\n", err); 674 /*
675 snd_printk(KERN_DEBUG
676 "preallocate playback substream: err=%d\n", err);
677 */
635 } 678 }
636 679
637 for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; 680 for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
@@ -642,7 +685,10 @@ int __devinit snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm *
642 snd_dma_pci_data(emu->pci), 685 snd_dma_pci_data(emu->pci),
643 65536 - 64, 65536 - 64)) < 0) 686 65536 - 64, 65536 - 64)) < 0)
644 return err; 687 return err;
645 //snd_printk("preallocate capture substream: err=%d\n", err); 688 /*
689 snd_printk(KERN_DEBUG
690 "preallocate capture substream: err=%d\n", err);
691 */
646 } 692 }
647 693
648 if (rpcm) 694 if (rpcm)
diff --git a/sound/pci/emu10k1/voice.c b/sound/pci/emu10k1/voice.c
index d7300a1aa262..20b8da250bd0 100644
--- a/sound/pci/emu10k1/voice.c
+++ b/sound/pci/emu10k1/voice.c
@@ -53,7 +53,10 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
53 *rvoice = NULL; 53 *rvoice = NULL;
54 first_voice = last_voice = 0; 54 first_voice = last_voice = 0;
55 for (i = emu->next_free_voice, j = 0; j < NUM_G ; i += number, j += number) { 55 for (i = emu->next_free_voice, j = 0; j < NUM_G ; i += number, j += number) {
56 // printk("i %d j %d next free %d!\n", i, j, emu->next_free_voice); 56 /*
57 printk(KERN_DEBUG "i %d j %d next free %d!\n",
58 i, j, emu->next_free_voice);
59 */
57 i %= NUM_G; 60 i %= NUM_G;
58 61
59 /* stereo voices must be even/odd */ 62 /* stereo voices must be even/odd */
@@ -71,7 +74,7 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
71 } 74 }
72 } 75 }
73 if (!skip) { 76 if (!skip) {
74 // printk("allocated voice %d\n", i); 77 /* printk(KERN_DEBUG "allocated voice %d\n", i); */
75 first_voice = i; 78 first_voice = i;
76 last_voice = (i + number) % NUM_G; 79 last_voice = (i + number) % NUM_G;
77 emu->next_free_voice = last_voice; 80 emu->next_free_voice = last_voice;
@@ -84,7 +87,10 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
84 87
85 for (i = 0; i < number; i++) { 88 for (i = 0; i < number; i++) {
86 voice = &emu->voices[(first_voice + i) % NUM_G]; 89 voice = &emu->voices[(first_voice + i) % NUM_G];
87 // printk("voice alloc - %i, %i of %i\n", voice->number, idx-first_voice+1, number); 90 /*
91 printk(kERN_DEBUG "voice alloc - %i, %i of %i\n",
92 voice->number, idx-first_voice+1, number);
93 */
88 voice->use = 1; 94 voice->use = 1;
89 switch (type) { 95 switch (type) {
90 case EMU10K1_PCM: 96 case EMU10K1_PCM: