Skip to contentSkip to conversation

Fix 96000 SPDIF out from Audigy 2 P16V.

PATCH Applied James Courtier-Dutton 2 participants 2 messages Mar 19, 2005 – Mar 21, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix 96000 SPDIF out from Audigy 2 P16V.

This allows one to output at 96000 to the SPDIF using the P16V chip.
Note: The sample phase is wrong when using the P16V chip, but at least no resampling is done.

Signoff: James Courtier-Dutton

Index: alsa-driver/alsa-kernel/pci/emu10k1/p16v.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/p16v.c,v retrieving revision 1.1

alsa-kernel/pci/emu10k1/p16v.c +6 -4
diff -u -r1.1 p16v.c
@@ -229,22 +229,24 @@
 	u32 *table_base = (u32 *)(emu->p16v_buffer.area+(8*16*channel));
 	u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size);
 	int i;
+	u32 tmp;
 	
         //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));
         //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base);
 	//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);
+	tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel);
         switch (runtime->rate) {
 	case 44100:
-	  snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, 0x8000); /* FIXME: This will change the capture rate as well! */
+	  snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe000) | 0x8000); /* FIXME: This will change the capture rate as well! */
 	  break;
 	case 48000:
-	  snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, 0x1000); /* FIXME: This will change the capture rate as well! */
+	  snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe000) | 0x0000); /* FIXME: This will change the capture rate as well! */
 	  break;
 	case 96000:
-	  snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, 0x4000); /* FIXME: This will change the capture rate as well! */
+	  snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe000) | 0x4000); /* FIXME: This will change the capture rate as well! */
 	  break;
 	case 192000:
-	  snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, 0x2000); /* FIXME: This will change the capture rate as well! */
+	  snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe000) | 0x2000); /* FIXME: This will change the capture rate as well! */
 	  break;
 	default:
 	  snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, 0x0000); /* FIXME: This will change the capture rate as well! */
Applied
#1 lore raw

At Sat, 19 Mar 2005 16:02:13 +0000,

Quoted 6 lines · James Courtier-Dutton

This allows one to output at 96000 to the SPDIF using the P16V chip.
Note: The sample phase is wrong when using the P16V chip, but at least no resampling is done.

Signoff: James Courtier-Dutton

Applied to CVS. Thanks.

Takashi

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click