All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jörg Müller" <joerg.mueller7744@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Clemens Ladisch <clemens@ladisch.de>
Subject: Re: Cannot combine audio devices with more than 64 channels
Date: Tue, 31 Jan 2017 18:18:48 +0100	[thread overview]
Message-ID: <CAKw=HF1kZ12YOUuBX0MmiyYsPqQ68kafP-cVmWA8FP0dHOAuDw@mail.gmail.com> (raw)
In-Reply-To: <s5hh94khiao.wl-tiwai@suse.de>

I applied the patch to my system and it fixed the error!

However, I get the following error which seems to be caused by a code
not being able to handle more than 256 channels:
> wfs@wfs16:~$ jackd -R -d alsa -C madifx_record_all -P madifx_playback_all
> jackdmp 1.9.10
> Copyright 2001-2005 Paul Davis and others.
> Copyright 2004-2014 Grame.
> jackdmp comes with ABSOLUTELY NO WARRANTY
> This is free software, and you are welcome to redistribute it
> under certain conditions; see the file COPYING for details
> no message buffer overruns
> no message buffer overruns
> no message buffer overruns
> JACK server starting in realtime mode with priority 10
> self-connect-mode is "Don't restrict self connect requests"
> audio_reservation_init
> Acquire audio card Audio0
> creating alsa driver ... madifx_playback_all|madifx_record_all|1024|2|48000|0|0|nomon|swmeter|-|32bit
> configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
> ALSA: final selected sample format for capture: 32bit float little-endian
> ALSA: use 8 periods for capture
> ALSA: final selected sample format for playback: 32bit float little-endian
> ALSA: use 8 periods for playback
> jackd: ../linux/alsa/JackAlsaDriver.cpp:122: virtual int Jack::JackAlsaDriver::Attach(): Assertion `fCaptureChannels < 256' failed.
> Aborted (core dumped)

What could be the problem here?

2017-01-27 12:08 GMT+01:00 Takashi Iwai <tiwai@suse.de>:
> On Thu, 26 Jan 2017 17:13:50 +0100,
> Clemens Ladisch wrote:
>>
>> Jörg Müller wrote:
>> > I created an .asoundrc with 194 inputs for each card.
>> >
>> > pcm_multi.c:1060: snd_pcm_multi_open: Assertion `!slave_map[sidxs[i]][schannels[i]]' failed.
>> >
>> > To me, this looks like a bug.
>>
>> --8<---------------------------------------------------------------->8--
>> pcm: multi: allocate slave_map dynamically
>>
>> Using a fixed-size buffer for an arbitrarily-sized list is not a good idea.
>>
>> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
>
> It turned out that we don't need the array at all.
> I'll apply the following cleanup (and fix) patch.  My previous one was
> buggy.
>
>
> thanks,
>
> Takashi
>
> -- 8< --
> From: Takashi Iwai <tiwai@suse.de>
> Subject: [PATCH] pcm: multi: Drop the fixed slave_map[] in snd_pcm_multi_open()
>
> slave_map[] in snd_pcm_multi_open() is a fixed size array and
> obviously we have no overflow check, and eventually the program gets
> an error when more than 64 channels are used.
>
> Although we can modify the code to allocate the array dynamically, it
> turned out that we can drop the whole slave_map[] thingy in this
> function when looking at the code closely.  In the past, it was used
> to identify the one-to-many mapping.  But the check was dropped, and
> now it's nothing more than a sanity check.
>
> Reported-by: Jörg Müller <joerg.mueller7744@gmail.com>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  src/pcm/pcm_multi.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/src/pcm/pcm_multi.c b/src/pcm/pcm_multi.c
> index c4b1fba32cac..9e4be7122c0f 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);
> @@ -1059,8 +1058,6 @@ int snd_pcm_multi_open(snd_pcm_t **pcmp, const char *name,
>                 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;
>
> --
> 2.11.0
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2017-01-31 17:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 14:14 [Alsa-Devel] Cannot combine audio devices with more than 64 channels Jörg Müller
2017-01-26 16:12 ` Takashi Iwai
2017-01-26 16:13 ` Clemens Ladisch
2017-01-27 11:08   ` Takashi Iwai
2017-01-27 13:03     ` Jörg Müller
2017-01-27 13:16       ` Takashi Iwai
2017-01-27 23:14         ` Takashi Sakamoto
2017-01-31 17:00           ` Jörg Müller
2017-01-27 20:25       ` John Rigg
2017-01-31 17:18     ` Jörg Müller [this message]
2017-01-31 17:58       ` John Rigg
2017-01-31 18:46       ` Takashi Iwai
     [not found]       ` <20170131193159.GA17070@localhost.localdomain>
2017-02-08 14:12         ` Jörg Müller
2017-02-08 16:12           ` John Rigg
2017-02-08 16:20           ` John Rigg
2017-02-08 16:31             ` John Rigg
2017-02-08 17:22               ` Jörg Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKw=HF1kZ12YOUuBX0MmiyYsPqQ68kafP-cVmWA8FP0dHOAuDw@mail.gmail.com' \
    --to=joerg.mueller7744@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.