Update of /cvsroot/alsa/alsa-kernel/pci
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14145

Modified Files:
        via82xx.c 
Log Message:
restrict the PCM sample rates to 32, 44.1 and 48kHz when the SPDIF
switch is on.



Index: via82xx.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/via82xx.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- via82xx.c   6 Mar 2004 16:51:30 -0000       1.91
+++ via82xx.c   8 Mar 2004 10:37:06 -0000       1.92
@@ -382,6 +382,7 @@
        struct via_rate_lock rates[2]; /* playback and capture */
        unsigned int dxs_fixed: 1;      /* DXS channel accepts only 48kHz */
        unsigned int no_vra: 1;         /* no need to set VRA on DXS channels */
+       unsigned int spdif_on: 1;       /* only spdif rates work to external DACs */
 
        snd_rawmidi_t *rmidi;
 
@@ -1062,6 +1063,7 @@
                {48000, SNDRV_PCM_RATE_48000},
        };
        int i;
+       u8 val;
 
        runtime->hw = snd_via82xx_hw;
        
@@ -1069,7 +1071,11 @@
        ratep = &chip->rates[viadev->direction];
        spin_lock_irqsave(&ratep->lock, flags);
        ratep->used++;
-       if (chip->dxs_fixed && viadev->reg_offset < 0x40) {
+       if (chip->spdif_on) {
+               runtime->hw.rates = 
SNDRV_PCM_RATE_32000|SNDRV_PCM_RATE_44100|SNDRV_PCM_RATE_48000;
+               runtime->hw.rate_min = 32000;
+               runtime->hw.rate_max = 48000;
+       } else if (chip->dxs_fixed && viadev->reg_offset < 0x40) {
                /* fixed DXS playback rate */
                runtime->hw.rates = SNDRV_PCM_RATE_48000;
                runtime->hw.rate_min = runtime->hw.rate_max = 48000;
@@ -1429,6 +1435,8 @@
        spin_lock_irqsave(&chip->reg_lock, flags);
        oval = inb(port);
        val = oval & ~VIA_REG_CAPTURE_CHANNEL_MIC;
+       /* save the spdif flag for rate filtering */
+       chip->spdif_on = ucontrol->value.integer.value[0] ? 1 : 0;
        if (ucontrol->value.enumerated.item[0])
                val |= VIA_REG_CAPTURE_CHANNEL_MIC;
        if (val != oval)



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to