Bluetooth audio glitch/choppy after swtiching kernel

Previously I use manjaro 6.3.13-1 and the sound is good. As 6.3 series kernel is not supported anymore, I need to switch my kernel. I tried manjaro’s 6.1/6.4/6.5 kernels, but bluetooth audio becomes glitch and choppy.

Any pointer where I should get started? Maybe the diffs between these kernels?

First check the device power - when power goes low sound get distorted - and range have a similar effect.

Next I would remove pairing and recreate the connection.

Device power: 80%, range: within 30cm

I don’t think these parameters are related, as I can switch kernel and reproduce the issue immediately.

Is the ‘glitch and choppy’ audio occurring all the time or only at specific times:

  • starting/stopping audio playback or changing audio tracks
  • adjusting volume in a web browser or audio player
  • Bluetooth device switching to headset mode (assuming it is a dual band device with a mic input)

Please post more information about audio playback sinks in PulseAudio

pactl list sinks

Thanks for your guide.
The broken sound happens whenever I play music through Bluetooth. Both my 1000XM4 headset and Edifier speaker.
Below are the pactl outputs, I post the output under 6.1 and 6.3 kernel for your information.

6.1:

Sink #0
	State: SUSPENDED
	Name: alsa_output.pci-0000_35_00.1.HiFi__hw_Generic_7__sink
	Description: Rembrandt Radeon High Definition Audio Controller HDMI / DisplayPort 2 Output
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 6
	Mute: yes
	Volume: front-left: 0 /   0% / -inf dB,   front-right: 0 /   0% / -inf dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.pci-0000_35_00.1.HiFi__hw_Generic_7__sink.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "U2790B"
		alsa.id = "HDMI 1"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "7"
		alsa.card = "0"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0x987c8000 irq 135"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:35:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:35:00.1/sound/card0"
		device.bus = "pci"
		device.vendor.id = "1002"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
		device.product.id = "1640"
		device.product.name = "Rembrandt Radeon High Definition Audio Controller"
		device.string = "_ucm0001.hw:Generic,7"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.profile.name = "HiFi: hw:Generic,7: sink"
		device.profile.description = "HDMI / DisplayPort 2 Output"
		alsa.mixer_device = "_ucm0001.hw:Generic"
		device.description = "Rembrandt Radeon High Definition Audio Controller HDMI / DisplayPort 2 Output"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		[Out] HDMI2: HDMI / DisplayPort 2 Output (type: HDMI, priority: 1200, available)
	Active Port: [Out] HDMI2
	Formats:
		pcm

Sink #1
	State: SUSPENDED
	Name: alsa_output.pci-0000_35_00.1.HiFi__hw_Generic_3__sink
	Description: Rembrandt Radeon High Definition Audio Controller HDMI / DisplayPort 1 Output
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 6
	Mute: yes
	Volume: front-left: 0 /   0% / -inf dB,   front-right: 0 /   0% / -inf dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.pci-0000_35_00.1.HiFi__hw_Generic_3__sink.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "HDMI 0"
		alsa.id = "HDMI 0"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "3"
		alsa.card = "0"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0x987c8000 irq 135"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:35:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:35:00.1/sound/card0"
		device.bus = "pci"
		device.vendor.id = "1002"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
		device.product.id = "1640"
		device.product.name = "Rembrandt Radeon High Definition Audio Controller"
		device.string = "_ucm0001.hw:Generic,3"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.profile.name = "HiFi: hw:Generic,3: sink"
		device.profile.description = "HDMI / DisplayPort 1 Output"
		alsa.mixer_device = "_ucm0001.hw:Generic"
		device.description = "Rembrandt Radeon High Definition Audio Controller HDMI / DisplayPort 1 Output"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		[Out] HDMI1: HDMI / DisplayPort 1 Output (type: HDMI, priority: 1100, available)
	Active Port: [Out] HDMI1
	Formats:
		pcm

Sink #2
	State: SUSPENDED
	Name: alsa_output.pci-0000_35_00.6.HiFi__hw_Generic_1__sink
	Description: Family 17h/19h HD Audio Controller Speaker + Headphones
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 8
	Mute: yes
	Volume: front-left: 0 /   0% / -inf dB,   front-right: 0 /   0% / -inf dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.pci-0000_35_00.6.HiFi__hw_Generic_1__sink.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC257 Analog"
		alsa.id = "ALC257 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "1"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0x987c0000 irq 136"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:35:00.6"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:35:00.6/sound/card1"
		device.bus = "pci"
		device.vendor.id = "1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		device.product.id = "15e3"
		device.product.name = "Family 17h/19h HD Audio Controller"
		device.string = "_ucm0003.hw:Generic_1"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.profile.name = "HiFi: hw:Generic_1: sink"
		device.profile.description = "Speaker + Headphones"
		alsa.mixer_device = "_ucm0003.hw:Generic_1"
		device.description = "Family 17h/19h HD Audio Controller Speaker + Headphones"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		[Out] Speaker: Speaker (type: Speaker, priority: 100, availability unknown)
		[Out] Headphones: Headphones (type: Headphones, priority: 200, not available)
	Active Port: [Out] Speaker
	Formats:
		pcm

Sink #3
	State: SUSPENDED
	Name: bluez_sink.14_3F_A6_60_09_2B.a2dp_sink
	Description: WH-1000XM4
	Driver: module-bluez5-device.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 26
	Mute: no
	Volume: front-left: 45875 /  70% / -9.29 dB,   front-right: 45875 /  70% / -9.29 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: bluez_sink.14_3F_A6_60_09_2B.a2dp_sink.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY 
	Properties:
		bluetooth.protocol = "a2dp_sink"
		bluetooth.codec = "sbc"
		device.description = "WH-1000XM4"
		device.string = "14:3F:A6:60:09:2B"
		device.api = "bluez"
		device.class = "sound"
		device.bus = "bluetooth"
		device.form_factor = "headset"
		bluez.path = "/org/bluez/hci0/dev_14_3F_A6_60_09_2B"
		bluez.class = "0x240404"
		bluez.alias = "WH-1000XM4"
		device.icon_name = "audio-headset-bluetooth"
		device.intended_roles = "phone"
	Ports:
		headset-output: Headset (type: Headset, priority: 0, availability unknown)
	Active Port: headset-output
	Formats:
		pcm

6.3

Sink #0
	State: SUSPENDED
	Name: alsa_output.pci-0000_35_00.1.HiFi__hw_Generic_7__sink
	Description: Rembrandt Radeon High Definition Audio Controller HDMI / DisplayPort 2 Output
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 6
	Mute: yes
	Volume: front-left: 0 /   0% / -inf dB,   front-right: 0 /   0% / -inf dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.pci-0000_35_00.1.HiFi__hw_Generic_7__sink.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "U2790B"
		alsa.id = "HDMI 1"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "7"
		alsa.card = "0"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0x987c8000 irq 135"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:35:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:35:00.1/sound/card0"
		device.bus = "pci"
		device.vendor.id = "1002"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
		device.product.id = "1640"
		device.product.name = "Rembrandt Radeon High Definition Audio Controller"
		device.string = "_ucm0001.hw:Generic,7"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.profile.name = "HiFi: hw:Generic,7: sink"
		device.profile.description = "HDMI / DisplayPort 2 Output"
		alsa.mixer_device = "_ucm0001.hw:Generic"
		device.description = "Rembrandt Radeon High Definition Audio Controller HDMI / DisplayPort 2 Output"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		[Out] HDMI2: HDMI / DisplayPort 2 Output (type: HDMI, priority: 1200, available)
	Active Port: [Out] HDMI2
	Formats:
		pcm

Sink #1
	State: SUSPENDED
	Name: alsa_output.pci-0000_35_00.1.HiFi__hw_Generic_3__sink
	Description: Rembrandt Radeon High Definition Audio Controller HDMI / DisplayPort 1 Output
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 6
	Mute: yes
	Volume: front-left: 0 /   0% / -inf dB,   front-right: 0 /   0% / -inf dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.pci-0000_35_00.1.HiFi__hw_Generic_3__sink.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "U2790B"
		alsa.id = "HDMI 0"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "3"
		alsa.card = "0"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0x987c8000 irq 135"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:35:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:35:00.1/sound/card0"
		device.bus = "pci"
		device.vendor.id = "1002"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
		device.product.id = "1640"
		device.product.name = "Rembrandt Radeon High Definition Audio Controller"
		device.string = "_ucm0001.hw:Generic,3"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.profile.name = "HiFi: hw:Generic,3: sink"
		device.profile.description = "HDMI / DisplayPort 1 Output"
		alsa.mixer_device = "_ucm0001.hw:Generic"
		device.description = "Rembrandt Radeon High Definition Audio Controller HDMI / DisplayPort 1 Output"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		[Out] HDMI1: HDMI / DisplayPort 1 Output (type: HDMI, priority: 1100, available)
	Active Port: [Out] HDMI1
	Formats:
		pcm

Sink #2
	State: SUSPENDED
	Name: alsa_output.pci-0000_35_00.6.HiFi__hw_Generic_1__sink
	Description: Family 17h/19h HD Audio Controller Speaker + Headphones
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 8
	Mute: yes
	Volume: front-left: 0 /   0% / -inf dB,   front-right: 0 /   0% / -inf dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.pci-0000_35_00.6.HiFi__hw_Generic_1__sink.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC257 Analog"
		alsa.id = "ALC257 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "1"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0x987c0000 irq 136"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:35:00.6"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:35:00.6/sound/card1"
		device.bus = "pci"
		device.vendor.id = "1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		device.product.id = "15e3"
		device.product.name = "Family 17h/19h HD Audio Controller"
		device.string = "_ucm0003.hw:Generic_1"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.profile.name = "HiFi: hw:Generic_1: sink"
		device.profile.description = "Speaker + Headphones"
		alsa.mixer_device = "_ucm0003.hw:Generic_1"
		device.description = "Family 17h/19h HD Audio Controller Speaker + Headphones"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		[Out] Speaker: Speaker (type: Speaker, priority: 100, availability unknown)
		[Out] Headphones: Headphones (type: Headphones, priority: 200, not available)
	Active Port: [Out] Speaker
	Formats:
		pcm

Sink #3
	State: SUSPENDED
	Name: bluez_sink.14_3F_A6_60_09_2B.a2dp_sink
	Description: WH-1000XM4
	Driver: module-bluez5-device.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 26
	Mute: no
	Volume: front-left: 45875 /  70% / -9.29 dB,   front-right: 45875 /  70% / -9.29 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: bluez_sink.14_3F_A6_60_09_2B.a2dp_sink.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY 
	Properties:
		bluetooth.protocol = "a2dp_sink"
		bluetooth.codec = "sbc"
		device.description = "WH-1000XM4"
		device.string = "14:3F:A6:60:09:2B"
		device.api = "bluez"
		device.class = "sound"
		device.bus = "bluetooth"
		device.form_factor = "headset"
		bluez.path = "/org/bluez/hci0/dev_14_3F_A6_60_09_2B"
		bluez.class = "0x240404"
		bluez.alias = "WH-1000XM4"
		bluetooth.battery = "80%"
		device.icon_name = "audio-headset-bluetooth"
		device.intended_roles = "phone"
	Ports:
		headset-output: Headset (type: Headset, priority: 0, availability unknown)
	Active Port: headset-output
	Formats:
		pcm

The only difference in the data for Bluetooth device is that kernel v6.3 is detecting battery level

Data also shows headphones using Bluetooth codec SBC
Manufacturer specifications for WH-1000XM4 state that headphones can also support AAC, LDAC
Use this command to check if other codecs are available in PulseAudio

pactl send-message /card/bluez_card.14_3F_A6_60_09_2B/bluez list-codecs

If audio is broken during audio playback, increase resampler quality

tee --append ~/.config/pulse/daemon.conf <<< 'resample-method = speex-float-3'

and restart PulseAudio to load configuration change

systemctl --user restart pulseaudio

If broken audio happens when audio playback starts, use this command to disable PulseAudio module that suspends audio outputs when idle

pactl unload-module module-suspend-on-idle

