y50-subwoofer-linux-enabler icon indicating copy to clipboard operation
y50-subwoofer-linux-enabler copied to clipboard

I don't know how to uninstall

Open aliemrenebiler opened this issue 4 years ago • 5 comments

I just wanted to uninstall it, but I don't know how..

aliemrenebiler avatar Jan 22 '21 23:01 aliemrenebiler

Me too. I used it with the default settings and it tore both speakers and the subwoofer after a few days. I ordered new parts and I want to clean everything before I install them.

It might be a nice utility if you actually really know what you are doing. For now though it's definitely not for me, and I want it out of the system.

divastor avatar Jan 26 '21 12:01 divastor

Removal of this script

DISCLAIMER

This removal guide HAS NOT BEEN TESTED, as my Lenovo Y50 is not my main laptop anymore and I only use Windows right now. It is written from the top of my head, but I also wrote how you can thoroughly verify if the script is removed at the end. I also apologize in advance that this is very long.

What I CAN'T be certain of however - since I can't test this - is if all the effects of the subwoofer script are reverted at the next reboot and so if everything is OK if you just remove it. You will have to check yourself in some way or another (e.g. by putting your ear on the subwoofer and listen for a hiss, for example), while at the same time making sure your speakers and subwoofers are safe before raising any volume. That means that the final recommended way to remove this script that I can give right now is to reinstall your Linux distribution of choice. However, this guide should indeed remove everything.

Going back with regards to resetting everything: what I remember for certain however is that if you rebooted to Windows, Windows indeed reconfigured the subwoofer to work properly so that when you rebooted back to Ubuntu it would be disabled properly again, when not using the script. This logic might mean that maybe it wasn't Windows but the reboot itself that reseted the subwoofer at every reboot, which is an assumption I am making that makes sense, but which I cannot test. Worst case scenario is that you go through this guide and the subwoofer is still enabled at the end, if you don't have Windows as a second boot to test.

Step 0: Mute everything

This steps assume the worst of the disclaimer, that the subwoofer will not be disabled completely at the end of this removal guide because it the changes it does every start might be permanent and I cannot give you the reset commands as I have no Linux on my Lenovo Y50 to test anymore.

First of all, mute the system any chance you got (e.g. every reboot, every moment you think the volume is high) and don't play any sounds. Disable system sounds and any sound that would run automatically, for good measure. That is, turn the volume to 0 for every app in the volume mixer (if you have one).

This is because:

  1. Just to be safe the script doesn't run as we remove it. If you're removing the script, you don't want it to trigger itself during its removal;

  2. You should remove this script completely and also be certain the subwoofer is completely muted at the END of the removal. The subwoofer should not give out any sound after uninstalling this script, and it would be very bad if the subwoofer remains with a high sound and you have no way anymore to control the volume of it as you removed this script.

Step 1: Identify that the script is running

From this link https://unix.stackexchange.com/a/408298 we learn that we can do the following, in order to see if the script is running in the background:

ps -fA | grep python

Something like the following should appear in your terminal

UID     PID   PPID  C STIME TTY      TIME     BIN                        CMD
user    3985  3960  0 19:46 pts/4    00:00:07 [PATH_TO_YOUR_PYTHON_HERE] python subwoofer.py

Take note of this.

Also, let's check if the service, which helps the script auto start and run in the background at every boot, is present and enabled.

If you installed the script in user mode, run this:

systemctl --user status subwoofer

If you installed the script in system mode, run this:

sudo systemctl status subwoofer

If you don't know in which mode you have installed the script, just run both commands and see which one does not give an error. If both of them DO NOT give out an error, then you might have both modes installed (which is unusual but nothing is stopping this). No worries, as the following guide should remove both modes regardless if you have the specific user or system mode of the script installed in your system or not.

Take note of what the systemctl status command gives out as well.

Step 2: Remove the service

Let's first remove the service that made this script start automatically every boot.

If you installed this in user mode, use these lines in your terminal to remove the service file that starts the script every startup:

systemctl --user stop subwoofer
systemctl --user disable subwoofer
sudo rm /etc/systemd/user/subwoofer.service

If you installed this in system mode, use these lines in your terminal to remove the service file that starts the script every startup:

sudo systemctl stop subwoofer
sudo systemctl disable subwoofer
sudo rm /etc/systemd/system/subwoofer.service

