diff options
author | Eliot Blennerhassett <eblennerhassett@audioscience.com> | 2011-12-21 19:38:33 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-12-22 02:12:58 -0500 |
commit | c382a5da5cda3e0d8a8f2e8809460285d0a7c1cb (patch) | |
tree | fbfb3208ad1b616d9103330237117bd52c85f91e /sound/pci | |
parent | 40818b6242513676c8adf30811fb7877b02005fb (diff) |
ALSA: asihpi - Low latency mode stream has fixed channel count.
Unlike other streams which support 1..max channels,
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/asihpi/asihpi.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index 1ba50e369296..44e6ef3e99cc 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c | |||
@@ -135,6 +135,8 @@ struct snd_card_asihpi { | |||
135 | u16 update_interval_frames; | 135 | u16 update_interval_frames; |
136 | u16 in_max_chans; | 136 | u16 in_max_chans; |
137 | u16 out_max_chans; | 137 | u16 out_max_chans; |
138 | u16 in_min_chans; | ||
139 | u16 out_min_chans; | ||
138 | }; | 140 | }; |
139 | 141 | ||
140 | /* Per stream data */ | 142 | /* Per stream data */ |
@@ -968,8 +970,6 @@ static void snd_card_asihpi_playback_format(struct snd_card_asihpi *asihpi, | |||
968 | } | 970 | } |
969 | 971 | ||
970 | static struct snd_pcm_hardware snd_card_asihpi_playback = { | 972 | static struct snd_pcm_hardware snd_card_asihpi_playback = { |
971 | .channels_min = 1, | ||
972 | .channels_max = 2, | ||
973 | .buffer_bytes_max = BUFFER_BYTES_MAX, | 973 | .buffer_bytes_max = BUFFER_BYTES_MAX, |
974 | .period_bytes_min = PERIOD_BYTES_MIN, | 974 | .period_bytes_min = PERIOD_BYTES_MIN, |
975 | .period_bytes_max = BUFFER_BYTES_MAX / PERIODS_MIN, | 975 | .period_bytes_max = BUFFER_BYTES_MAX / PERIODS_MIN, |
@@ -1013,6 +1013,7 @@ static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream) | |||
1013 | runtime->private_free = snd_card_asihpi_runtime_free; | 1013 | runtime->private_free = snd_card_asihpi_runtime_free; |
1014 | 1014 | ||
1015 | snd_card_asihpi_playback.channels_max = card->out_max_chans; | 1015 | snd_card_asihpi_playback.channels_max = card->out_max_chans; |
1016 | snd_card_asihpi_playback.channels_min = card->out_min_chans; | ||
1016 | /*?snd_card_asihpi_playback.period_bytes_min = | 1017 | /*?snd_card_asihpi_playback.period_bytes_min = |
1017 | card->out_max_chans * 4096; */ | 1018 | card->out_max_chans * 4096; */ |
1018 | 1019 | ||
@@ -1150,8 +1151,6 @@ static void snd_card_asihpi_capture_format(struct snd_card_asihpi *asihpi, | |||
1150 | 1151 | ||
1151 | 1152 | ||
1152 | static struct snd_pcm_hardware snd_card_asihpi_capture = { | 1153 | static struct snd_pcm_hardware snd_card_asihpi_capture = { |
1153 | .channels_min = 1, | ||
1154 | .channels_max = 2, | ||
1155 | .buffer_bytes_max = BUFFER_BYTES_MAX, | 1154 | .buffer_bytes_max = BUFFER_BYTES_MAX, |
1156 | .period_bytes_min = PERIOD_BYTES_MIN, | 1155 | .period_bytes_min = PERIOD_BYTES_MIN, |
1157 | .period_bytes_max = BUFFER_BYTES_MAX / PERIODS_MIN, | 1156 | .period_bytes_max = BUFFER_BYTES_MAX / PERIODS_MIN, |
@@ -1193,6 +1192,7 @@ static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream) | |||
1193 | runtime->private_free = snd_card_asihpi_runtime_free; | 1192 | runtime->private_free = snd_card_asihpi_runtime_free; |
1194 | 1193 | ||
1195 | snd_card_asihpi_capture.channels_max = card->in_max_chans; | 1194 | snd_card_asihpi_capture.channels_max = card->in_max_chans; |
1195 | snd_card_asihpi_capture.channels_min = card->in_min_chans; | ||
1196 | snd_card_asihpi_capture_format(card, dpcm->h_stream, | 1196 | snd_card_asihpi_capture_format(card, dpcm->h_stream, |
1197 | &snd_card_asihpi_capture); | 1197 | &snd_card_asihpi_capture); |
1198 | snd_card_asihpi_pcm_samplerates(card, &snd_card_asihpi_capture); | 1198 | snd_card_asihpi_pcm_samplerates(card, &snd_card_asihpi_capture); |
@@ -2883,6 +2883,15 @@ static int __devinit snd_asihpi_probe(struct pci_dev *pci_dev, | |||
2883 | asihpi->out_max_chans = 2; | 2883 | asihpi->out_max_chans = 2; |
2884 | } | 2884 | } |
2885 | 2885 | ||
2886 | if (asihpi->out_max_chans > 2) { /* assume LL mode */ | ||
2887 | asihpi->out_min_chans = asihpi->out_max_chans; | ||
2888 | asihpi->in_min_chans = asihpi->in_max_chans; | ||
2889 | asihpi->support_grouping = 0; | ||
2890 | } else { | ||
2891 | asihpi->out_min_chans = 1; | ||
2892 | asihpi->in_min_chans = 1; | ||
2893 | } | ||
2894 | |||
2886 | snd_printk(KERN_INFO "has dma:%d, grouping:%d, mrx:%d\n", | 2895 | snd_printk(KERN_INFO "has dma:%d, grouping:%d, mrx:%d\n", |
2887 | asihpi->can_dma, | 2896 | asihpi->can_dma, |
2888 | asihpi->support_grouping, | 2897 | asihpi->support_grouping, |