summaryrefslogtreecommitdiffstats
path: root/core/modules/alsa
diff options
context:
space:
mode:
authorSebastian2016-04-25 12:01:08 +0200
committerSebastian2016-04-25 12:01:08 +0200
commit5acda3eaeabae9045609539303a8c12c4ce401f1 (patch)
tree7e71975f8570b05aafe2ea6ec0e242a8912387bb /core/modules/alsa
parentinitial commit (diff)
downloadmltk-5acda3eaeabae9045609539303a8c12c4ce401f1.tar.gz
mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.tar.xz
mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.zip
merge with latest dev version
Diffstat (limited to 'core/modules/alsa')
-rw-r--r--core/modules/alsa/data/etc/systemd/system/alsa-default-card.service11
l---------core/modules/alsa/data/etc/systemd/system/multi-user.target.wants/alsa-default-card.service1
-rwxr-xr-xcore/modules/alsa/data/opt/openslx/scripts/alsa-default_card42
-rw-r--r--core/modules/alsa/module.build19
-rw-r--r--core/modules/alsa/module.conf8
-rw-r--r--core/modules/alsa/module.conf.debian10
-rw-r--r--core/modules/alsa/module.conf.fedora13
-rw-r--r--core/modules/alsa/module.conf.opensuse10
-rw-r--r--core/modules/alsa/module.conf.scientific12
-rw-r--r--core/modules/alsa/module.conf.ubuntu7
-rw-r--r--core/modules/alsa/module.conf.ubuntu.126
11 files changed, 139 insertions, 0 deletions
diff --git a/core/modules/alsa/data/etc/systemd/system/alsa-default-card.service b/core/modules/alsa/data/etc/systemd/system/alsa-default-card.service
new file mode 100644
index 00000000..db35eeb7
--- /dev/null
+++ b/core/modules/alsa/data/etc/systemd/system/alsa-default-card.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Set default card ALSA will use
+DefaultDependencies=no
+After=tmp.target
+Wants=tmp.target
+
+[Service]
+Type=oneshot
+ExecStart=/opt/openslx/scripts/alsa-default_card
+RemainAfterExit=yes
+
diff --git a/core/modules/alsa/data/etc/systemd/system/multi-user.target.wants/alsa-default-card.service b/core/modules/alsa/data/etc/systemd/system/multi-user.target.wants/alsa-default-card.service
new file mode 120000
index 00000000..55e393fd
--- /dev/null
+++ b/core/modules/alsa/data/etc/systemd/system/multi-user.target.wants/alsa-default-card.service
@@ -0,0 +1 @@
+../alsa-default-card.service \ No newline at end of file
diff --git a/core/modules/alsa/data/opt/openslx/scripts/alsa-default_card b/core/modules/alsa/data/opt/openslx/scripts/alsa-default_card
new file mode 100755
index 00000000..214a4d73
--- /dev/null
+++ b/core/modules/alsa/data/opt/openslx/scripts/alsa-default_card
@@ -0,0 +1,42 @@
+#!/bin/ash
+PATH=$PATH:/opt/openslx/sbin:/opt/openslx/bin
+
+PROC="/proc/asound/cards"
+
+if [ ! -r "$PROC" ]; then
+ echo "'${PROC}' not found or not readable."
+ exit 1
+fi
+
+if [ -w "/etc" ]; then
+ FILE="/etc/asound.conf"
+elif [ -n "$HOME" ]; then
+ FILE="${HOME}/.asoundrc"
+else
+ FILE="$(getent passwd root | awk -F ':' '{print $6}')/.asoundrc"
+fi
+
+if [ -e "${FILE}" -a "x$1" != "x--force" ]; then
+ echo "'${FILE}' already exists, use --force to overwrite."
+ exit 1
+fi
+
+# Try to filter HDMI cards first
+CARD=$(grep -v -i 'HDMI' "${PROC}" | grep -E -o '^[[:space:]]*[0-9]+[[:space:]]+' | head -n 1)
+# If empty, try again with all
+[ -z "${CARD}" ] && CARD=$(cat "${PROC}" | grep -E -o '^[[:space:]]*[0-9]+[[:space:]]+' | head -n 1)
+
+if [ -z "${CARD}" ]; then
+ echo "No sound card found."
+ exit 1
+fi
+
+cat > "${FILE}" <<HEREDOC
+defaults.pcm.!card $CARD
+defaults.ctl.!card $CARD
+
+defaults.pcm.!device 0
+defaults.ctl.!device 0
+
+HEREDOC
+
diff --git a/core/modules/alsa/module.build b/core/modules/alsa/module.build
new file mode 100644
index 00000000..4d3990b1
--- /dev/null
+++ b/core/modules/alsa/module.build
@@ -0,0 +1,19 @@
+fetch_source() {
+ :
+}
+
+build() {
+ COPYLIST="list_dpkg_output"
+ [ -e "$COPYLIST" ] && rm "$COPYLIST"
+
+
+ # These shitty greps are 'excludes' for this high quality scientific linux.
+ list_packet_files | grep -v "^/etc/asound.state" \
+ | grep -v "^/etc/modprobe.d/local.conf" >> "$COPYLIST"
+ tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}"
+
+}
+
+post_copy() {
+ :
+}
diff --git a/core/modules/alsa/module.conf b/core/modules/alsa/module.conf
new file mode 100644
index 00000000..2a8be7a1
--- /dev/null
+++ b/core/modules/alsa/module.conf
@@ -0,0 +1,8 @@
+REQUIRED_BINARIES="
+ amixer
+ alsamixer
+"
+REQUIRED_DIRECTORIES=" /usr/share/alsa
+ /etc/modprobe.d
+"
+
diff --git a/core/modules/alsa/module.conf.debian b/core/modules/alsa/module.conf.debian
new file mode 100644
index 00000000..5f4d1283
--- /dev/null
+++ b/core/modules/alsa/module.conf.debian
@@ -0,0 +1,10 @@
+REQUIRED_INSTALLED_PACKAGES="
+ alsa-utils
+ alsa-base
+ libasound2
+"
+REQUIRED_CONTENT_PACKAGES="
+ alsa-utils
+ alsa-base
+ libasound2
+"
diff --git a/core/modules/alsa/module.conf.fedora b/core/modules/alsa/module.conf.fedora
new file mode 100644
index 00000000..4ea213db
--- /dev/null
+++ b/core/modules/alsa/module.conf.fedora
@@ -0,0 +1,13 @@
+REQUIRED_INSTALLED_PACKAGES="
+ alsa-utils
+ alsa-lib
+"
+REQUIRED_CONTENT_PACKAGES="
+ alsa-utils
+ alsa-lib
+"
+REQUIRED_DIRECTORIES="
+ /usr/share/alsa
+"
+
+# libasound2
diff --git a/core/modules/alsa/module.conf.opensuse b/core/modules/alsa/module.conf.opensuse
new file mode 100644
index 00000000..a9ba1d50
--- /dev/null
+++ b/core/modules/alsa/module.conf.opensuse
@@ -0,0 +1,10 @@
+REQUIRED_CONTENT_PACKAGES="
+ alsa-utils
+ alsa
+ libasound2
+"
+REQUIRED_INSTALLED_PACKAGES="
+ alsa-utils
+ alsa
+ libasound2
+"
diff --git a/core/modules/alsa/module.conf.scientific b/core/modules/alsa/module.conf.scientific
new file mode 100644
index 00000000..643e52d3
--- /dev/null
+++ b/core/modules/alsa/module.conf.scientific
@@ -0,0 +1,12 @@
+REQUIRED_INSTALLED_PACKAGES="
+ module-init-tools
+ alsa-utils
+ alsa-lib
+"
+REQUIRED_CONTENT_PACKAGES="
+ module-init-tools
+ alsa-utils
+ alsa-lib
+"
+
+# libasound2
diff --git a/core/modules/alsa/module.conf.ubuntu b/core/modules/alsa/module.conf.ubuntu
new file mode 100644
index 00000000..c07957ab
--- /dev/null
+++ b/core/modules/alsa/module.conf.ubuntu
@@ -0,0 +1,7 @@
+REQUIRED_CONTENT_PACKAGES="
+ alsa-utils
+ alsa-base
+ libasound2
+ libasound2-data
+ libasound2-plugins
+"
diff --git a/core/modules/alsa/module.conf.ubuntu.12 b/core/modules/alsa/module.conf.ubuntu.12
new file mode 100644
index 00000000..2eb57b3d
--- /dev/null
+++ b/core/modules/alsa/module.conf.ubuntu.12
@@ -0,0 +1,6 @@
+REQUIRED_CONTENT_PACKAGES="
+ alsa-utils
+ alsa-base
+ libasound2
+ libasound2-plugins
+"