If you're not sure in which mode you installed, just run all 6 lines of commands. 3 of them should give a 'not found' type of error and 3 should not (unless you installed in both modes at some point, then all 6 should not give an error). It is okay to get 'not found' type of errors, as long as 3 of them go without any error as for now we expect that the service is indeed installed properly and needed to be removed.

After doing these commands once, do all them again and see if all of them give out 'not found' type of errors. If they do, that means the files are removed.

In order to double check, open the following paths with your favourite file manager on your Linux distribution and check the following paths for the file subwoofer.service: /etc/systemd/system/ and /etc/systemd/user. If the subwoofer.service file does not exist in any of the two paths, then you have successfully removed what was automatically starting the script at boot.

You can also check in the terminal with ls -la /etc/systemd/user/ and ls -la /etc/systemd/system/ commands.

If the errors mentioned that appear are of 'access denied' type, then you should run the following respectively for both 'user' and 'system' mode.

sudo rm -f /etc/systemd/user/subwoofer.service
sudo rm -f /etc/systemd/system/subwoofer.service

Then follow this step again from the beginning and be certain the 'subwoofer.service' files are gone.

Step 3: Remove the sleep trigger script

Next, let's remove the secondary helper script that was muting your subwoofer before it was going to sleep, so that it wouldn't make a "pop" noise as the subwoofer would power down in the process.

sudo rm /etc/pm/sleep.d/subwoofer.sh

This should go without any error.

Double check by running the command again. If it gives out a 'not found' error, then the file is most likely deleted.

To triple check, open the following path with your favourite file explorer: /etc/pm/sleep.d/ and look for the subwoofer.sh file. If the file is not there, then you have successfully removed it.

You can also run ls -la /etc/pm/sleep.d/ in your terminal and inspect the list appearing in the terminal for the file subwoofer.sh. If it's not there, it is removed.

Step 4: Remove the main script

To remove the main script itself, run the following in the terminal:

sudo rm /opt/subwoofer.py

Again, double check by running the command again and looking for 'not found' errors. Triple check with your favourite file explorer, looking in the /opt/ directory. Quadruple check by doing ls -la /opt in your terminal and inspecting the list for the subwoofer.py, which should not be there anymore.

At this point your speakers and subwoofer should be safe, as the main script is removed.

Step 5: Remove the file that lowers security with regards to changing the audio system and pins

By removing this, even if the script still exists, it should be blocked from even enabling the subwoofer.

Run the following in a terminal:

sudo rm /etc/sudoers.d/subwoofer

Again, double check by running the command again and looking for 'not found' errors. Triple check with your favourite file explorer, looking in the /etc/sudoers.d/ directory. Quadruple check by doing ls -la /etc/sudoers.d/ in your terminal and inspecting the list for the subwoofer file, which should not be there anymore.

Step 6: Check to see if the script is not running anymore

Mute the system and all apps you have running in the background (yes, one by one in the volume mixer) and reboot the system now.

Then, run the following:

ps -fA | grep python

Nothing with subwoofer.py should appear. That means the script is not running in the background anymore.

Also check:

sudo systemctl status subwoofer
systemctl --user status subwoofer

For both systemctl status commands, 'not found' errors should appear and nothing should show up as enabled and/or written in green or red. That means that what made the script start at the beginning of your computer is gone.

At this point, the script and its helper scripts and files should be completely removed.

dragosprju avatar Jan 26 '21 21:01 dragosprju

Apologies for writing the above guide in layman terms and overexplaining myself too much. I don't have a Linux at hand to test these commands, so I wrote how to do some things in more ways than one in case one method fails.

Since you confirmed the script is breaking the speakers and subwoofer if run on today's Linux distributions, I also wanted to make the guide clear for anyone visiting this project how to remove the script, regardless of their technical level.

I also didn't give any quick, short-and-sweet soltuion since it's best to be thorough and double-check that everything is deleted.

dragosprju avatar Jan 26 '21 21:01 dragosprju

I also am saddened to hear, @divastor, that this script has damaged your subwoofer and speakers. Due to this, I have noted on the README of this repository that this project is now DEPRECATED. I also made the README of this repository have much more obvious warnings that this script has big risks and is not recommended to be used anymore. I have also disabled the script by editing the settings to what I think are values that disable everything and commenting out some important commands that are at the heart of this script, which made the subwoofer work. This requires anyone who wants to use this script to be forced to go through it and run it at their own risk, which is what I wanted from the beginning.

