aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/rme9652/hdspm.c
diff options
context:
space:
mode:
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>2011-02-23 05:43:08 -0500
committerTakashi Iwai <tiwai@suse.de>2011-02-23 09:42:15 -0500
commit432d2500ac11ca88532e08716813b189a27f74a9 (patch)
treee52997ceb99c02aceda2d22ef59ad5772d66472b /sound/pci/rme9652/hdspm.c
parent01cb7021584c4c70f7c5596ac2147b494a144053 (diff)
ALSA: hpdsm - RME AES(32): Fix missing channel mappings
On RME AES and AES(32), none of the required information (max_channels_in, max_channels_out, channel mappings, port names) was set, leading to the BUG below. This patch adds the missing bits, thus fixing the bug. 125.058768] ------------[ cut here ]------------ [ 125.058773] WARNING: at sound/pci/rme9652/hdspm.c:5389 snd_hdspm_ioctl+0x10c/0x1d8 [snd_hdspm]() [ 125.058775] Hardware name: PRIMERGY RX100 S6 [ 125.058777] BUG? (info->channel >= hdspm->max_channels_out) [ 125.058778] Modules linked in: ipmi_watchdog ipmi_poweroff ipmi_si ipmi_devintf ipmi_msghandler snd_hdspm power_meter e1000e snd_rawmidi i2c_i801 [ 125.058787] Pid: 3652, comm: audacity Tainted: G W 2.6.36-gentoo-r5 #5 [ 125.058788] Call Trace: [ 125.058792] [<ffffffff8103db3a>] warn_slowpath_common+0x80/0x98 [ 125.058796] [<ffffffff8103dbe6>] warn_slowpath_fmt+0x41/0x43 [ 125.058800] [<ffffffffa006761a>] snd_hdspm_ioctl+0x10c/0x1d8 [snd_hdspm] [ 125.058803] [<ffffffff813fd626>] snd_pcm_channel_info+0x73/0x7c [ 125.058806] [<ffffffff814001e9>] snd_pcm_common_ioctl1+0x326/0xb01 [ 125.058809] [<ffffffff810c604c>] ? __do_fault+0x361/0x3a6 [ 125.058812] [<ffffffff81400e23>] snd_pcm_playback_ioctl1+0x20a/0x227 [ 125.058815] [<ffffffff811e599c>] ? file_has_perm+0x90/0x9e [ 125.058818] [<ffffffff81400e6a>] snd_pcm_playback_ioctl+0x2a/0x2e [ 125.058821] [<ffffffff810f2c69>] do_vfs_ioctl+0x404/0x453 [ 125.058824] [<ffffffff810f2d09>] sys_ioctl+0x51/0x74 [ 125.058827] [<ffffffff81002aab>] system_call_fastpath+0x16/0x1b [ 125.058830] ---[ end trace 5bddb08e5d4cbeb1 ]--- Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Florian Faber <faber@faberman.de> Signed-off-by: Fredrik Lingvall <fredrik.lingvall@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/rme9652/hdspm.c')
-rw-r--r--sound/pci/rme9652/hdspm.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 6de88b0ce9f4..92588975f580 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -667,6 +667,12 @@ static char *texts_ports_aio_out_qs[] = {
667 "Phone.L", "Phone.R" 667 "Phone.L", "Phone.R"
668}; 668};
669 669
670static char *texts_ports_aes32[] = {
671 "AES.1", "AES.2", "AES.3", "AES.4", "AES.5", "AES.6", "AES.7",
672 "AES.8", "AES.9.", "AES.10", "AES.11", "AES.12", "AES.13", "AES.14",
673 "AES.15", "AES.16"
674};
675
670/* These tables map the ALSA channels 1..N to the channels that we 676/* These tables map the ALSA channels 1..N to the channels that we
671 need to use in order to find the relevant channel buffer. RME 677 need to use in order to find the relevant channel buffer. RME
672 refers to this kind of mapping as between "the ADAT channel and 678 refers to this kind of mapping as between "the ADAT channel and
@@ -816,6 +822,17 @@ static char channel_map_aio_out_qs[HDSPM_MAX_CHANNELS] = {
816 -1, -1, -1, -1, -1, -1, -1, -1 822 -1, -1, -1, -1, -1, -1, -1, -1
817}; 823};
818 824
825static char channel_map_aes32[HDSPM_MAX_CHANNELS] = {
826 0, 1, 2, 3, 4, 5, 6, 7,
827 8, 9, 10, 11, 12, 13, 14, 15,
828 -1, -1, -1, -1, -1, -1, -1, -1,
829 -1, -1, -1, -1, -1, -1, -1, -1,
830 -1, -1, -1, -1, -1, -1, -1, -1,
831 -1, -1, -1, -1, -1, -1, -1, -1,
832 -1, -1, -1, -1, -1, -1, -1, -1,
833 -1, -1, -1, -1, -1, -1, -1, -1
834};
835
819struct hdspm_midi { 836struct hdspm_midi {
820 struct hdspm *hdspm; 837 struct hdspm *hdspm;
821 int id; 838 int id;
@@ -6396,6 +6413,29 @@ static int __devinit snd_hdspm_create(struct snd_card *card,
6396 6413
6397 switch (hdspm->io_type) { 6414 switch (hdspm->io_type) {
6398 case AES32: 6415 case AES32:
6416 hdspm->ss_in_channels = hdspm->ss_out_channels = 16;
6417 hdspm->ds_in_channels = hdspm->ds_out_channels = 16;
6418 hdspm->qs_in_channels = hdspm->qs_out_channels = 16;
6419
6420 hdspm->channel_map_in_ss = hdspm->channel_map_out_ss =
6421 channel_map_aes32;
6422 hdspm->channel_map_in_ds = hdspm->channel_map_out_ds =
6423 channel_map_aes32;
6424 hdspm->channel_map_in_qs = hdspm->channel_map_out_qs =
6425 channel_map_aes32;
6426 hdspm->port_names_in_ss = hdspm->port_names_out_ss =
6427 texts_ports_aes32;
6428 hdspm->port_names_in_ds = hdspm->port_names_out_ds =
6429 texts_ports_aes32;
6430 hdspm->port_names_in_qs = hdspm->port_names_out_qs =
6431 texts_ports_aes32;
6432
6433 hdspm->max_channels_out = hdspm->max_channels_in = 16;
6434 hdspm->port_names_in = hdspm->port_names_out =
6435 texts_ports_aes32;
6436 hdspm->channel_map_in = hdspm->channel_map_out =
6437 channel_map_aes32;
6438
6399 break; 6439 break;
6400 6440
6401 case MADI: 6441 case MADI: