[PATCH] ALSA: usb-audio: Increase max buffer size

Geraldo Nascimento geraldogabriel at gmail.com
Sat Apr 9 22:36:17 CEST 2022


On Thu, Apr 07, 2022 at 11:27:40PM +0200, Takashi Iwai wrote:
> The current limit of max buffer size 1MB seems too small for modern
> devices with lots of channels and high sample rates.
> Let's make bigger, 4MB.

Hi Takashi,

I did some math and 4MB is still too little for some extreme hardware
like the Behringer Wing, which is USB 2.0 by the way. According to my
calculations, at 192 KHz and 48 channels, even with this 4MB patch, we
would still have only 151.7 ms of buffer for the Wing.

Therefore my suggestion is to expose the MAX_BUFFER_BYTES as Kconf.

Do you think this is plausible?

Thanks,
Geraldo Nascimento

> 
> Signed-off-by: Takashi Iwai <tiwai at suse.de>
> ---
>  sound/usb/pcm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
> index 6a460225f2e3..37ee6df8b15a 100644
> --- a/sound/usb/pcm.c
> +++ b/sound/usb/pcm.c
> @@ -659,7 +659,7 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream)
>  #define hwc_debug(fmt, args...) do { } while(0)
>  #endif
>  
> -#define MAX_BUFFER_BYTES	(1024 * 1024)
> +#define MAX_BUFFER_BYTES	(4 * 1024 * 1024)
>  #define MAX_PERIOD_BYTES	(512 * 1024)
>  
>  static const struct snd_pcm_hardware snd_usb_hardware =
> -- 
> 2.31.1
> 


More information about the Alsa-devel mailing list