aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emuproc.c
diff options
context:
space:
mode:
authorJames Courtier-Dutton <James@superbug.co.uk>2005-04-09 17:38:25 -0400
committerJaroslav Kysela <perex@suse.cz>2005-05-29 03:58:49 -0400
commit001f758990d685e7023008763795f1970ef56614 (patch)
treee460f23636ebf2aa45e185b5936243400e8b68b4 /sound/pci/emu10k1/emuproc.c
parentdf34140a9c15d4be8833f7977dca277a03ab87b0 (diff)
[ALSA] Improve SPDIF playback via the P16V/CA0151 chip.
EMU10K1/EMU10K2 driver Although we can set 44100 as the output rate, the SPDIF can do it, but the Analog output cannot. The SPDIF has the bug, whereby the Left channel arrives one sample late, so although we don't do any resampling, it is not good for AC3 non-audio output. Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
Diffstat (limited to 'sound/pci/emu10k1/emuproc.c')
-rw-r--r--sound/pci/emu10k1/emuproc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c
index 187a4e60a5fe..356fb7104253 100644
--- a/sound/pci/emu10k1/emuproc.c
+++ b/sound/pci/emu10k1/emuproc.c
@@ -30,6 +30,7 @@
30#include <linux/init.h> 30#include <linux/init.h>
31#include <sound/core.h> 31#include <sound/core.h>
32#include <sound/emu10k1.h> 32#include <sound/emu10k1.h>
33#include "p16v.h"
33 34
34static void snd_emu10k1_proc_spdif_status(emu10k1_t * emu, 35static void snd_emu10k1_proc_spdif_status(emu10k1_t * emu,
35 snd_info_buffer_t * buffer, 36 snd_info_buffer_t * buffer,
@@ -62,6 +63,7 @@ static void snd_emu10k1_proc_spdif_status(emu10k1_t * emu,
62 63
63 if (rate_reg > 0) { 64 if (rate_reg > 0) {
64 rate = snd_emu10k1_ptr_read(emu, rate_reg, 0); 65 rate = snd_emu10k1_ptr_read(emu, rate_reg, 0);
66 snd_iprintf(buffer, "S/PDIF Valid : %s\n", rate & SRCS_SPDIFVALID ? "on" : "off");
65 snd_iprintf(buffer, "S/PDIF Locked : %s\n", rate & SRCS_SPDIFLOCKED ? "on" : "off"); 67 snd_iprintf(buffer, "S/PDIF Locked : %s\n", rate & SRCS_SPDIFLOCKED ? "on" : "off");
66 snd_iprintf(buffer, "Rate Locked : %s\n", rate & SRCS_RATELOCKED ? "on" : "off"); 68 snd_iprintf(buffer, "Rate Locked : %s\n", rate & SRCS_RATELOCKED ? "on" : "off");
67 /* From ((Rate * 48000 ) / 262144); */ 69 /* From ((Rate * 48000 ) / 262144); */
@@ -244,6 +246,21 @@ static void snd_emu10k1_proc_spdif_read(snd_info_entry_t *entry,
244#endif 246#endif
245} 247}
246 248
249static void snd_emu10k1_proc_rates_read(snd_info_entry_t *entry,
250 snd_info_buffer_t * buffer)
251{
252 static int samplerate[8] = { 44100, 48000, 96000, 192000, 4, 5, 6, 7 };
253 emu10k1_t *emu = entry->private_data;
254 unsigned int val, tmp, n;
255 val = snd_emu10k1_ptr20_read(emu, CAPTURE_RATE_STATUS, 0);
256 tmp = (val >> 16) & 0x8;
257 for (n=0;n<4;n++) {
258 tmp = val >> (16 + (n*4));
259 if (tmp & 0x8) snd_iprintf(buffer, "Channel %d: Rate=%d\n", n, samplerate[tmp & 0x7]);
260 else snd_iprintf(buffer, "Channel %d: No input\n", n);
261 }
262}
263
247static void snd_emu10k1_proc_acode_read(snd_info_entry_t *entry, 264static void snd_emu10k1_proc_acode_read(snd_info_entry_t *entry,
248 snd_info_buffer_t * buffer) 265 snd_info_buffer_t * buffer)
249{ 266{
@@ -540,6 +557,10 @@ int __devinit snd_emu10k1_proc_init(emu10k1_t * emu)
540 if (! snd_card_proc_new(emu->card, "spdif-in", &entry)) 557 if (! snd_card_proc_new(emu->card, "spdif-in", &entry))
541 snd_info_set_text_ops(entry, emu, 2048, snd_emu10k1_proc_spdif_read); 558 snd_info_set_text_ops(entry, emu, 2048, snd_emu10k1_proc_spdif_read);
542 } 559 }
560 if (emu->card_capabilities->ca0151_chip) {
561 if (! snd_card_proc_new(emu->card, "capture-rates", &entry))
562 snd_info_set_text_ops(entry, emu, 2048, snd_emu10k1_proc_rates_read);
563 }
543 564
544 if (! snd_card_proc_new(emu->card, "voices", &entry)) 565 if (! snd_card_proc_new(emu->card, "voices", &entry))
545 snd_info_set_text_ops(entry, emu, 2048, snd_emu10k1_proc_voices_read); 566 snd_info_set_text_ops(entry, emu, 2048, snd_emu10k1_proc_voices_read);