All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix 96000 SPDIF out from Audigy 2 P16V.
@ 2005-03-19 16:02 James Courtier-Dutton
  2005-03-21 19:52 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: James Courtier-Dutton @ 2005-03-19 16:02 UTC (permalink / raw)
  To: ALSA development

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

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

[-- Attachment #2: audigy2-fix-spdif-rates.diff.txt --]
[-- Type: text/plain, Size: 2522 bytes --]

Index: alsa-driver/alsa-kernel/pci/emu10k1/p16v.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/p16v.c,v
retrieving revision 1.1
diff -u -r1.1 p16v.c
--- alsa-driver/alsa-kernel/pci/emu10k1/p16v.c	13 Mar 2005 12:17:10 -0000	1.1
+++ alsa-driver/alsa-kernel/pci/emu10k1/p16v.c	19 Mar 2005 15:57:46 -0000
@@ -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! */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix 96000 SPDIF out from Audigy 2 P16V.
  2005-03-19 16:02 [PATCH] Fix 96000 SPDIF out from Audigy 2 P16V James Courtier-Dutton
@ 2005-03-21 19:52 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2005-03-21 19:52 UTC (permalink / raw)
  To: James Courtier-Dutton; +Cc: ALSA development

At Sat, 19 Mar 2005 16:02:13 +0000,
James Courtier-Dutton wrote:
> 
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-21 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-19 16:02 [PATCH] Fix 96000 SPDIF out from Audigy 2 P16V James Courtier-Dutton
2005-03-21 19:52 ` Takashi Iwai

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.