Regression playing 24bit/96kHz audio on USB audio interface between 5.10.94 and 5.15.21

Jaroslav Kysela perex at perex.cz
Mon Dec 12 13:41:35 CET 2022


On 12. 12. 22 10:48, Thorsten Leemhuis wrote:
> Hi, this is your Linux kernel regression tracker.
> 
> On 11.12.22 22:08, Geraldo Nascimento wrote:
>> On Sun, Dec 11, 2022 at 04:30:11PM +0100, Ruud van Asseldonk wrote:
>>> Hi all,
>>>
>>> This issue is still present in 5.15.82, is there anything I can do to
>>> diagnose this further?
>>
>> Hi Ruud,
>>
>> Sorry for your troubles. You could use "git bisect" to try to pinpoint
>> the exact commit that introduces failure for you.
> 
> Yeah, that would be helpful. But 5.15 is quite old by now. Before going
> down that route you might want to try the latest kernel (e.g. Linux
> 6.1), as the problem might have been fixed in between, without the fix
> being backported.

It seems like a problem in the hw_params constraints / refining. There are lot of changes in the USB audio driver between 5.10/5.15. There is also HW_CONST_DEBUG define in sound/usb/pcm.c which enables the debug output for the refining.

Just curious: What's behind the value 513 (period size)? It does not match the time (5.34ms for 96kHz) nor a binary value. I would use 480 (5ms) or so.

And the final note: I gave a quick test with UMC204HD with the 6.0.9 kernel and it appears that this problem is not present in the recent kernel:

# aplay -Dhw:U192k --period-size=513 --buffer-size=2052 -c 4 -r 96000 -f S16_LE --dump-hw-params /dev/zero
Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 96000 Hz, Channels 4
HW Params of device "hw:U192k":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 32]
FRAME_BITS: [64 128]
CHANNELS: 4
RATE: [44100 192000]
PERIOD_TIME: [125 1000000]
PERIOD_SIZE: [6 192000]
PERIOD_BYTES: [64 3072000]
PERIODS: [2 1024]
BUFFER_TIME: (62 2000000]
BUFFER_SIZE: [12 384000]
BUFFER_BYTES: [96 6144000]
TICK_TIME: ALL
--------------------
# cat /proc/asound/card2/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 4
rate: 96000 (96000/1)
period_size: 513
buffer_size: 2052

# aplay -Dplughw:U192k --period-size=513 --buffer-size=2052 -c 2 -r 96000 -f S24_3LE --dump-hw-params /dev/zero
ACCESS:  MMAP_INTERLEAVED MMAP_NONINTERLEAVED MMAP_COMPLEX RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT:  S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE MU_LAW A_LAW IMA_ADPCM S20_LE S20_BE U20_LE U20_BE S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE
SUBFORMAT:  STD
SAMPLE_BITS: [4 64]
FRAME_BITS: [4 640000]
CHANNELS: [1 10000]
RATE: [4000 4294967295]
PERIOD_TIME: [125 1000000]
PERIOD_SIZE: (0 4294967295]
PERIOD_BYTES: (0 4294967295]
PERIODS: (0 4294967295]
BUFFER_TIME: [1 4294967295]
BUFFER_SIZE: [1 4294967295]
BUFFER_BYTES: [1 4294967295]
TICK_TIME: ALL
# cat /proc/asound/card2/pcm0p/sub0/hw_params
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 4
rate: 96000 (96000/1)
period_size: 513
buffer_size: 2052

I would also use S32_LE native format in your app, the S24_3LE is not supported with your hw directly. The alsa-lib does conversion.

					Jaroslav

-- 
Jaroslav Kysela <perex at perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.


More information about the Alsa-devel mailing list