ChangeSet 1.2181.25.33, 2005/03/22 09:16:48+01:00, [EMAIL PROTECTED]

        [ALSA] Fix 96000 SPDIF out from Audigy 2 P16V
        
        EMU10K1/EMU10K2 driver
        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.
        
        Signed-off-by: James Courtier-Dutton
        Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>



 p16v.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


diff -Nru a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c
--- a/sound/pci/emu10k1/p16v.c  2005-03-30 16:16:14 -08:00
+++ b/sound/pci/emu10k1/p16v.c  2005-03-30 16:16:14 -08:00
@@ -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! */
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to