aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emupcm.c
diff options
context:
space:
mode:
authorPavel Hofman <dustin@seznam.cz>2007-06-11 06:21:20 -0400
committerJaroslav Kysela <perex@suse.cz>2007-07-20 05:11:27 -0400
commit13d457094bc364e942884266036fd1b2ab74308b (patch)
tree5f56fec1dc9b66a34ba705ac7694d45130750e88 /sound/pci/emu10k1/emupcm.c
parent15cc4458c5c93bd5a616410815d5d165f0fe0900 (diff)
[ALSA] emu10k1 - EMU 1212 with 16 capture channels
* adding 8 more 32-bit capture channels (total of 16) for emu1010 cards * adding some code comments and card details description Signed-off-by: Pavel Hofman <dustin@seznam.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/emu10k1/emupcm.c')
-rw-r--r--sound/pci/emu10k1/emupcm.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index ab4f5df5241b..eda5cb373ded 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -1233,24 +1233,26 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream)
1233 runtime->hw.rate_min = runtime->hw.rate_max = 48000; 1233 runtime->hw.rate_min = runtime->hw.rate_max = 48000;
1234 spin_lock_irq(&emu->reg_lock); 1234 spin_lock_irq(&emu->reg_lock);
1235 if (emu->card_capabilities->emu1010) { 1235 if (emu->card_capabilities->emu1010) {
1236 /* TODO 1236 /* Nb. of channels has been increased to 16 */
1237 /* TODO
1237 * SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE 1238 * SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE
1238 * SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | 1239 * SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
1239 * SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | 1240 * SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
1240 * SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 1241 * SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000
1241 * rate_min = 44100, 1242 * rate_min = 44100,
1242 * rate_max = 192000, 1243 * rate_max = 192000,
1243 * channels_min = 8, 1244 * channels_min = 16,
1244 * channels_max = 8, 1245 * channels_max = 16,
1245 * Need to add mixer control to fix sample rate 1246 * Need to add mixer control to fix sample rate
1246 * 1247 *
1247 * There are 16 mono channels of 16bits each. 1248 * There are 32 mono channels of 16bits each.
1248 * 24bit Audio uses 2x channels over 16bit 1249 * 24bit Audio uses 2x channels over 16bit
1249 * 96kHz uses 2x channels over 48kHz 1250 * 96kHz uses 2x channels over 48kHz
1250 * 192kHz uses 4x channels over 48kHz 1251 * 192kHz uses 4x channels over 48kHz
1251 * So, for 48kHz 24bit, one has 8 channels 1252 * So, for 48kHz 24bit, one has 16 channels
1252 * for 96kHz 24bit, one has 4 channels 1253 * for 96kHz 24bit, one has 8 channels
1253 * for 192kHz 24bit, one has 2 channels 1254 * for 192kHz 24bit, one has 4 channels
1255 *
1254 */ 1256 */
1255#if 1 1257#if 1
1256 switch (emu->emu1010.internal_clock) { 1258 switch (emu->emu1010.internal_clock) {
@@ -1258,13 +1260,15 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream)
1258 /* For 44.1kHz */ 1260 /* For 44.1kHz */
1259 runtime->hw.rates = SNDRV_PCM_RATE_44100; 1261 runtime->hw.rates = SNDRV_PCM_RATE_44100;
1260 runtime->hw.rate_min = runtime->hw.rate_max = 44100; 1262 runtime->hw.rate_min = runtime->hw.rate_max = 44100;
1261 runtime->hw.channels_min = runtime->hw.channels_max = 8; 1263 runtime->hw.channels_min =
1264 runtime->hw.channels_max = 16;
1262 break; 1265 break;
1263 case 1: 1266 case 1:
1264 /* For 48kHz */ 1267 /* For 48kHz */
1265 runtime->hw.rates = SNDRV_PCM_RATE_48000; 1268 runtime->hw.rates = SNDRV_PCM_RATE_48000;
1266 runtime->hw.rate_min = runtime->hw.rate_max = 48000; 1269 runtime->hw.rate_min = runtime->hw.rate_max = 48000;
1267 runtime->hw.channels_min = runtime->hw.channels_max = 8; 1270 runtime->hw.channels_min =
1271 runtime->hw.channels_max = 16;
1268 break; 1272 break;
1269 }; 1273 };
1270#endif 1274#endif
@@ -1282,7 +1286,7 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream)
1282#endif 1286#endif
1283 runtime->hw.formats = SNDRV_PCM_FMTBIT_S32_LE; 1287 runtime->hw.formats = SNDRV_PCM_FMTBIT_S32_LE;
1284 /* efx_voices_mask[0] is expected to be zero 1288 /* efx_voices_mask[0] is expected to be zero
1285 * efx_voices_mask[1] is expected to have 16bits set 1289 * efx_voices_mask[1] is expected to have 32bits set
1286 */ 1290 */
1287 } else { 1291 } else {
1288 runtime->hw.channels_min = runtime->hw.channels_max = 0; 1292 runtime->hw.channels_min = runtime->hw.channels_max = 0;
@@ -1787,11 +1791,24 @@ int __devinit snd_emu10k1_pcm_efx(struct snd_emu10k1 * emu, int device, struct s
1787 /* emu->efx_voices_mask[0] = FXWC_DEFAULTROUTE_C | FXWC_DEFAULTROUTE_A; */ 1791 /* emu->efx_voices_mask[0] = FXWC_DEFAULTROUTE_C | FXWC_DEFAULTROUTE_A; */
1788 if (emu->audigy) { 1792 if (emu->audigy) {
1789 emu->efx_voices_mask[0] = 0; 1793 emu->efx_voices_mask[0] = 0;
1790 emu->efx_voices_mask[1] = 0xffff; 1794 if (emu->card_capabilities->emu1010)
1795 /* Pavel Hofman - 32 voices will be used for
1796 * capture (write mode) -
1797 * each bit = corresponding voice
1798 */
1799 emu->efx_voices_mask[1] = 0xffffffff;
1800 else
1801 emu->efx_voices_mask[1] = 0xffff;
1791 } else { 1802 } else {
1792 emu->efx_voices_mask[0] = 0xffff0000; 1803 emu->efx_voices_mask[0] = 0xffff0000;
1793 emu->efx_voices_mask[1] = 0; 1804 emu->efx_voices_mask[1] = 0;
1794 } 1805 }
1806 /* For emu1010, the control has to set 32 upper bits (voices)
1807 * out of the 64 bits (voices) to true for the 16-channels capture
1808 * to work correctly. Correct A_FXWC2 initial value (0xffffffff)
1809 * is already defined but the snd_emu10k1_pcm_efx_voices_mask
1810 * control can override this register's value.
1811 */
1795 kctl = snd_ctl_new1(&snd_emu10k1_pcm_efx_voices_mask, emu); 1812 kctl = snd_ctl_new1(&snd_emu10k1_pcm_efx_voices_mask, emu);
1796 if (!kctl) 1813 if (!kctl)
1797 return -ENOMEM; 1814 return -ENOMEM;