The best way to fix the Lenovo Y50's subwoofer is by reporting this bug to ALSA, the audio driver for Linux. This is something that should have probably been done before this project even started. It seems eifr made a bug report about the Lenovo Y50's subwoofer not working already, which is here: https://bugzilla.kernel.org/show_bug.cgi?id=204833. It is dated 2019 and seems to have a high priority, and mentions this project. The way to go forward as of now is to reply to that bug report, therefore making the bug more visible to the ALSA developers, and raising the chances of fixing the Lenovo Y50's subwoofer.

dragosprju avatar Jan 26 '21 22:01 dragosprju

Thanks for your answer but I already uninstalled it. I basicly gave myself permission to delete subwoofer.py from deep down of the folders, it worked.


Kimden: Dragoș Perju [email protected] Gönderildi: 27 Ocak 2021 Çarşamba 00:43 Kime: dragosprju/y50-subwoofer-linux-enabler Bilgi: Ali Emre Nebiler; Author Konu: Re: [dragosprju/y50-subwoofer-linux-enabler] I don't know how to uninstall (#8)

Removal of this script DISCLAIMER

This removal guide HAS NOT BEEN TESTED, as my Lenovo Y50 is not my main laptop anymore and I only use Windows right now. It is written from the top of my head, but I also wrote how you can thoroughly verify if the script is removed at the end. I also apologize in advance that this is very long.

What I CAN'T be certain of however - since I can't test this - is if all the effects of the subwoofer script are reverted at the next reboot and so if everything is OK if you just remove it. You will have to check yourself in some way or another (e.g. by putting your ear on the subwoofer and listen for a hiss, for example), while at the same time making sure your speakers and subwoofers are safe before raising any volume. That means that the final recommended way to remove this script that I can give right now is to reinstall your Linux distribution of choice. However, this guide should indeed remove everything.

Going back with regards to resetting everything: what I remember for certain however is that if you rebooted to Windows, Windows indeed reconfigured the subwoofer to work properly so that when you rebooted back to Ubuntu it would be disabled properly again, when not using the script. This logic might mean that maybe it wasn't Windows but the reboot itself that reseted the subwoofer at every reboot, which is an assumption I am making that makes sense, but which I cannot test. Worst case scenario is that you go through this guide and the subwoofer is still enabled at the end, if you don't have Windows as a second boot to test.

Step 0: Mute everything

This steps assume the worst of the disclaimer, that the subwoofer will not be disabled completely at the end of this removal guide because it the changes it does every start might be permanent and I cannot give you the reset commands as I have no Linux on my Lenovo Y50 to test anymore.

First of all, mute the system any chance you got (e.g. every reboot, every moment you think the volume is high) and don't play any sounds. Disable system sounds and any sound that would run automatically, for good measure. That is, turn the volume to 0 for every app in the volume mixer (if you have one).

This is because:

  1. Just to be safe the script doesn't run as we remove it. If you're removing the script, you don't want it to trigger itself during its removal;

  2. You should remove this script completely and also be certain the subwoofer is completely muted at the END of the removal. The subwoofer should not give out any sound after uninstalling this script, and it would be very bad if the subwoofer remains with a high sound and you have no way anymore to control the volume of it as you removed this script.

Step 1: Identify that the script is running

From this link https://unix.stackexchange.com/a/408298 we learn that we can do the following, in order to see if the script is running in the background:

ps -fA | grep python

Something like the following should appear in your terminal

UID PID PPID C STIME TTY TIME BIN CMD user 3985 3960 0 19:46 pts/4 00:00:07 [PATH_TO_YOUR_PYTHON_HERE] python subwoofer.py

Take note of this.

Also, let's check if the service, which helps the script auto start and run in the background at every boot, is present and enabled.

If you installed the script in user mode, run this:

systemctl --user status subwoofer

If you installed the script in system mode, run this:

sudo systemctl status subwoofer

If you don't know in which mode you have installed the script, just run both commands and see which one does not give an error. If both of them DO NOT give out an error, then you might have both modes installed (which is unusual but nothing is stopping this). No worries, as the following guide should remove both modes regardless if you have the specific user or system mode of the script installed in your system or not.

