aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>2011-02-23 05:43:10 -0500
committerTakashi Iwai <tiwai@suse.de>2011-02-23 09:43:05 -0500
commit88fabbfcc6d347555f9be04e3fe89e7a9c9a2a2d (patch)
tree48692b1e03b2f45b3684074e0d91b74bb73993ff
parent483cee77d2be6c22ef67ac8c6711e757d138a538 (diff)
ALSA: hdspm - Restrict channel count on RME AES/AES32
Without calling an appropriate rule, AES/AES32 cards would announce a theoretical channel count of 64 (HDSPM_MAX_CHANNELS), leading to the already known bug: [37422.640481] ------------[ cut here ]------------ [37422.640487] WARNING: at sound/pci/rme9652/hdspm.c:5449 snd_hdspm_ioctl+0x18f/0x202 [snd_hdspm]() [37422.640489] Hardware name: PRIMERGY RX100 S6 [37422.640490] BUG? (info->channel >= hdspm->max_channels_in) [37422.640492] Modules linked in: snd_hdspm snd_seq_midi ipmi_watchdog ipmi_poweroff ipmi_si ipmi_devintf ipmi_msghandler i2c_i801 e1000e snd_rawmidi power_meter [last unloaded: snd_hdspm] [37422.640501] Pid: 22231, comm: jackd Tainted: G D W 2.6.36-gentoo-r5 #5 [37422.640502] Call Trace: [37422.640508] [<ffffffff8103db3a>] warn_slowpath_common+0x80/0x98 [37422.640511] [<ffffffff8103dbe6>] warn_slowpath_fmt+0x41/0x43 [37422.640514] [<ffffffff81034306>] ? get_parent_ip+0x11/0x42 [37422.640518] [<ffffffffa0055763>] snd_hdspm_ioctl+0x18f/0x202 [snd_hdspm] [37422.640522] [<ffffffff813fd626>] snd_pcm_channel_info+0x73/0x7c [37422.640525] [<ffffffff814001e9>] snd_pcm_common_ioctl1+0x326/0xb01 [37422.640527] [<ffffffff81034306>] ? get_parent_ip+0x11/0x42 [37422.640531] [<ffffffff8105be6c>] ? __srcu_read_unlock+0x3b/0x59 [37422.640533] [<ffffffff81400bce>] snd_pcm_capture_ioctl1+0x20a/0x227 [37422.640537] [<ffffffff811e599c>] ? file_has_perm+0x90/0x9e [37422.640540] [<ffffffff81400c15>] snd_pcm_capture_ioctl+0x2a/0x2e [37422.640543] [<ffffffff810f2c69>] do_vfs_ioctl+0x404/0x453 [37422.640546] [<ffffffff810f2d09>] sys_ioctl+0x51/0x74 [37422.640549] [<ffffffff81002aab>] system_call_fastpath+0x16/0x1b [37422.640552] ---[ end trace 0cd919cd68118082 ]--- We already have all the right values in place, we simply have to inform the upper layers about this restriction. Note that snd_hdspm_hw_rule_rate_out_channels and snd_hdspm_hw_rule_rate_in_channels must not be called on AES32, because the channel count is always 16, no matter of the samplerate in use. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/rme9652/hdspm.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 509a35a881f5..17939b9713ea 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -5836,17 +5836,19 @@ static int snd_hdspm_playback_open(struct snd_pcm_substream *substream)
5836 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 5836 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
5837 &hdspm_hw_constraints_aes32_sample_rates); 5837 &hdspm_hw_constraints_aes32_sample_rates);
5838 } else { 5838 } else {
5839 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
5840 snd_hdspm_hw_rule_out_channels, hdspm,
5841 SNDRV_PCM_HW_PARAM_CHANNELS, -1);
5842 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
5843 snd_hdspm_hw_rule_out_channels_rate, hdspm,
5844 SNDRV_PCM_HW_PARAM_RATE, -1);
5845
5846 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 5839 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
5847 snd_hdspm_hw_rule_rate_out_channels, hdspm, 5840 snd_hdspm_hw_rule_rate_out_channels, hdspm,
5848 SNDRV_PCM_HW_PARAM_CHANNELS, -1); 5841 SNDRV_PCM_HW_PARAM_CHANNELS, -1);
5849 } 5842 }
5843
5844 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
5845 snd_hdspm_hw_rule_out_channels, hdspm,
5846 SNDRV_PCM_HW_PARAM_CHANNELS, -1);
5847
5848 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
5849 snd_hdspm_hw_rule_out_channels_rate, hdspm,
5850 SNDRV_PCM_HW_PARAM_RATE, -1);
5851
5850 return 0; 5852 return 0;
5851} 5853}
5852 5854
@@ -5904,17 +5906,19 @@ static int snd_hdspm_capture_open(struct snd_pcm_substream *substream)
5904 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 5906 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
5905 &hdspm_hw_constraints_aes32_sample_rates); 5907 &hdspm_hw_constraints_aes32_sample_rates);
5906 } else { 5908 } else {
5907 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
5908 snd_hdspm_hw_rule_in_channels, hdspm,
5909 SNDRV_PCM_HW_PARAM_CHANNELS, -1);
5910 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
5911 snd_hdspm_hw_rule_in_channels_rate, hdspm,
5912 SNDRV_PCM_HW_PARAM_RATE, -1);
5913
5914 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 5909 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
5915 snd_hdspm_hw_rule_rate_in_channels, hdspm, 5910 snd_hdspm_hw_rule_rate_in_channels, hdspm,
5916 SNDRV_PCM_HW_PARAM_CHANNELS, -1); 5911 SNDRV_PCM_HW_PARAM_CHANNELS, -1);
5917 } 5912 }
5913
5914 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
5915 snd_hdspm_hw_rule_in_channels, hdspm,
5916 SNDRV_PCM_HW_PARAM_CHANNELS, -1);
5917
5918 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
5919 snd_hdspm_hw_rule_in_channels_rate, hdspm,
5920 SNDRV_PCM_HW_PARAM_RATE, -1);
5921
5918 return 0; 5922 return 0;
5919} 5923}
5920 5924