Skip to main content
Topic: Speakers buzz until unplugged / plugged back in (Read 385 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Speakers buzz until unplugged / plugged back in

This happens every boot.  If i forget to turn the speakers down it is a very loud buzzing.  Speakers do not work until I unplug then from 3.5mm jack and plug back in.  Here's the fun part, this output is exactly the same from before (not working) and after (working). 

pactl list sinks

The only diff below is the latency line.  Everything else is identical.

Latency: 23913 usec, configured 23220 usec

Before (speakers buzzing)

Code: [Select]
$pactl list sinks
Sink #0
        State: SUSPENDED
        Name: alsa_output.pci-0000_05_00.1.hdmi-stereo
        Description: Renoir Radeon High Definition Audio Controller Digital Stereo (HDMI)
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 6
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: alsa_output.pci-0000_05_00.1.hdmi-stereo.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY SET_FORMATS
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ED320QR S"
                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 0xd04c8000 irq 77"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:05:00.1"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:05:00.1/sound/card0"
                device.bus = "pci"
                device.vendor.id = "1002"
                device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
                device.product.id = "1637"
                device.product.name = "Renoir Radeon High Definition Audio Controller"
                device.string = "hdmi:0"
                device.buffering.buffer_size = "352768"
                device.buffering.fragment_size = "176384"
                device.access_mode = "mmap+timer"
                device.profile.name = "hdmi-stereo"
                device.profile.description = "Digital Stereo (HDMI)"
                device.description = "Renoir Radeon High Definition Audio Controller Digital Stereo (HDMI)"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Ports:
                hdmi-output-0: HDMI / DisplayPort (type: HDMI, priority: 5900, available)
        Active Port: hdmi-output-0
        Formats:
                pcm

Sink #2
        State: RUNNING
        Name: alsa_output.pci-0000_05_00.6.analog-stereo
        Description: Family 17h/19h HD Audio Controller Analog Stereo
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 7
        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: alsa_output.pci-0000_05_00.6.analog-stereo.monitor
        Latency: 23913 usec, configured 23220 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 = "ALC256 Analog"
                alsa.id = "ALC256 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 0xd04c0000 irq 78"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:05:00.6"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:05: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 = "front:1"
                device.buffering.buffer_size = "352768"
                device.buffering.fragment_size = "176384"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                device.description = "Family 17h/19h HD Audio Controller Analog Stereo"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Ports:
                analog-output-speaker: Speakers (type: Speaker, priority: 10000, not available)
                analog-output-headphones: Headphones (type: Headphones, priority: 9900, availability group: Legacy 2, availability unknown)
        Active Port: analog-output-headphones
        Formats:
                pcm

After unplug / replug (working)

Code: [Select]
$pactl list sinks
Sink #0
        State: SUSPENDED
        Name: alsa_output.pci-0000_05_00.1.hdmi-stereo
        Description: Renoir Radeon High Definition Audio Controller Digital Stereo (HDMI)
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 6
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: alsa_output.pci-0000_05_00.1.hdmi-stereo.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY SET_FORMATS
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ED320QR S"
                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 0xd04c8000 irq 77"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:05:00.1"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:05:00.1/sound/card0"
                device.bus = "pci"
                device.vendor.id = "1002"
                device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
                device.product.id = "1637"
                device.product.name = "Renoir Radeon High Definition Audio Controller"
                device.string = "hdmi:0"
                device.buffering.buffer_size = "352768"
                device.buffering.fragment_size = "176384"
                device.access_mode = "mmap+timer"
                device.profile.name = "hdmi-stereo"
                device.profile.description = "Digital Stereo (HDMI)"
                device.description = "Renoir Radeon High Definition Audio Controller Digital Stereo (HDMI)"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Ports:
                hdmi-output-0: HDMI / DisplayPort (type: HDMI, priority: 5900, available)
        Active Port: hdmi-output-0
        Formats:
                pcm

Sink #2
        State: RUNNING
        Name: alsa_output.pci-0000_05_00.6.analog-stereo
        Description: Family 17h/19h HD Audio Controller Analog Stereo
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 7
        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: alsa_output.pci-0000_05_00.6.analog-stereo.monitor
        Latency: 19430 usec, configured 23220 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 = "ALC256 Analog"
                alsa.id = "ALC256 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 0xd04c0000 irq 78"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:05:00.6"
                sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:05: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 = "front:1"
                device.buffering.buffer_size = "352768"
                device.buffering.fragment_size = "176384"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                device.description = "Family 17h/19h HD Audio Controller Analog Stereo"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Ports:
                analog-output-speaker: Speakers (type: Speaker, priority: 10000, not available)
                analog-output-headphones: Headphones (type: Headphones, priority: 9900, availability group: Legacy 2, availability unknown)
        Active Port: analog-output-headphones
        Formats:
                pcm

Re: Speakers buzz until unplugged / plugged back in

Reply #1
Hello,
I had a buzzing problem that I managed to get around:
https://forum.artixlinux.org/index.php/topic,2254.msg16656.html#msg16656

I have been using alsa only for several years.
I removed all pulse packets except libpulse and libcanberra.

I use alsa and the nice and very practical qastools mixer on different pc:
https://forum.artixlinux.org/index.php/topic,4318.msg27848.html#msg27848

Note: I don't play games and don't use wine or steam.
But I have sound in all my apps.

Re: Speakers buzz until unplugged / plugged back in

Reply #2
I also usually only use Alsa and have little experience with Pulse Audio, it has a reputation for being troublesome. However, perhaps you could try and find some command that mutes and unmutes, or sets the latency to the correct value, anything which will have the same effect as physically unplugging re-plugging the speakers. Then you could run those commands as a script that runs automatically at boot as a workaround. The man page for pactl shows some ideas.
https://wiki.artixlinux.org/Site/PipewireInsteadPulseaudio
If you are using unusual apps that won't run with Alsa alone, Pipewire can also replace Pulseaudio in most cases.

Re: Speakers buzz until unplugged / plugged back in

Reply #3
Thanks for the info I'll check this out.

3 things

1.  The buzz is WAY louder than if the speakers are just unplugged

2.  If I play music w/o doing the unplug replug I hear 95% buzz and 5% music.

3.  I tested again using cord (headphones) and it's messed up there also unless I unplug replug.


Re: Speakers buzz until unplugged / plugged back in

Reply #4
Quote
So, I did this :
sudo touch /etc/modprobe.d/audio_powersave.conf
sudo mousepad /etc/modprobe.d/audio_powersave.conf

And I put this:
# For HD audio cards:
options snd_hda_intel power_save=0

This was not the fix sadly

Re: Speakers buzz until unplugged / plugged back in

Reply #5
I can see that your system is Zen2 APU, but we need more info. Please provide full spec of the system (so CPU, Mobo, DE/WM, Kernel etc). You run on generic Realtek chip ALC256 and ALL, absolutely ALL of them have hardware bugs that prevent it from properly going idle with regards to "powersaving features" issues. You NEED to run this fix anyway, either you'll get buzzing noise whenever you don't use supply audio to the sink (so, literally listening anything) and then the driver tries to put it to sleep/idle. Also that that fix isn't proper, this should be it, actually:
Code: [Select]
options snd_hda_intel power_save_controller=N power_save=0
Also, if you care only about having sound without having any specific quirks about running the audio system, please migrate to pipewire, it is miles better than pulseaudio and it supplies it's own pulseaudio-capable (and JACK-capable) stack so you won't lose on anything. Here is how you can migrate to pipewire: https://wiki.artixlinux.org/Site/PipewireInsteadPulseaudio (ironic offtopic: gosh I just wait for the day redhat fucks pipewire up like they always do with their projects...)
Note:
Spoiler (click to show/hide)

Re: Speakers buzz until unplugged / plugged back in

Reply #6
Power save isnt the problem here.  When the buzzing happens I can still hear audio faintly.  Power save is disabled for audio, and made no difference in this issue.