Take note of what the systemctl status command gives out as well.

Step 2: Remove the service

Let's first remove the service that made this script start automatically every boot.

If you installed this in user mode, use these lines in your terminal to remove the service file that starts the script every startup:

systemctl --user stop subwoofer systemctl --user disable subwoofer sudo rm /etc/systemd/user/subwoofer.service

If you installed this in system mode, use these lines in your terminal to remove the service file that starts the script every startup:

sudo systemctl stop subwoofer sudo systemctl disable subwoofer sudo rm /etc/systemd/system/subwoofer.service

If you're not sure in which mode you installed, just run all 6 lines of commands. 3 of them should give a 'not found' type of error and 3 should not (unless you installed in both modes at some point, then all 6 should not give an error). It is okay to get 'not found' type of errors, as long as 3 of them go without any error as for now we expect that the service is indeed installed properly and needed to be removed.

After doing these commands once, do all them again and see if all of them give out 'not found' type of errors. If they do, that means the files are removed.

In order to double check, open the following paths with your favourite file manager on your Linux distribution and check the following paths for the file subwoofer.service: /etc/systemd/system/ and /etc/systemd/user. If the subwoofer.service file does not exist in any of the two paths, then you have successfully removed what was automatically starting the script at boot.

You can also check in the terminal with ls -la /etc/systemd/user/ and ls -la /etc/systemd/system/ commands.

If the errors mentioned that appear are of 'access denied' type, then you should run the following respectively for both 'user' and 'system' mode.

sudo rm -f /etc/systemd/user/subwoofer.service sudo rm -f /etc/systemd/system/subwoofer.service

Then follow this step again from the beginning and be certain the 'subwoofer.service' files are gone.

Step 3: Remove the sleep trigger script

Next, let's remove the secondary helper script that was muting your subwoofer before it was going to sleep, so that it wouldn't make a "pop" noise as the subwoofer would power down in the process.

sudo rm /etc/pm/sleep.d/subwoofer.sh

This should go without any error.

Double check by running the command again. If it gives out a 'not found' error, then the file is most likely deleted.

To triple check, open the following path with your favourite file explorer: /etc/pm/sleep.d/ and look for the subwoofer.sh file. If the file is not there, then you have successfully removed it.

You can also run ls -la /etc/pm/sleep.d/ in your terminal and inspect the list appearing in the terminal for the file subwoofer.sh. If it's not there, it is removed.

Step 4: Remove the main script

To remove the main script itself, run the following in the terminal:

sudo rm /opt/subwoofer.py

Again, double check by running the command again and looking for 'not found' errors. Triple check with your favourite file explorer, looking in the /opt/ directory. Quadruple check by doing ls -la /opt in your terminal and inspecting the list for the subwoofer.py, which should not be there anymore.

At this point your speakers and subwoofer should be safe, as the main script is removed.

Step 5: Remove the file that lowers security with regards to changing the audio system and pins

By removing this, even if the script still exists, it should be blocked from even enabling the subwoofer.

Run the following in a terminal:

sudo rm /etc/sudoers.d/subwoofer

Again, double check by running the command again and looking for 'not found' errors. Triple check with your favourite file explorer, looking in the /etc/sudoers.d/ directory. Quadruple check by doing ls -la /etc/sudoers.d/ in your terminal and inspecting the list for the subwoofer file, which should not be there anymore.

Step 6: Check to see if the script is not running anymore

Mute the system and all apps you have running in the background (yes, one by one in the volume mixer) and reboot the system now.

Then, run the following:

ps -fA | grep python

Nothing with subwoofer.py should appear. That means the script is not running in the background anymore.

Also check:

sudo systemctl status subwoofer systemctl --user status subwoofer

For both systemctl status commands, 'not found' errors should appear and nothing should show up as enabled and/or written in green or red. That means that what made the script start at the beginning of your computer is gone.

At this point, the script and its helper scripts and files should be completely removed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dragosprju/y50-subwoofer-linux-enabler/issues/8#issuecomment-767846568, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APSYH2JVFKFDZWS5JLK7PVTS34ZO3ANCNFSM4WPFBUIA.

aliemrenebiler avatar Jan 26 '21 22:01 aliemrenebiler