A simple Bash script for controlling the HyperX SoloCast USB microphone on Linux. It allows you to easily turn the microphone on/off, adjust volume levels, and check its status from the command line.
SoloCastControl is ideal for automation tasks where microphone control needs to be scripted or triggered programmatically.
- Turn microphone on/off: Quickly enable or disable the microphone capture.
- Toggle microphone state: Switch between on and off with a single command.
- Set volume: Adjust the microphone volume to a specific percentage (0-100%).
- Increase/Decrease volume: Increment or decrement volume by 10% steps.
- Get status: Display the current microphone state (on/off) and volume level in percentage.
- Fallback card selection: If the SoloCast isn't detected, prompts for manual selection from available sound cards.
- Customizable controls: Override default ALSA control names via environment variables.
- Error handling: Checks for
amixeravailability and handles command failures gracefully.
- Operating System: Linux (tested on Arch / Debian-based systems like Manjaro / Ubuntu).
- Dependencies:
alsa-utils(for theamixercommand).bash,grep,awk,sed(usually pre-installed).
- Clone the repository:
git clone https://github.com/Mr-Precise/SoloCastControl cd SoloCastControl - Copy to a directory in your PATH (e.g.,
/usr/binor~/.local/bin):sudo cp SoloCastControl.sh /usr/bin/solocastcontrol
The repository includes a Makefile for easy installation.
- Clone the repository as above.
- Install:
This installs the script as
sudo make install
/usr/bin/solocastcontrol. You can customize with:PREFIX=/usrfor system-wide installation.DESTDIR=`pwd`/pathfor staging.
To uninstall:
sudo make uninstallFor Debian-based systems, you can build and install a .deb package.
- Install build tools:
sudo apt install dh-make debhelper devscripts lintian
- Prepare the source (assuming you have the tarball or repository).
- Build the package:
debuild -us -uc
- Install the resulting
.deb:sudo dpkg -i ../solocastcontrol_1.0-1_all.deb
For Arch Linux users, a PKGBUILD file is included in the repository to build and install the script as a package (named solocastcontrol-git) using makepkg. This fetches the latest version from Git and installs it system-wide.
- Install build dependencies if needed:
sudo pacman -S --needed git base-devel - Build and install the package:
makepkg -si-s: Installs any missing dependencies automatically.-i: Installs the built package.
Run the script with one of the following commands:
solocastcontrol on # Turn on microphone
solocastcontrol off # Turn off microphone
solocastcontrol toggle # Toggle microphone state
solocastcontrol set <0-100> # Set volume (e.g., solocastcontrol set 50)
solocastcontrol up # Increase volume by 10%
solocastcontrol down # Decrease volume by 10%
solocastcontrol get # Get current status and volume
-
Turn on the microphone:
solocastcontrol onOutput: Microphone on (in green)
-
Set volume to 75%:
solocastcontrol set 75Output: Volume set to 75% (4224/5632) # Values depend on your hardware
-
Get status:
solocastcontrol getOutput:
Microphone status: on # In green if on, red if off Volume: 100% (5632/5632)
- Custom ALSA Controls: If your microphone uses different control names, set environment variables:
MIC_VOLUME_CONTROL="Capture Volume" MIC_SWITCH_CONTROL="Capture Switch" solocastcontrol get - Debugging: If issues arise, check
amixer -c <card_id> controlsto verify control names.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.