diff options
author | Timofei Bondarenko <tim@ipi.ac.ru> | 2007-11-07 09:50:52 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:19 -0500 |
commit | b46be727286a93056db851ababc85c0ac3f2f91c (patch) | |
tree | e403cbfca286ccb92d885b28f824650515ac9b4d /sound/pci/cmipci.c | |
parent | feb77712b0e780f04507cdda0529088ff0f3286f (diff) |
[ALSA] cmipci - allow capture of raw spdif subframes
Enable capturing of raw 32bit IEC958_SUBFRAME.
The 24-bits PCM data can be obtained using iec958 plugin.
Known problem: captured stream may begin with either left or right
subframe. Since the iec958 plugin doesn't decode preamble it may swap
the channels sometime.
Signed-off-by: Timofei Bondarenko <tim@ipi.ac.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/cmipci.c')
-rw-r--r-- | sound/pci/cmipci.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index d1f23ebed2ae..187203e55d39 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c | |||
@@ -1407,6 +1407,11 @@ static int snd_cmipci_capture_spdif_prepare(struct snd_pcm_substream *substream) | |||
1407 | else | 1407 | else |
1408 | snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_DBLSPDS); | 1408 | snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_DBLSPDS); |
1409 | } | 1409 | } |
1410 | if (snd_pcm_format_width(substream->runtime->format) > 16) | ||
1411 | snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_SPD32SEL); | ||
1412 | else | ||
1413 | snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_SPD32SEL); | ||
1414 | |||
1410 | spin_unlock_irq(&cm->reg_lock); | 1415 | spin_unlock_irq(&cm->reg_lock); |
1411 | 1416 | ||
1412 | return snd_cmipci_pcm_prepare(cm, &cm->channel[CM_CH_CAPT], substream); | 1417 | return snd_cmipci_pcm_prepare(cm, &cm->channel[CM_CH_CAPT], substream); |
@@ -1418,6 +1423,7 @@ static int snd_cmipci_capture_spdif_hw_free(struct snd_pcm_substream *subs) | |||
1418 | 1423 | ||
1419 | spin_lock_irq(&cm->reg_lock); | 1424 | spin_lock_irq(&cm->reg_lock); |
1420 | snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_CAPTURE_SPDF); | 1425 | snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_CAPTURE_SPDF); |
1426 | snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_SPD32SEL); | ||
1421 | spin_unlock_irq(&cm->reg_lock); | 1427 | spin_unlock_irq(&cm->reg_lock); |
1422 | 1428 | ||
1423 | return snd_cmipci_hw_free(subs); | 1429 | return snd_cmipci_hw_free(subs); |
@@ -1569,7 +1575,8 @@ static struct snd_pcm_hardware snd_cmipci_capture_spdif = | |||
1569 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 1575 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
1570 | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE | | 1576 | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE | |
1571 | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID), | 1577 | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID), |
1572 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 1578 | .formats = SNDRV_PCM_FMTBIT_S16_LE | |
1579 | SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE, | ||
1573 | .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, | 1580 | .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, |
1574 | .rate_min = 44100, | 1581 | .rate_min = 44100, |
1575 | .rate_max = 48000, | 1582 | .rate_max = 48000, |