list-codecs got:

[{"name":"sbc","description":"SBC"},{"name":"sbc_xq_453","description":"SBC XQ 453kbps"},{"name":"sbc_xq_512","description":"SBC XQ 512kbps"},{"name":"sbc_xq_552","description":"SBC XQ 552kbps"}]

I use PulseAudio Volume Control GUI tool and switch between these codecs, and the problem remains.

For the resample-method option, I tried speex-float-3, speex-float-10, soxr-vhq, also no lucky.
systemctl --user restart pulseaudio does not work for me, I used pulseaudio -k to kill the daemon and restart.

And the broken audio does not only happen at the beginning of playback, so I didn’t try the your last suggestion.

systemctl --user restart pulseaudio does not work for me

I suggest you get more information about systemd units and check for errors

systemctl --user -l --no-pager status pulseaudio.socket pulseaudio.service

Also suggest:

  1. load pulseaudio module to generate a test tone

    pactl load-module module-sine
    
  2. get more information about the sink-input from module-sine

    pactl list sink-inputs
    
  3. unload module-sine

    pactl unload-module module-sine
    

if audio from module-sine is not broken, audio issue is probably caused by music player application
get pactl list-sink-inputs data for music player and compare to data for module-sine

I might mistype something, systemctl --user restart pulseaudio works now…

systemctl --user -l --no-pager status pulseaudio.socket pulseaudio.service seems only complain about battery feature

● pulseaudio.socket - Sound System
Loaded: loaded (/usr/lib/systemd/user/pulseaudio.socket; enabled; preset: enabled)
Active: active (running) since Sun 2023-09-10 11:08:42 CST; 22min ago
Triggers: ● pulseaudio.service
Listen: /run/user/1000/pulse/native (Stream)
CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/pulseaudio.socket

Sep 10 11:08:42 thinkbook systemd[883]: Listening on Sound System.

● pulseaudio.service - Sound Service
Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; disabled; preset: enabled)
Active: active (running) since Sun 2023-09-10 11:30:36 CST; 15s ago
TriggeredBy: ● pulseaudio.socket
Main PID: 10929 (pulseaudio)
Tasks: 12 (limit: 33281)
Memory: 10.5M
CPU: 76ms
CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pulseaudio.service
├─10929 /usr/bin/pulseaudio --daemonize=no --log-target=journal
└─10943 /usr/lib/pulse/gsettings-helper

Sep 10 11:30:36 thinkbook systemd[883]: Starting Sound Service...
Sep 10 11:30:36 thinkbook pulseaudio[10929]: stat('/etc/pulse/default.pa.d'): No such file or directory
Sep 10 11:30:36 thinkbook systemd[883]: Started Sound Service.
Sep 10 11:30:36 thinkbook pulseaudio[10929]: Could not find org.bluez.BatteryProviderManager1.RegisterBatteryProvider(), is bluetoothd started with experimental features enabled (-E flag)?

And module-sine got sound like this: Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.
So it seems the reason goes deeper than music player.

stat('/etc/pulse/default.pa.d'): No such file or directory

is just a warning message and can be ignored

PulseAudio 15.0 release notes - The startup script can now read additional configuration from the /etc/pulse/default.pa.d/ directory
there is now an include directive that loads files from /etc/pulse/default.pa.d/ or /etc/pulse/system.pa.d/. This is primarily meant for distributions when they want to add some module to the configuration when installing a package

Test recording is very quiet, but no audible distortion. If audio is dropping out for module-sine it is likely to drop out for other sink-inputs

The only other thing I can think to try that might remediate this issue within PulseAudio is to disable switching to headset mode using auto_switch option for module-bluetooth-policy

sudo sed -i 's/load-module module-bluetooth-policy/load-module module bluetooth-policy auto_switch=0/g' /etc/pulse/default.pa

and restart PulseAudio

systemctl --user restart pulseaudio

If that does not work, use this command to remove auto_switch option

sudo sed -i 's/bluetooth-policy auto_switch=0/bluetooth-policy/g' /etc/pulse/default.pa

and try using devices with a different Bluetooth wireless adapter