You can use udev rules. For this, you'll need to find the device attributes that distinguish your USB headset once it is plugged in. This can be usually done in two steps:
udevadm monitor --udev befor plugging the device. Then plug it in. There will be a bunch of output lines - just pick one and copy the device path from it - it is something like
With the headset still connected, use
udevadm info --path=/your/device/path --attribute-walk to find some attributes that distinguish your device from others (like
When you have that, you can construct a udev rule to be triggered on connecting the device. Look at the files under
/etc/udev/rules.d/ for how these look like. The one you will probably be constructing will end with
command". Note that the identifiers (
ATTRS= etc.) used in such line must all come from the description of the same device - the same chunk of
udevadm info --attribute-walk output.
The second part of the task is to find
amixer settings that suits your needs for each scenario and wrap them in a command that you'll put in the
RUN+= part of udev rule. With that, I cannot help you as I don't have similar hardware.