This repository provides a script and systemd service to monitor and fix audio issues on Huawei MateBook laptops running Linux. The script uses inotifywait
to monitor sound device access and executes hda-verb
commands to adjust audio settings.
Before running the installation script, ensure you have the following dependencies installed:
inotify-tools
hda-verb
systemd
You can install these dependencies using your package manager. For example, on Debian-based systems:
sudo apt-get update
sudo apt-get install inotify-tools hda-verb
To install the audio fix, follow these steps:
-
Clone this repository:
git clone https://github.com/yourusername/linux-matebook-audio-fix.git cd linux-matebook-audio-fix
-
Run the installation script:
chmod +x install.sh ./install.sh
The installation script performs the following actions:
- Creates a monitor script (
~/.monitor_sound.sh
) that usesinotifywait
to watch for access to the/dev/snd/
directory. When access is detected, it runshda-verb
commands to adjust the audio settings. - Makes the monitor script executable.
- Creates a systemd service file (
/etc/systemd/system/monitor_sound.service
) to run the monitor script as a service. - Reloads the systemd daemon to recognize the new service.
- Enables the service to start on boot.
After installation, the service should start automatically. You can manage the service using systemctl
:
-
Start the service:
sudo systemctl start monitor_sound
-
Stop the service:
sudo systemctl stop monitor_sound
-
Check the status of the service:
sudo systemctl status monitor_sound
-
Enable the service to start on boot:
sudo systemctl enable monitor_sound
-
Disable the service from starting on boot:
sudo systemctl disable monitor_sound
Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or fixes.
This project is licensed under the MIT License. See the LICENSE file for details.