8

My laptop model number is 15-bc051nr. I get a static-y noise in my left earphone whenever I listen to music on Ubuntu 16.04. Works fine on Windows though

HMK
  • 183

1 Answers1

9

Here's the fix that I found while googling for the issue. I too had the same issue regarding crackling sound from the left headphone speaker. The problem is related to Realtek's ALC 295 Audio Device.

Firstly install alsa and alsa-tools package :

sudo apt-get install -y alsa alsa-tools

Next, execute the following commands, copy pasting the whole code-block at once into bash (For newbies, we are essentially creating a bash script to make the necessary changes and then we'll execute the script every time our system wakes up from suspend or boots.) :

printf '#!/bin/bash
hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x67
hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x3000
' > sound-script.sh 
sudo chmod +x ./sound-script.sh && sudo ./sound-script.sh

Once, the above commands are executed successfully, check the sound. You may check it here for both the speakers : http://www.audiocheck.net/audiotests_stereo.php

If it resolves the issue, we are good to go. Now we want to make the script run everytime our system wakes up from suspend or boots. Execute the following commands :

##Make the script run on wakeup from suspend.
sudo mv ./sound-script.sh /lib/systemd/system-sleep/

Now, add the following line after doing sudo crontab -e

sudo crontab -e

Paste this line in the file :
@reboot /lib/systemd/system-sleep/sound-script.sh

And save the file and exit the editor. You can check if the cron job was successfully created or not by doing sudo crontab -l which returns a list of user-specified cron jobs.

Hope it helps. Thanks!

Source: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1648183

  • Hey I tried this but I keep getting permission denied. Why is that – HMK Sep 07 '17 at 15:31
  • You probably don't have the permissions to edit the file. Are you sure you are using sudo, or that you are the root user?

    Also, would you please elaborate on where you're getting stuck? Maybe, that way I'll be able to help you better.

    – Mayank Sharma Sep 14 '17 at 19:44
  • Thanks, it worked when I did from root. Why does this need to be run everytime the system reboots? – HMK Sep 14 '17 at 21:01
  • 1
    That's because you didn't schedule the job in crontab. I think you missed up some step after sudo crontab -e or maybe goofed up somewhere after that. You can check if you have the job properly scheduled using sudo crontab -l , wherein you will see @reboot /lib/systemd/system-sleep/sound-script.sh . If you're still stuck, you might have to google have to schedule cron jobs, depending upon which distro you are using. – Mayank Sharma Sep 15 '17 at 19:16
  • this does not work in 22.04 with HP Envy – con Jul 25 '23 at 23:55
  • @con try other solutions https://askubuntu.com/questions/1243369/sound-card-not-detected-ubuntu-20-04-sof-audio-pci/1424600 Adding options snd-hda-intel dmic_detect=0 to the end of the /etc/modprobe.d/alsa-base.conf` file fixed sound issue for me, but mic is still missing. – igor Aug 09 '23 at 10:58