diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-06-02 08:39:05 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-06-02 09:54:46 -0400 |
commit | d2b9b96c516d4d61663d92ab4ad4f15ca0134ef2 (patch) | |
tree | 08e1ade24ec6a110f625a8e184697d1db9284716 /sound/pci/ctxfi | |
parent | 8372d4980fbc2e403f0dc5457441c8c6b7c04915 (diff) |
ALSA: ctxfi - Fix supported PCM formats
The device seems supporting only U8, S16, S24_3LE, S32. Other linear
formats result in bad outputs.
Also, added the support for 32bit float format, which wasn't listed
in the original code.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi')
-rw-r--r-- | sound/pci/ctxfi/ctatc.c | 5 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctpcm.c | 15 |
2 files changed, 7 insertions, 13 deletions
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index 675dd4c8eaec..268ecc4c2856 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c | |||
@@ -170,16 +170,15 @@ static unsigned int convert_format(snd_pcm_format_t snd_format) | |||
170 | { | 170 | { |
171 | switch (snd_format) { | 171 | switch (snd_format) { |
172 | case SNDRV_PCM_FORMAT_U8: | 172 | case SNDRV_PCM_FORMAT_U8: |
173 | case SNDRV_PCM_FORMAT_S8: | ||
174 | return SRC_SF_U8; | 173 | return SRC_SF_U8; |
175 | case SNDRV_PCM_FORMAT_S16_LE: | 174 | case SNDRV_PCM_FORMAT_S16_LE: |
176 | case SNDRV_PCM_FORMAT_U16_LE: | ||
177 | return SRC_SF_S16; | 175 | return SRC_SF_S16; |
178 | case SNDRV_PCM_FORMAT_S24_3LE: | 176 | case SNDRV_PCM_FORMAT_S24_3LE: |
179 | return SRC_SF_S24; | 177 | return SRC_SF_S24; |
180 | case SNDRV_PCM_FORMAT_S24_LE: | ||
181 | case SNDRV_PCM_FORMAT_S32_LE: | 178 | case SNDRV_PCM_FORMAT_S32_LE: |
182 | return SRC_SF_S32; | 179 | return SRC_SF_S32; |
180 | case SNDRV_PCM_FORMAT_FLOAT_LE: | ||
181 | return SRC_SF_F32; | ||
183 | default: | 182 | default: |
184 | printk(KERN_ERR "ctxfi: not recognized snd format is %d \n", | 183 | printk(KERN_ERR "ctxfi: not recognized snd format is %d \n", |
185 | snd_format); | 184 | snd_format); |
diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c index 756d8b2776b3..26d86dc35e52 100644 --- a/sound/pci/ctxfi/ctpcm.c +++ b/sound/pci/ctxfi/ctpcm.c | |||
@@ -26,12 +26,10 @@ static struct snd_pcm_hardware ct_pcm_playback_hw = { | |||
26 | SNDRV_PCM_INFO_MMAP_VALID | | 26 | SNDRV_PCM_INFO_MMAP_VALID | |
27 | SNDRV_PCM_INFO_PAUSE), | 27 | SNDRV_PCM_INFO_PAUSE), |
28 | .formats = (SNDRV_PCM_FMTBIT_U8 | | 28 | .formats = (SNDRV_PCM_FMTBIT_U8 | |
29 | SNDRV_PCM_FMTBIT_S8 | | ||
30 | SNDRV_PCM_FMTBIT_S16_LE | | 29 | SNDRV_PCM_FMTBIT_S16_LE | |
31 | SNDRV_PCM_FMTBIT_U16_LE | | ||
32 | SNDRV_PCM_FMTBIT_S24_3LE | | 30 | SNDRV_PCM_FMTBIT_S24_3LE | |
33 | SNDRV_PCM_FMTBIT_S24_LE | | 31 | SNDRV_PCM_FMTBIT_S32_LE | |
34 | SNDRV_PCM_FMTBIT_S32_LE), | 32 | SNDRV_PCM_FMTBIT_FLOAT_LE), |
35 | .rates = (SNDRV_PCM_RATE_CONTINUOUS | | 33 | .rates = (SNDRV_PCM_RATE_CONTINUOUS | |
36 | SNDRV_PCM_RATE_8000_192000), | 34 | SNDRV_PCM_RATE_8000_192000), |
37 | .rate_min = 8000, | 35 | .rate_min = 8000, |
@@ -52,8 +50,7 @@ static struct snd_pcm_hardware ct_spdif_passthru_playback_hw = { | |||
52 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 50 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
53 | SNDRV_PCM_INFO_MMAP_VALID | | 51 | SNDRV_PCM_INFO_MMAP_VALID | |
54 | SNDRV_PCM_INFO_PAUSE), | 52 | SNDRV_PCM_INFO_PAUSE), |
55 | .formats = (SNDRV_PCM_FMTBIT_S16_LE | | 53 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
56 | SNDRV_PCM_FMTBIT_U16_LE), | ||
57 | .rates = (SNDRV_PCM_RATE_48000 | | 54 | .rates = (SNDRV_PCM_RATE_48000 | |
58 | SNDRV_PCM_RATE_44100 | | 55 | SNDRV_PCM_RATE_44100 | |
59 | SNDRV_PCM_RATE_32000), | 56 | SNDRV_PCM_RATE_32000), |
@@ -77,12 +74,10 @@ static struct snd_pcm_hardware ct_pcm_capture_hw = { | |||
77 | SNDRV_PCM_INFO_PAUSE | | 74 | SNDRV_PCM_INFO_PAUSE | |
78 | SNDRV_PCM_INFO_MMAP_VALID), | 75 | SNDRV_PCM_INFO_MMAP_VALID), |
79 | .formats = (SNDRV_PCM_FMTBIT_U8 | | 76 | .formats = (SNDRV_PCM_FMTBIT_U8 | |
80 | SNDRV_PCM_FMTBIT_S8 | | ||
81 | SNDRV_PCM_FMTBIT_S16_LE | | 77 | SNDRV_PCM_FMTBIT_S16_LE | |
82 | SNDRV_PCM_FMTBIT_U16_LE | | ||
83 | SNDRV_PCM_FMTBIT_S24_3LE | | 78 | SNDRV_PCM_FMTBIT_S24_3LE | |
84 | SNDRV_PCM_FMTBIT_S24_LE | | 79 | SNDRV_PCM_FMTBIT_S32_LE | |
85 | SNDRV_PCM_FMTBIT_S32_LE), | 80 | SNDRV_PCM_FMTBIT_FLOAT_LE), |
86 | .rates = (SNDRV_PCM_RATE_CONTINUOUS | | 81 | .rates = (SNDRV_PCM_RATE_CONTINUOUS | |
87 | SNDRV_PCM_RATE_8000_96000), | 82 | SNDRV_PCM_RATE_8000_96000), |
88 | .rate_min = 8000, | 83 | .rate_min = 8000, |