[alsa-devel] [Alsa-Devel] Cannot combine audio devices with more than 64 channels

Takashi Iwai tiwai at suse.de
Thu Jan 26 17:12:40 CET 2017


On Thu, 26 Jan 2017 15:14:41 +0100,
Jörg Müller wrote:
> 
> I need to combine two HDSPe MADI FX cards to one virtual device. I
> have a working driver, which is alsa-compatible. I can select each
> single card in any alsa-compatible application and all channels work
> flawless.
> For combining the MADI FX cards to one virtual device, I created an
> .asoundrc with 194 inputs for each card. When I start that virtual
> device via
> jackd -R -d alsa -C madifx_record_all -P madifx_playback_all
> 
> I get this error:
> > creating alsa driver ...
> > madifx_playback_all|madifx_record_all|1024|2|48000|0|0|nomon|swmeter|-|32bit
> > jackd: pcm_multi.c:1060: snd_pcm_multi_open: Assertion `!slave_map[sidxs[i]][schannels[i]]' failed.
> 
> However, it works when I reduce the amount from 194 to 64 channels per
> card. I tried to use 128 channels per card, but that fails the same
> way. See my alsa-info here http://pastebin.com/4hq1B3wZ , which also
> includes the .asoundrc content.
> 
> I also found this, which might be related:
> https://ccrma.stanford.edu/mirrors/lalists/lad/2005/06/0202.html
> 
> To me, this looks like a bug. What do you think?

Yes, it's a bug, the multi plugin has some weird check with a static
table in the fixed size 64x64, and it overflowed.  It looks nothing
more like a sanity check, so we can get rid of it, I suppose.

Could you try the patch below?


thanks,

Takashi

---
diff --git a/src/pcm/pcm_multi.c b/src/pcm/pcm_multi.c
index c4b1fba32cac..991f8540b62e 100644
--- a/src/pcm/pcm_multi.c
+++ b/src/pcm/pcm_multi.c
@@ -1015,7 +1015,6 @@ int snd_pcm_multi_open(snd_pcm_t **pcmp, const char *name,
 	snd_pcm_multi_t *multi;
 	unsigned int i;
 	snd_pcm_stream_t stream;
-	char slave_map[64][64] = { { 0 } };
 	int err;
 
 	assert(pcmp);
@@ -1051,17 +1050,7 @@ int snd_pcm_multi_open(snd_pcm_t **pcmp, const char *name,
 		slave->channels_count = schannels_count[i];
 		slave->close_slave = close_slaves;
 	}
-	for (i = 0; i < channels_count; ++i) {
-		snd_pcm_multi_channel_t *bind = &multi->channels[i];
-		assert(sidxs[i] < (int)slaves_count);
-		assert(schannels[i] < schannels_count[sidxs[i]]);
-		bind->slave_idx = sidxs[i];
-		bind->slave_channel = schannels[i];
-		if (sidxs[i] < 0)
-			continue;
-		assert(!slave_map[sidxs[i]][schannels[i]]);
-		slave_map[sidxs[i]][schannels[i]] = 1;
-	}
+	
 	multi->channels_count = channels_count;
 
 	err = snd_pcm_new(&pcm, SND_PCM_TYPE_MULTI, name, stream,


More information about the Alsa-devel mailing list