Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Regression playing 24bit/96kHz audio on USB audio interface between 5.10.94 and 5.15.21
@ 2022-03-06 22:18 Ruud van Asseldonk
  2022-12-11 15:30 ` Ruud van Asseldonk
  0 siblings, 1 reply; 11+ messages in thread
From: Ruud van Asseldonk @ 2022-03-06 22:18 UTC (permalink / raw)
  To: alsa-devel

Hi,

I have a program that configures a Behringer UMC404HD 192k USB audio 
interface for playback as follows (pseudocode):

   snd_pcm_hw_params_set_channels(pcm, hwp, 2);
   snd_pcm_hw_params_set_format(pcm, hwp, SND_PCM_FORMAT_S24_3LE);
   snd_pcm_hw_params_set_access(pcm, hwp, SND_PCM_ACCESS_MMAP_INTERLEAVED);
   snd_pcm_hw_params_set_rate(pcm, hwp, val=96000, dir=0);
   snd_pcm_hw_params_set_period_size_near(pcm, hwp, val=513, dir=0);
   // If I confirm at this point with snd_pcm_hw_params_get_period_size,
   // I get back 513.
   snd_pcm_hw_params_set_buffer_size_near(pcm, hwp, val=2052);
   snd_pcm_hw_params(pcm, hwp);
   // If I confirm with snd_pcm_hw_params_get_buffer_size,
   // I get back 2052.

On Linux 5.10.94 (specifically Arch Linux ARM package 
linux-rpi-5.10.94-1), this succeeds, and I can play back audio just 
fine. On 5.15.21 (specifically linux-rpi-5.15.21-3), all the calls 
succeed apart from the last one, which returns EINVAL.

(My actual program is written in Rust and uses a Rust wrapper library 
for libasound, https://docs.rs/alsa/0.6.0/alsa/, but the calls should be 
the ones listed.)

I confirmed with snd_pcm_hw_params_test_format that the S24_3LE format 
is supported. On both kernels it is successful. I confirmed with 
snd_pcm_hw_params_test_rate that 96 kHz is supported. On both kernels it 
is successful. There are differences though. When I query these:

   snd_pcm_hw_params_get_period_size_min
   snd_pcm_hw_params_get_period_size_max
   snd_pcm_hw_params_get_buffer_size_min
   snd_pcm_hw_params_get_buffer_size_max

Then on 5.10.94 (the good version), I get:

   period size min/max: 12/32768, buffer size min/max: 24/65536

But on 5.15.21 (the bad version), I get:

   period size min/max: 13/71332, buffer size min/max: 26/142663

Also, after I set the period size to 513, if I then query the buffer 
size min/max, on 5.10.94 I get:

   buffer size min/max: 1026/65536

But on 5.15.21 I get:

   buffer size min/max: 1027/142663

In lsmod, snd_usb_audio shows up, and from lsusb -v, the UMC404HD 
appears to be a standard USB audio interface. The lsusb output is 
identical on both kernels.

Please let me know if there is anything I can do to help further 
diagnose the issue, or if I should report this elsewhere.

Kind regards,
Ruud van Asseldonk

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-01-02 16:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-06 22:18 Regression playing 24bit/96kHz audio on USB audio interface between 5.10.94 and 5.15.21 Ruud van Asseldonk
2022-12-11 15:30 ` Ruud van Asseldonk
2022-12-11 21:08   ` Geraldo Nascimento
2022-12-12  9:48     ` Thorsten Leemhuis
2022-12-12 12:41       ` Jaroslav Kysela
2022-12-30 18:42       ` Ruud van Asseldonk
2022-12-31 11:38         ` Ruud van Asseldonk
2022-12-31 12:03           ` Thorsten Leemhuis
2022-12-31 12:10           ` Jaroslav Kysela
2022-12-31 13:20             ` Takashi Iwai
2023-01-02 16:57               ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox