Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2180  / 1 Year ago, fri, april 28, 2023, 5:41:59

I have migrated to Ubuntu from Windows recently. It has been a great experience. But, one thing annoyed me the most and that is the headphones noise issue. It is a very common problem and I have almost gone through every question asked about this issue on the forum. I am using Ubuntu 16.04.1 on my DELL INSPIRON 15 3542 touchscreen laptop.



I have tried :




  • alsamixer and disabling the Loopback Mixing

  • Adding 0 in the /sys/module/snd_hda_intel/parameters/power_save file


  • INTEL_AUDIO_POWERSAVE=false
    in /usr/lib/pm-utils/power.d/intel-audio-powersave




Nothing worked, not even temporarily.






Now, what I have observed is whenever I open the PulseAudio Volume Controller and keep it open, the noise is gone! As soon as the application is closed, the noise comes back. So, this seems to work temporarily and a cheap solution. Can anyone look into this matter and come up with a permanent solution for the issue?


More From » 16.04

 Answers
7

A lot of users are facing noise problem when headphones are connected and are fed up with it just like I am. This solution is for them. There are a lot of solutions given on askubuntu but none have worked for me.



Things were good when I used Windows 8.1. There was no such sound issue. Well, but now I am on Ubuntu and I have no plans of going back to Windows.



I have accepted the fact that my laptop's sound system is not shielded properly.
I haven't addressed the root of the problem, but just kind of made it a virtually unnoticable.



So, the hack is quite simple. As the problem persists only when there is no playback, I came up with a hack to always have a playback!
Now, this should be true only when the headphones are connected. And the playback should stop when headphones are removed.



Follow these simple steps-



Step #1: Install mplayer and configure it.



sudo apt install mplayer    
nano ~/.mplayer/config


type in that file-> lirc=no



Step #2: Download this mp3 file from here (silence-10sec.mp3)



Step #3: Create a folder in home directory and name it .hush

Copy the mp3 file in your .hush directory



cp ~/Downloads/silence-10sec.mp3 ~/.hush/


In that folder, create a script file and name it silence.sh

Copy paste this code in the script file.



#!/bin/bash

plugged="jack/headphone HEADPHONE plug"
unplugged="jack/headphone HEADPHONE unplug"

acpi_listen | while IFS= read -r event;
do
if [ "$event" == "$plugged" ]
then
mplayer -really-quiet -loop 0 ~/.scripts/silence-10sec.mp3 &
elif [ "$event" == "$unplugged" ]
then
pkill -f mplayer
fi
done


Make it executable with the command chmod +755 silence.sh



Step #4: Type startup applications in the Dash and add the path of silence.sh script to it.



enter image description here



So, basically what we are doing is listening to events of headphones been connected and disconnected and playing or stopping the blank mp3 file in a loop. Now, I have used mplayer because I know that I am never gonna use that for any other purpose and killing its process is completely safe for me.



I came up with this idea when Serg answered to one of my questions.

He came up with this script and I just made modifications to it to suite the requirement.


[#12804] Saturday, April 29, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rontablis

Total Points: 293
Total Questions: 123
Total Answers: 104

Location: Austria
Member since Mon, Mar 1, 2021
3 Years ago
;