Skip to content

Commit

Permalink
Merge pull request #10 from EugenMayer/features/improve-scripts
Browse files Browse the repository at this point in the history
Fix/improve install script
  • Loading branch information
evilphish authored May 1, 2020
2 parents 5708dbf + 79b0d22 commit ecc6ea9
Show file tree
Hide file tree
Showing 6 changed files with 282 additions and 21 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@ Getting the Sennheiser GSX 1000 / 1200 Pro DAC to work under Linux
![pavucontrol two](https://raw.githubusercontent.com/evilphish/sennheiser-gsx-1000/master/images/pavucontrol2.png)

## Installation

Get the repo
```
git clone https://github.com/evilphish/sennheiser-gsx-1000
cd sennheiser-gsx-1000
```

Then just run

```
# gsx-1000
./install.sh
# gsx-1200
./install.sh 1200
```

You might need to consider to install the channel-swap variant if your center seems "lefty" or your subfoover feels "righty" see [this issue](https://github.com/evilphish/sennheiser-gsx-1000/issues/9)

## Deinstallation

```
# gsx-1000
./uninstall.sh
# gsx-1200
./uninstall.sh 1200
```

## Manual Installation
Copy sennheiser-gsx-1000.conf or sennheiser-gsx-1200.conf to `/usr/share/pulseaudio/alsa-mixer/profile-sets/`

Copy 91-pulseaudio-gsx1000.rules or 91-pulseaudio-gsx-1200.rules to `/lib/udev/rules.d/`
Expand Down
12 changes: 0 additions & 12 deletions install-1200.sh

This file was deleted.

59 changes: 50 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,53 @@
sudo cp etc/X11/xorg.conf.d/40-sennheiser-gsx-1000.conf /etc/X11/xorg.conf.d
sudo cp lib/udev/rules.d/91-pulseaudio-gsx1000.rules /lib/udev/rules.d/
sudo cp -r usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-1000.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/
#!/bin/bash

set -e
type=${1:-1000}

echo "Installing GSX-$type"

echo "Installing X11 config"
if [ -f /etc/debian_version ]; then
echo "- Debian/Ubuntu base"
sudo cp usr/share/X11/xorg.conf.d/40-sennheiser-gsx-$type.conf /usr/share/X11/xorg.conf.d/
else
echo "- Assuming arch base"
sudo cp usr/share/X11/xorg.conf.d/40-sennheiser-gsx-$type.conf /etc/X11/xorg.conf.d/
fi

echo "Installing udev rule"
sudo cp lib/udev/rules.d/91-pulseaudio-gsx$type.rules /lib/udev/rules.d/

echo "Installing pulsaudio profiles"
read -p "Should we install the channelswap-fix, see https://github.com/evilphish/sennheiser-gsx-1000/issues/9 (y for yes, n [default])? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
sudo cp -r usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-$type-channelswap.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/
echo "- installed channel-swap mix"
else
sudo cp -r usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-$type.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/
echo "- installed normal channel mix"
fi


echo "Reloading udev rules"
sudo udevadm control -R
sudo udevadm trigger

pulseaudio -k
pulseaudio -k
pulseaudio -k
sleep 2
pulseaudio -k
pulseaudio -D
read -p "SKIP pulseaudio be restart () (y for yes, n [default])? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Skipped pulseaudio restart"
else
echo "Restarting pulse audio"
# ignore errors if we restart too often / to fast .. we just ensure to nuke it
pulseaudio -k > /dev/null 2>&1 || true
pulseaudio -k > /dev/null 2>&1 || true
pulseaudio -k > /dev/null 2>&1 || true

echo "Ensure pulseaudio is started"
sleep 2
pulseaudio -D
fi

32 changes: 32 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -e
type=${1:-1000}

echo "Uninstalling GSX-$type"

sudo rm -f /usr/share/X11/xorg.conf.d/40-sensheiser-gsx-$type.conf
sudo rm -f /etc/X11/xorg.conf.d/40-sensheiser-gsx-$type.conf
sudo rm -f /lib/udev/rules.d/91-pulseaudio-gsx$type.rules
sudo rm -f /usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-$type.conf

echo "Reloading udev rules"
sudo udevadm control -R
sudo udevadm trigger

read -p "Should pulseaudio be restarted (y for yes)? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Restart pulse audio"
pulseaudio -k > /dev/null 2>&1 || true
pulseaudio -k > /dev/null 2>&1 || true
pulseaudio -k > /dev/null 2>&1 || true

echo "Ensure pulseaudio is started"
sleep 2
pulseaudio -D
else
echo "Skipped pulseaudio restart"
fi

Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#########################################################################
# Configuration file for the Sennheiser GSX 1000 #
# by Alexander Heuer <evilphish@phishtank.de> #
#########################################################################
# With this device, regarding sinks, #
# hw:1,0 is the mono "chat" output useful for mumble or similar voice #
# programs. Its offset from the main volume can be controlled #
# with an extra volume knob on the side of the device. #
# hw:1,1 is the main 7.1 channel surround output into the device and #
# is controlled directly via the main volume knob. #
# #
# Regarding sources, hw:1,0 is the microphone input. #
# #
# This configuration enables two output devices labeled "main output" #
# and "chat output" with respect to the two previously mentioned sinks. #
# #
# If you have troubles with your distributions volume control, use the #
# pulseaudio pavucontrol program #
#########################################################################
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License v2 as published #
# by the Free Software Foundation. #
# #
# This program is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
# General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
#########################################################################

[General]
auto-profiles = no

[Mapping analog-output-surround71]
description = main output
device-strings = hw:CARD=GSX1000,DEV=1
#device-strings = hw:%f,1
channel-map = front-left,front-right,front-center,lfe,rear-left,rear-right,side-left,side-right
paths-output = analog-output analog-output-lineout analog-output-speaker
priority = 2

[Mapping analog-output-chat]
description = chat output
device-strings = hw:CARD=GSX1000,DEV=0
#device-strings = hw:%f,0
channel-map = mono
paths-output = analog-output-headphones analog-output-headphones-2 analog-output-mono
priority = 1


[Mapping analog-input]
description = microphone input
device-strings = hw:CARD=GSX1000,DEV=0
#device-strings = hw:%f,0
channel-map = mono
paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headset-mic
priority = 2

# Combined output profile
[Profile output:analog-output-surround71+output:analog-output-chat+input:analog-input]
description = 7.1 Surround
output-mappings = analog-output-surround71 analog-output-chat
input-mappings = analog-input
priority = 88
skip-probe = yes

# If you do not want two devices but only one with a switchable profile
# (don't know why you would want that) uncomment the following two
# blocks and comment the one block above this comment.

#[Profile output:analog-output-surround71+input:analog-input]
#description = 7.1 Surround
#output-mappings = analog-output-surround71
#input-mappings = analog-input
#priority = 88
#skip-probe = yes
#
#[Profile output:analog-output-chat]
#description = chat output
#output-mappings = analog-output-chat
#input-mappings = analog-input
#priority = 80
#skip-probe = yes
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#########################################################################
# Configuration file for the Sennheiser GSX 1200 #
# by Alexander Heuer <evilphish@phishtank.de> #
#########################################################################
# With this device, regarding sinks, #
# hw:1,0 is the mono "chat" output useful for mumble or similar voice #
# programs. Its offset from the main volume can be controlled #
# with an extra volume knob on the side of the device. #
# hw:1,1 is the main 7.1 channel surround output into the device and #
# is controlled directly via the main volume knob. #
# #
# Regarding sources, hw:1,0 is the microphone input. #
# #
# This configuration enables two output devices labeled "main output" #
# and "chat output" with respect to the two previously mentioned sinks. #
# #
# If you have troubles with your distributions volume control, use the #
# pulseaudio pavucontrol program #
#########################################################################
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License v2 as published #
# by the Free Software Foundation. #
# #
# This program is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
# General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
#########################################################################

[General]
auto-profiles = no

[Mapping analog-output-surround71]
description = main output
device-strings = hw:CARD=GSX1200,DEV=1
#device-strings = hw:%f,1
channel-map = front-left,front-right,front-center,lfe,rear-left,rear-right,side-left,side-right
paths-output = analog-output analog-output-lineout analog-output-speaker
priority = 2

[Mapping analog-output-chat]
description = chat output
device-strings = hw:CARD=GSX1200,DEV=0
#device-strings = hw:%f,0
channel-map = mono
paths-output = analog-output-headphones analog-output-headphones-2 analog-output-mono
priority = 1


[Mapping analog-input]
description = microphone input
device-strings = hw:CARD=GSX1200,DEV=0
#device-strings = hw:%f,0
channel-map = mono
paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headset-mic
priority = 2

# Combined output profile
[Profile output:analog-output-surround71+output:analog-output-chat+input:analog-input]
description = 7.1 Surround
output-mappings = analog-output-surround71 analog-output-chat
input-mappings = analog-input
priority = 88
skip-probe = yes

# If you do not want two devices but only one with a switchable profile
# (don't know why you would want that) uncomment the following two
# blocks and comment the one block above this comment.

#[Profile output:analog-output-surround71+input:analog-input]
#description = 7.1 Surround
#output-mappings = analog-output-surround71
#input-mappings = analog-input
#priority = 88
#skip-probe = yes
#
#[Profile output:analog-output-chat]
#description = chat output
#output-mappings = analog-output-chat
#input-mappings = analog-input
#priority = 80
#skip-probe = yes

0 comments on commit ecc6ea9

Please sign in to comment.