audio from external sound card is distorted

Bug #1966066 reported by Hampus Lundberg
344
This bug affects 59 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Committed
Undecided
Unassigned
Impish
Fix Released
Medium
Po-Hsu Lin
Jammy
Fix Committed
Undecided
Unassigned
linux-signed-hwe-5.13 (Ubuntu)
Invalid
Undecided
Unassigned
Impish
Invalid
Undecided
Unassigned
Jammy
Invalid
Undecided
Unassigned

Bug Description

[Impact]
Commit d215f63d49da ("ALSA: usb-audio: Check available frames for the
next packet size") landed in 5.13.0-35 introduced regression to USB
audio device.

It's because this patch introduced the available frame size check, but
the conversion forgot to initialize the temporary variable properly.

A workaround is to modify /etc/pulse/daemon.conf, set the
default-sample-rate to 48000, uncomment it by removing the semicolon
at the beginning of the line. And restart pulseaudio with:
  systemctl --user restart pulseaudio.service

[Fix]
* 23939115 ALSA: usb-audio: Fix packet size calculation regression
This patch can be cherry-picked into Impish kernel, and it's already in
the master-next branch of Jammy tree.

[Test]
Test kernels built with 5.13.0-37 + this patch, can be found in:
* Focal-5.13 - https://people.canonical.com/~phlin/kernel/lp-1966066-usb-audio/focal/
* Impish-5.13 - https://people.canonical.com/~phlin/kernel/lp-1966066-usb-audio/impish/

Both kernels were tested by affected users and they're working as expected.

[Where problems could occur]
If this patch is incorrect, it might affect USB audio devices.

[Original Bug Report]
The sound card is a Focusrite Scarlett 2i2.

The sound is distorted everywhere.

Sound via HDMI works.

Seen others having the same problem:
(Edit because of previously wrong link here) https://askubuntu.com/questions/1398614/upgrading-to-5-13-0-37-generic-breaks-audio-with-external-audio-card

ubuntu release: Ubuntu 20.04.4 LTS
package name involved in bug: linux-image-5.13.0-37-generic

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: linux-image-5.13.0-37-generic 5.13.0-37.42~20.04.1
ProcVersionSignature: Ubuntu 5.13.0-35.40~20.04.1-generic 5.13.19
Uname: Linux 5.13.0-35-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27.21
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Wed Mar 23 12:56:02 2022
InstallationDate: Installed on 2020-12-18 (459 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
SourcePackage: linux-signed-hwe-5.13
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Hampus Lundberg (hample) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-signed-hwe-5.13 (Ubuntu):
status: New → Confirmed
Revision history for this message
rebd (rebd) wrote :

I think these might be related https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1966060

Other people seem to be having issues with the latest kernel https://forums.linuxmint.com/viewtopic.php?f=49&t=370408

If I roll back to 5.13.0-35, the audio seemsto work just fine.

Revision history for this message
Johan Mattsson (johan-mattsson-m) wrote :

Hi. I think this happens for me as well. I just want to add that I only get audio from my left channel. Things sound good with other cards and the same card on other operating systems.

Hampus Lundberg (hample)
description: updated
Revision history for this message
Steve (steve167) wrote (last edit ):

I can confirm the same distorted sound issue with the same external audio device: Focusrite Scarlett 2i2

5.13.0-37

Revision history for this message
aL4ix (al4ix) wrote :

I can confirm I see issues with 5.13.0-37 with my 2i4 2nd Gen with either pulse or alsa. Sound is slower and has lower pitch, maybe the sample rate is wrong. The issue is not present when going back to 5.13.0-35.

Revision history for this message
Gauthier Jolly (gjolly) wrote :
Revision history for this message
aL4ix (al4ix) wrote :

Thanks gjolly, yes it worked for me. As the article states adding
default-sample-rate = 48000
to /etc/pulse/daemon.conf did the trick for me.

Revision history for this message
Ángel Luis Fernández Presa (alf-tk85) wrote (last edit ):

Confirmed issues with 5.13.0-37 with 2i2 2nd Gen with either pulse or alsa. Sound is slower, chopped with jack started, like a very lower quality and has lower pitch. However 5.13.0-35 works perfectly. Let's try edit /etc/pulse/daemon.conf.

UPDATED:
I changed at /etc/pulse/daemon.conf
...
default-sample-rate = 48000
alternate-sample-rate = 48000
...

and selected JACK rate in 48000

It was JACK and alternate 44100, new sample rate from now, and solved for me.

Revision history for this message
magen lahat (magen) wrote :

I also confirm this with my soundcard.

how do you set default-sample-rate = 48000 ??

i don't have permission?

Revision history for this message
Bravo Baavo (baabaa) wrote :

Workaround fixed it for me, same symptoms rolling back to 5.13.0-35 is fine, 5.13.0-37 has the issue.

@~magen you need to use sudo to elevate your access

sudo nano /etc/pulse/daemon.conf

Find the line with default-sample-rate

Remove the ; and change the value to 48000, do the same for alternate-sample-rate so it will look like:

default-sample-rate = 48000
alternate-sample-rate = 48000

Press CTRL + X to save and exit.

Then run pulseaudio -k to restart your audio.

Revision history for this message
as (ip413as3) wrote :

The same here. Distorted sound every ~7 seconds. Kernel 5.13.0-35 is fine, kernel 5.13.0-37 is buggy.
External card: Thinkpad USB-C Dock Gen2, 40AS, 0090EU.

Revision history for this message
Logan Shaw (logan-d-shaw) wrote :

I have this issue too.

Hardware is a different external USB DAC (not Focusrite):

$ lsusb | grep DAC
Bus 005 Device 004: ID 08bb:2704 Texas Instruments PCM2704 16-bit stereo audio DAC

Symptoms: Clicking sounds. Irregular but pretty frequent, up to once a second.

It happens on kernel 5.13.0-37, but it goes away if I revert to 5.13.0-35.

Revision history for this message
Julia Otranto Aulicino (juliaotran) wrote :

I have this issue too.

I'm using a DJ controller Pioneer DDJ-SB3.

Bus 001 Device 002: ID 2b73:0019 Pioneer DJ Corporation DDJ-SB3

It happens on kernel 5.13.0-37, but it goes away if I revert to 5.13.0-35.

Revision history for this message
Douglas Santos (douglasrpg) wrote :

I have the same issue, but with another USB sound device: Yamaha Thr10x amp (which is also an audio interface).

Revision history for this message
Douglas Santos (douglasrpg) wrote :

I've tried to change /etc/pulse/daemon.conf (default-sample-rate = 48000) but did not work for me.

Revision history for this message
uniomni (ole-moller-nielsen) wrote :

Thank you so much for raising this bug. I have the same issue:
https://drive.google.com/file/d/13aSFZ5ch9TcG836B9r-OXzAqAk6WimJx/view?usp=sharing

I just don't understand how it suddenly happened. Is it due to automatic
updates?

Thx
Ole

Revision history for this message
Aaron Maltz (animalchin) wrote :

Thanks to many of your replies, I was able to fix the playback issue caused by the kernal upgrade; comment #11 from Bravo Bravo was particularly helpful. Unfortunately, I'm unable to record through a Scarlett Solo on Audacity. Any and all configurations result in, "Error opening recording device. Error code -9997 Invalid sample rate."

Revision history for this message
Andrej Friesen (ajfriesen) wrote :

Had the same issues on 2 machines as well.

Using a Xenyx 302 USB and had sudden periodic popping noise on the right side of my headphones.

Thanks to comment [#11](https://bugs.launchpad.net/ubuntu/+source/linux-signed-hwe-5.13/+bug/1966066/comments/11) it is fixed for now.

You can also restart with an older Kernel, that is what I did on my desktop.

Revision history for this message
Marc Neiger (marc-i) wrote :

I the same problem with several machines using Jabra Speak 710.
5.13.0-35 works perfectly on all though, while 5.13.0-37 produces distorted sound.

Revision history for this message
Johan Mattsson (johan-mattsson-m) wrote :

Adding default-sample-rate = 48000 to /etc/pulse/daemon.conf got rid of the distortion but I only get audio from my left channel. Do you have any idea why that could be the case?

Revision history for this message
Po-Hsu Lin (cypressyew) wrote (last edit ):

Hello folks,

Can you give the following test kernel a try, which contains a possible fix:
https://github.com/torvalds/linux/commit/23939115be181bc5dbc33aa8471adcdbffa28910

Steps:
1. Remove the workaround that you made and make sure you have this issue in Focal / Impish 5.13.0-37
2. Download kernel deb files here based on your current distro, put them into a new directory:
   focal - https://people.canonical.com/~phlin/kernel/lp-1966066-usb-audio/focal/
   impish - https://people.canonical.com/~phlin/kernel/lp-1966066-usb-audio/impish/
2. Roll back to 5.13.0-35 by selecting the corresponding entry in GRUB
3. Remove the 5.13.0-37 kernel, otherwise it will complain about a version conflict:
   sudo apt remove linux-image-5.13.0-37-generic linux-image-unsigned-5.13.0-37-generic
4. Install those deb files in Step 2, with command:
   sudo dpkg -i linux-*5.13*.deb
5. Reboot to this test kernel and check the version number with `uname -vr`, it should be something like:
   5.13.0-37-generic #42+lp1966066 SMP Tue Mar 29 02:54:38 UTC 2022
6. Test your audio and see if it helps

After your test, you can undo this change by:
A. Rolling back to 5.13.0-35 again
B. sudo apt remove linux-image-unsigned-5.13.0-37-generic
C. sudo apt install linux-image-5.13.0-37-generic

Thanks!

Revision history for this message
Nils Ackermann (slanack) wrote :

Same Problem here with Focusrite Scarlett 2i2 and 5.13.0-37.

The test kernel works for me: uname -a gives 'Linux xxxx 5.13.0-37-generic #42~20.04.1+lp1966066 SMP Tue Mar 29 06:12:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux' and sound is ok again.

Thanks for resolving this so fast!

Revision history for this message
Chris (cetooley) wrote :

This was driving me crazy for quite some time and I happened upon this from an askubuntu thread which mentioned the eventual fix

kernel details:
```
> uname -a
Linux lightning 5.13.0-37-generic #42-Ubuntu SMP Tue Mar 15 14:34:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
```

Uncommenting and setting `default-sample-rate` and `alternate-sample-rate` to `48000` in `/etc/pulse/daemon.conf` solved a periodic pop I was getting when connected via a HyperX Cloud II USB audio dongle.

Using the headphones in the front TRS port would also prevent pops but this was not a solution as I use the microphone attached to the headphones.

Glory to the person who solved this, what an obnoxious bug.

Revision history for this message
Hampus Lundberg (hample) wrote :

Setting the default-sample-rate to 48000 in daemon.conf has not worked for me.

Revision history for this message
uniomni (ole-moller-nielsen) wrote : Re: [Bug 1966066] Re: audio from external sound card is distorted

Changing sample rate did not work for me. Only downgrading the kernel as
described works for the moment.

On Wed, 30 Mar 2022, 9:30 pm Hampus Lundberg, <email address hidden>
wrote:

> Setting the default-sample-rate to 48000 in daemon.conf has not worked
> for me.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1966215).
> https://bugs.launchpad.net/bugs/1966066
>
> Title:
> audio from external sound card is distorted
>
> Status in linux-signed-hwe-5.13 package in Ubuntu:
> Confirmed
>
> Bug description:
> The sound card is a Focusrite Scarlett 2i2.
>
> The sound is distorted everywhere.
>
> Sound via HDMI works.
>
> Seen others having the same problem:
> (Edit because of previously wrong link here)
> https://askubuntu.com/questions/1398614/upgrading-to-5-13-0-37-generic-breaks-audio-with-external-audio-card
>
> ubuntu release: Ubuntu 20.04.4 LTS
> package name involved in bug: linux-image-5.13.0-37-generic
>
> ProblemType: Bug
> DistroRelease: Ubuntu 20.04
> Package: linux-image-5.13.0-37-generic 5.13.0-37.42~20.04.1
> ProcVersionSignature: Ubuntu 5.13.0-35.40~20.04.1-generic 5.13.19
> Uname: Linux 5.13.0-35-generic x86_64
> NonfreeKernelModules: nvidia_modeset nvidia
> ApportVersion: 2.20.11-0ubuntu27.21
> Architecture: amd64
> CasperMD5CheckResult: skip
> CurrentDesktop: ubuntu:GNOME
> Date: Wed Mar 23 12:56:02 2022
> InstallationDate: Installed on 2020-12-18 (459 days ago)
> InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64
> (20200731)
> SourcePackage: linux-signed-hwe-5.13
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/linux-signed-hwe-5.13/+bug/1966066/+subscriptions
>
>

Revision history for this message
Bruce Walton (waltonb) wrote :

5.13.0-39-generic still has this problem. Focusrite 2i2

I suppose the test patch for -37 will not work for this case.

Might need to roll back to 5.4 generic, cannot have this device offline.

Revision history for this message
Jeremy (smilecafe) wrote (last edit ):

Same here. High pitched sound modulated by sine wave every 2 seconds.

48000 sampling rate doesn't work for me, either.

---------

It works now. It made a mistake while editing the parameter. After following the fix with right parameter, it works. Thanks.

Po-Hsu Lin (cypressyew)
Changed in linux (Ubuntu Impish):
status: New → In Progress
assignee: nobody → Po-Hsu Lin (cypressyew)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux (Ubuntu):
status: New → Confirmed
Changed in linux-signed-hwe-5.13 (Ubuntu Impish):
status: New → Confirmed
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

User feedback from comment #23, bug 1966147 and bug 1966997 shows positive test result with both F-5.13 / I-5.13 test kernel in comment #22.

I will SRU this patch.

Po-Hsu Lin (cypressyew)
Changed in linux (Ubuntu Jammy):
status: Confirmed → Fix Committed
Changed in linux-signed-hwe-5.13 (Ubuntu Jammy):
status: Confirmed → Invalid
Po-Hsu Lin (cypressyew)
Changed in linux-signed-hwe-5.13 (Ubuntu Impish):
status: Confirmed → Invalid
tags: added: 5.13 impish
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
description: updated
Stefan Bader (smb)
Changed in linux (Ubuntu Impish):
importance: Undecided → Medium
Revision history for this message
Pablo (pablo-ferraioli) wrote :

I confirm having the issue

Ubuntu 20.04
External soundcard Behringer UM2

Workaround fixed the issue with most app BUT Ardour (going through ALSA).

Revision history for this message
Konrad S (szup-6) wrote (last edit ):

Same issue with Yamaha THR5 through USB on Ubuntu Studio 20.04.1. Disabled JACK and was able to fix the stutter. Edit in /etc/pulse/daemon.conf for 5.13.0-37 did not fix distorted audio. 5.13.0-39 exhibiting same problem.

Revision history for this message
Lee Porte (lqe) wrote :

I can also confirm having the same issue with a focusrite scarlett 2i4 running 5.13.0-39. I have rolled back to 5.13.0-35 and the issue is not present.

I have not attempted the fix of setting the default-sample-rate in etc/pulse/daemon.conf as yet.

Stefan Bader (smb)
Changed in linux (Ubuntu Impish):
status: In Progress → Fix Committed
Ushakov Dmitry (sknkhnt)
Changed in linux (Ubuntu Impish):
status: Fix Committed → Fix Released
Po-Hsu Lin (cypressyew)
Changed in linux (Ubuntu Impish):
status: Fix Released → Fix Committed
Revision history for this message
wuwei912 (wuwei912) wrote (last edit ):

Funnily I don't have the issue with "Focusrite-Novation Scarlett 2i4", but I have:
- a regular popping with a "KORG, Inc. ToneLabST" (lsusb, product name is Vox ToneLab ST) at a tempo of around 80-90 bpm
- and a slight distortion in irregular intervals / at audio peaks with a "Harman Soundcraft 2-channel Audio Driver" (lsusb, product name is Soundcraft Signature 10)

Behaves the same on both 5.13.0-37-generic and 5.13.0-39-generic (#44-Ubuntu SMP Thu Mar 24 15:35:05 UTC 2022).

Workaround to change default-sample-rate to 48000 in /etc/pulse/daemon.conf didn't help with either kernel, tried several times. I didn't try rolling back to 5.13.0-35 yet, as I don't have it installed anymore. So I'll boot to 5.13.0-39 again and will try out the patched kernel https://bugs.launchpad.net/ubuntu/+source/linux-signed-hwe-5.13/+bug/1966066/comments/22

As I understood, it will fix the bug introduced in 5.13.0-37 as documented here: https://github.com/torvalds/linux/commit/23939115be181bc5dbc33aa8471adcdbffa28910

Revision history for this message
wuwei912 (wuwei912) wrote (last edit ):

Update on previous comment https://bugs.launchpad.net/ubuntu/+source/linux-signed-hwe-5.13/+bug/1966066/comments/36

Booting into 5.13.0-37-generic #42+lp1966066 SMP Tue Mar 29 02:54:38 UTC 2022 fixes
- "KORG, Inc. ToneLabST" regular popping issue and
- "Focusrite-Novation Scarlett 2i4" still works

BUT now my second display stops working. (Tried switching back and forth between 5.13.0-39 and -37 #42+lp1966066, it happens only with the patched kernel) Both my displays are connected through a "NVIDIA Corporation GK208B [GeForce GT 730] (rev a1)", but the one connected through the HDMI slot stops working on the patched kernel. It doesn't receive a signal and is not listed in xrandr --query

No change in regards to "Harman Soundcraft 2-channel Audio Driver", but this might be unrelated.

So the patch helps a bit at least. If I use it I can play/record through the audio interface again, but only with 1 screen. :P

Revision history for this message
arsa cuevas (akdascode) wrote :

This is the first post I ever make on a bug on a linux based OS.

I'm using a ten year old Toshiba Satellite L855 that I just bought RAM for, my surprise when I plug in a Mackie ProFx16v2 and there's this horrible pop coming from the headphones. Long story short, after losing a day, at 2300 I'm using 5.13.0-19 generic kernel and there are no more pops. For some reason the 5.13.0-37 doesn't even boot.

I hope it somehow adds up to the conversation.

Revision history for this message
Kenta Ishii (jimmyken) wrote :

My USB device outputs popping noise on the 44100Hz sample rate with JACK in 5.13.0-37. This seems to be similar issue on this bug.

Related Discussion:
https://askubuntu.com/questions/1399136/sound-not-working-on-ubuntu-20-04

In my case, downgrading to 5.13.0-35 fixed this issue.

cd ~/Desktop
git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal
cd focal
git checkout -b hwe-5.13 origin/hwe-5.13
git checkout -b hwe-5.13-next origin/hwe-5.13-next
git diff hwe-5.13 hwe-5.13-next sound/usb/* --name-only

Several advanced differences via rebase. Note hwe-5.13 has been still on 5.13.0-35.

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux/5.13.0-41.46 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-impish' to 'verification-done-impish'. If the problem still exists, change the tag 'verification-needed-impish' to 'verification-failed-impish'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-impish
Revision history for this message
eta (eeeeeta) wrote (last edit ):

Confirmed fixed for me on linux-generic-hwe-20.04 version 5.13.0-41.46 from impish-proposed.

(edit: whoops, got the version wrong)

eta@st-pancras ~> uname -a
Linux st-pancras 5.13.0-41-generic #46-Ubuntu SMP Thu Apr 14 20:06:04 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

tags: added: verification-done-impish
removed: verification-needed-impish
Revision history for this message
wuwei912 (wuwei912) wrote :

No changes with 5.13.0-40-generic #45-Ubuntu SMP Tue Mar 29 14:48:14 UTC 2022 to the issues described here: https://bugs.launchpad.net/ubuntu/+source/linux-signed-hwe-5.13/+bug/1966066/comments/36

Have to resort to the partial fix with the patchend kernel, mentionened here, still:
https://bugs.launchpad.net/ubuntu/+source/linux-signed-hwe-5.13/+bug/1966066/comments/37

Revision history for this message
Po-Hsu Lin (cypressyew) wrote (last edit ):

wuwei912 (wuwei912), please give the proposed kernel mentioned in #40 a try, thanks!

eta (eeeeeta) thanks for the verification.

Revision history for this message
wuwei912 (wuwei912) wrote (last edit ):

I can report that 5.13.0-41-generic #46-Ubuntu SMP Thu Apr 14 20:06:04 UTC 2022
- fixes regular popping with a "KORG, Inc. ToneLabST" (lsusb, product name is Vox ToneLab ST) at a tempo of around 80-90 bpm
- Focusrite-Novation Scarlett 2i4 still working (never was an issue)
- 2nd display connected through HDMI still working.

Great! Thanks a lot.

Revision history for this message
Richard Vincent (ricardus-v) wrote (last edit ):

This bug is affecting me as well. Considering I run ubuntu studio, and the reason I run it is for audio, this is definitely more than a medium priority bug for me. This is happening on my Scarlett 2i2 audio interface.

I am running kernel:

5.13.0-40-lowlatency

Revision history for this message
Mikołaj Neronowicz (mikosenigma) wrote :
Download full text (4.0 KiB)

I also think this problem is very serious. Quite frustrating. I did not
suspect that I would have such problems on the LTS version where everything
should be stable. This is the third kernel update which has not fixed this
problem. I keep going back to kernel 5.13.0-35.

Operating System: Feren OS 2022.04
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.13.0-35-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6820HQ CPU @ 2.70GHz
Memory: 31.0 GiB of RAM
Graphics Processor: Quadro M2000M/PCIe/SSE2

śr., 27 kwi 2022 o 00:01 Richard Vincent <email address hidden>
napisał(a):

> This bug is affecting me as well. Considering I run ubuntu studio, and
> the reason I run it is for audio, this is definitely more than a medium
> priority bug for me. This is happening on my Scarlett 2i2 audio
> interface.
>
> I am running kernel:
>
> 5.13.0-40-lowlatency
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1966327).
> https://bugs.launchpad.net/bugs/1966066
>
> Title:
> audio from external sound card is distorted
>
> Status in linux package in Ubuntu:
> Fix Committed
> Status in linux-signed-hwe-5.13 package in Ubuntu:
> Invalid
> Status in linux source package in Impish:
> Fix Committed
> Status in linux-signed-hwe-5.13 source package in Impish:
> Invalid
> Status in linux source package in Jammy:
> Fix Committed
> Status in linux-signed-hwe-5.13 source package in Jammy:
> Invalid
>
> Bug description:
> [Impact]
> Commit d215f63d49da ("ALSA: usb-audio: Check available frames for the
> next packet size") landed in 5.13.0-35 introduced regression to USB
> audio device.
>
> It's because this patch introduced the available frame size check, but
> the conversion forgot to initialize the temporary variable properly.
>
> A workaround is to modify /etc/pulse/daemon.conf, set the
> default-sample-rate to 48000, uncomment it by removing the semicolon
> at the beginning of the line. And restart pulseaudio with:
> systemctl --user restart pulseaudio.service
>
> [Fix]
> * 23939115 ALSA: usb-audio: Fix packet size calculation regression
> This patch can be cherry-picked into Impish kernel, and it's already in
> the master-next branch of Jammy tree.
>
> [Test]
> Test kernels built with 5.13.0-37 + this patch, can be found in:
> * Focal-5.13 -
> https://people.canonical.com/~phlin/kernel/lp-1966066-usb-audio/focal/
> * Impish-5.13 -
> https://people.canonical.com/~phlin/kernel/lp-1966066-usb-audio/impish/
>
> Both kernels were tested by affected users and they're working as
> expected.
>
> [Where problems could occur]
> If this patch is incorrect, it might affect USB audio devices.
>
>
> [Original Bug Report]
> The sound card is a Focusrite Scarlett 2i2.
>
> The sound is distorted everywhere.
>
> Sound via HDMI works.
>
> Seen others having the same problem:
> (Edit because of previously wrong link here)
> https://askubuntu.com/questions/1398614/upgrading-to-5-13-0-37-generic-breaks-audio-with-external-audio-card
>
> ubuntu release: Ubuntu 20.04.4 LTS
> package name involve...

Read more...

Revision history for this message
Stefan Schubert (stefansc) wrote :

When will version "5.13.0-41-generic" be released for the focal repositories?
https://launchpad.net/ubuntu/+source/linux/5.13.0-41.46

Currently we have to hold the kernel to version 5.13.0-35-generic. Also a lot of CVEs have been fixed between the minor releases 35 - 41.

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Hi Stefan,

It's expected to see this kernel in -updates on 09-May

Kernel Versions
=============================================
impish:
    linux: 5.13.0-41.46
focal:
    linux-hwe-5.13: 5.13.0-41.46~20.04.1

https://lists.ubuntu.com/archives/kernel-team/2022-April/129717.html

Revision history for this message
Richard Vincent (ricardus-v) wrote :

Anyone know when we will see this in the Ubuntu Studio Low Latency kernel??

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (33.7 KiB)

This bug was fixed in the package linux - 5.13.0-41.46

---------------
linux (5.13.0-41.46) impish; urgency=medium

  * impish/linux: 5.13.0-41.46 -proposed tracker (LP: #1969014)

  * NVMe devices fail to probe due to ACPI power state change (LP: #1942624)
    - ACPI: power: Rework turning off unused power resources
    - ACPI: PM: Do not turn off power resources in unknown state

  * Recent 5.13 kernel has broken KVM support (LP: #1966499)
    - KVM: Add infrastructure and macro to mark VM as bugged
    - KVM: x86: Use KVM_BUG/KVM_BUG_ON to handle bugs that are fatal to the VM
    - KVM: VMX: prepare sync_pir_to_irr for running with APICv disabled

  * LRMv6: add multi-architecture support (LP: #1968774)
    - [Packaging] resync dkms-build{,--nvidia-N}

  * io_uring regression - lost write request (LP: #1952222)
    - io-wq: split bounded and unbounded work into separate lists

  * xfrm interface cannot be changed anymore (LP: #1968591)
    - xfrm: fix the if_id check in changelink

  * Use kernel-testing repo from launchpad for ADT tests (LP: #1968016)
    - [Debian] Use kernel-testing repo from launchpad

  * vmx_ldtr_test in ubuntu_kvm_unit_tests failed (FAIL: Expected 0 for L1 LDTR
    selector (got 50)) (LP: #1956315)
    - KVM: nVMX: Set LDTR to its architecturally defined value on nested VM-Exit

  * audio from external sound card is distorted (LP: #1966066)
    - ALSA: usb-audio: Fix packet size calculation regression

  * Impish update: upstream stable patchset 2022-04-12 (LP: #1968771)
    - cgroup/cpuset: Fix a race between cpuset_attach() and cpu hotplug
    - btrfs: tree-checker: check item_size for inode_item
    - btrfs: tree-checker: check item_size for dev_item
    - clk: jz4725b: fix mmc0 clock gating
    - vhost/vsock: don't check owner in vhost_vsock_stop() while releasing
    - parisc/unaligned: Fix fldd and fstd unaligned handlers on 32-bit kernel
    - parisc/unaligned: Fix ldw() and stw() unalignment handlers
    - KVM: x86/mmu: make apf token non-zero to fix bug
    - drm/amdgpu: disable MMHUB PG for Picasso
    - drm/i915: Correctly populate use_sagv_wm for all pipes
    - sr9700: sanity check for packet length
    - USB: zaurus: support another broken Zaurus
    - CDC-NCM: avoid overflow in sanity checking
    - x86/fpu: Correct pkru/xstate inconsistency
    - tee: export teedev_open() and teedev_close_context()
    - optee: use driver internal tee_context for some rpc
    - ping: remove pr_err from ping_lookup
    - perf data: Fix double free in perf_session__delete()
    - bnx2x: fix driver load from initrd
    - bnxt_en: Fix active FEC reporting to ethtool
    - hwmon: Handle failure to register sensor with thermal zone correctly
    - bpf: Do not try bpf_msg_push_data with len 0
    - selftests: bpf: Check bpf_msg_push_data return value
    - bpf: Add schedule points in batch ops
    - io_uring: add a schedule point in io_add_buffers()
    - net: __pskb_pull_tail() & pskb_carve_frag_list() drop_monitor friends
    - tipc: Fix end of loop tests for list_for_each_entry()
    - gso: do not skip outer ip header in case of ipip and net_failover
    - openvswitch: Fix setting ipv6 fields causing hw csum failure
   ...

Changed in linux (Ubuntu Impish):
status: Fix Committed → Fix Released
Revision history for this message
Richard Vincent (ricardus-v) wrote :

I can confirm the "5.13.0-41-lowlatency" kernel which I just grabbed on my Ubuntu Studio laptop has fixed the distorted USB audio bug.

Thank you devs!

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-intel-5.13/5.13.0-1012.12 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Revision history for this message
Hampus Lundberg (hample) wrote :

I am not sure when it was fixed, but by "5.13.0-44-generic" it has been fixed for me!

Revision history for this message
Marian Rainer-Harbach (marianrh) wrote :

For me too, I don't know why comment #52 by the kernel bot has appeared now. I'm going to set the "verification done" tag.

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Anas Ghrab (anas-gh) wrote (last edit ):

I still have this problem on 5.15.0-37-lowlatency. Is it possible to use the commit before it's released ?

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Hi Anas Ghrab,

Does this issue exist with older Jammy 5.15 kernel?

For Jammy 5.15, this patch should already landed in:
https://launchpad.net/ubuntu/+source/linux/5.15.0-14.14

Revision history for this message
Ángel Luis Fernández Presa (alf-tk85) wrote :

Hi.
It is happening again in 5.15.0-42 LOWLATENCY.
Focusrite 2i2 2nd generation.
UNCOMMENT and changing rate samples it's not working for me this time.
Booting 5.13.0-52 LOWLATENCY and all working, no distorted audio.
Thx in advance.

Revision history for this message
wilk (j-cubizolles) wrote :

It's fixed also in 5.15.0-50-generic from jammy-proposed, without changes to /etc/pulse/daemon.conf

Revision history for this message
mario buoninfante (mariobuoninfante) wrote (last edit ):

Hi,

I got the same as described by Ángel Luis Fernández Presa (alf-tk85) 2 posts above.
One thing I noticed though, is that my GPU seems to affect the results.
When using a kernel exhibiting the issue, I tried installing the proprietary AMD drivers for my AMD FirePro W2100.
That made the video really sluggish, but solved my audio issues.
Unfortunately video performance was so bad that I had to get rid of the driver.

Hope this is somehow useful.

I'm now using 5.13.0-35-lowlatency and the crackling noise is gone, but I'm getting more xruns than on another machine way less powerful than the one in question.
I tried with a Focusrite Scarlett 2i2 3rd Gen and a Focusrite Clarett 8pre USB C, same results.

BTW I tried the daemon.conf workaround, but that didn't work.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.