- from PLD
authorMarcin Krol <hawk@tld-linux.org>
Tue, 7 Apr 2015 15:52:07 +0000 (15:52 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Tue, 7 Apr 2015 15:52:07 +0000 (15:52 +0000)
alsa-oss-pcm [new file with mode: 0644]
alsa-utils-fast_sampling.patch [new file with mode: 0644]
alsa-utils-modprobe.patch [new file with mode: 0644]
alsa-utils.spec [new file with mode: 0644]
alsactl.conf [new file with mode: 0644]
alsasound.init [new file with mode: 0644]

diff --git a/alsa-oss-pcm b/alsa-oss-pcm
new file mode 100644 (file)
index 0000000..0dc9bdc
--- /dev/null
@@ -0,0 +1,15 @@
+# <#|*> <Playback|Capture> <app_name> <fragments> <fragment_size> [<options>]
+# First column contains card ID. It can be number as in /proc/asound/[0-9]
+# symlink or asterisk (*) which matches all cards.
+* Playback galeon 0 0 non-block
+* Playback mozilla 0 0 non-block
+* Playback netscape-communicator 0 0 non-block
+
+# direct access to quake engines
+* Playback quake2 0 0 direct
+* Playback et.x86 0 0 direct
+* Playback et 0 0 direct
+* Playback wolfsp.x86 0 0 direct
+* Playback doomsday 0 0 direct
+* Playback quake3.x86 0 0 direct
+* Playback doom3.x86 0 0 direct
diff --git a/alsa-utils-fast_sampling.patch b/alsa-utils-fast_sampling.patch
new file mode 100644 (file)
index 0000000..99c3824
--- /dev/null
@@ -0,0 +1,11 @@
+--- alsa-utils-1.0.15-old/aplay/aplay.c        2007-10-30 02:34:10.886553500 +0100
++++ alsa-utils-1.0.15/aplay/aplay.c    2007-10-30 02:34:44.680665500 +0100
+@@ -470,7 +470,7 @@
+                       if (tmp < 300)
+                               tmp *= 1000;
+                       rhwparams.rate = tmp;
+-                      if (tmp < 2000 || tmp > 192000) {
++                      if (tmp < 2000 || tmp > 896000) {
+                               error(_("bad speed value %i"), tmp);
+                               return 1;
+                       }
diff --git a/alsa-utils-modprobe.patch b/alsa-utils-modprobe.patch
new file mode 100644 (file)
index 0000000..31b2862
--- /dev/null
@@ -0,0 +1,20 @@
+--- alsa-utils-1.0.28/alsaconf/alsaconf.in~    2014-06-13 19:21:05.000000000 +0200
++++ alsa-utils-1.0.28/alsaconf/alsaconf.in     2014-06-18 08:49:50.065218184 +0200
+@@ -304,7 +304,7 @@
+   cfgfile="/etc/modprobe.conf"
+   if [ -d /etc/modprobe.d ]; then
+     cfgout="/etc/modprobe.d/50-sound.conf"
+-    cfgoldout="/etc/modprobe.d/sound"
++    cfgoldout="/etc/modprobe.d/sound.conf"
+     if [ ! -f $cfgout ]; then
+       case "$(modprobe -V)" in
+       "module-init-tools version "3.[789]*|\
+@@ -313,7 +313,7 @@
+       "kmod version "*)
+         ;;
+       *)
+-        cfgout="/etc/modprobe.d/sound"
++        cfgout="/etc/modprobe.d/sound.conf"
+         cfgoldout=""
+         ;;
+       esac
diff --git a/alsa-utils.spec b/alsa-utils.spec
new file mode 100644 (file)
index 0000000..bf5e1cc
--- /dev/null
@@ -0,0 +1,230 @@
+Summary:       Advanced Linux Sound Architecture (ALSA) - Utils
+Summary(es.UTF-8):     Utilitarios para ALSA (Advanced Linux Sound Architecture)
+Summary(pl.UTF-8):     Advanced Linux Sound Architecture (ALSA) - Narzędzia
+Summary(pt_BR.UTF-8):  Utilitários para o ALSA (Advanced Linux Sound Architecture)
+Summary(ru.UTF-8):     Утилиты командной строки для ALSA project
+Summary(uk.UTF-8):     Утиліти командного рядка для ALSA project
+Name:          alsa-utils
+Version:       1.0.29
+Release:       1
+# some apps GPL v2, some GPL v2+
+License:       GPL v2
+Group:         Applications/Sound
+Source0:       ftp://ftp.alsa-project.org/pub/utils/%{name}-%{version}.tar.bz2
+# Source0-md5: 6b289bf874c4c9a63f4b3973093dd404
+Source1:       alsasound.init
+# does anything use this (probably outdated) file? not alsasound.init
+Source2:       alsa-oss-pcm
+Source3:       alsactl.conf
+Patch0:                %{name}-fast_sampling.patch
+Patch1:                %{name}-modprobe.patch
+URL:           http://www.alsa-project.org/
+BuildRequires: alsa-lib-devel >= 1.0.27
+BuildRequires: autoconf >= 2.59
+BuildRequires: automake
+BuildRequires: gettext-tools >= 0.15
+BuildRequires: libsamplerate-devel >= 0.1.3
+BuildRequires: libtool
+BuildRequires: ncurses-devel >= 5
+BuildRequires: ncurses-ext-devel >= 5
+BuildRequires: pkgconfig
+BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: xmlto
+Requires:      alsa-lib >= 1.0.27
+Requires:      awk
+Requires:      dialog
+Requires:      diffutils
+Requires:      systemd-units >= 0.38
+Requires:      which
+Suggests:      gpm
+Obsoletes:     alsa-udev
+Obsoletes:     alsaconf
+Obsoletes:     udev-alsa
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This packages contains command line utilities for the ALSA project:
+- alsactl - utility for store / restore of soundcard settings
+- aplay/arecord - utility for playback / record of .wav, .voc, .au
+  files
+- amixer - a command line mixer
+- alsamixer - ncurses mixer
+
+%description -l es.UTF-8
+Utilitarios para el sistema ALSA, la arquitetura avanzada de sonido
+para Linux.
+
+%description -l pl.UTF-8
+Pakiet zawiera następujące, działające z linii poleceń, narzędzia dla
+projektu ALSA (Advanced Linux Sound Architecture):
+- alsactl - narzędzie do zapamiętywania / przywracania ustawień karty
+  dźwiękowej
+- aplay/arecord - narzędzia do odtwarzania / nagrywania plików .wav,
+  .voc, .au
+- amixer - mikser działający z linii poleceń
+- alsamixer - mikser z interfejsem opartym o ncurses
+
+%description -l pt_BR.UTF-8
+Utilitários para o ALSA, a arquitetura de som avançada para o Linux.
+
+%description -l ru.UTF-8
+Этот пакет содержит утилиты командной строки для ALSA project:
+- alsactl - утилита для сохранения/восстановления настроек звуковой
+  карты
+- aplay/arecord - утилита для записи/проигрывания файлов .wav, .voc,
+  .au
+- amixer - микшер, управляемый из командной строки
+- alsamixer - микшер с интерфейсом ncurses
+
+%description -l uk.UTF-8
+Цей пакет містить утиліти командного рядка для ALSA project:
+- alsactl - утиліта для збереження/відновлення настанов звукової карти
+- aplay/arecord - утиліта для запису/програвання файлів .wav, .voc,
+  .au
+- amixer - мікшер, який керується з командного рядка
+- alsamixer - мікшер з інтерфейсом ncurses
+
+%package init
+Summary:       Init script for Advanced Linux Sound Architecture
+Summary(pl.UTF-8):     Skrypt init dla Advanced Linux Sound Architecture
+Group:         Applications/Sound
+Requires(post,preun):  /sbin/chkconfig
+Requires:      %{name} = %{version}-%{release}
+Requires:      rc-scripts
+Requires:      systemd-units
+Obsoletes:     alsa-udev
+
+%description init
+Init script for Advanced Linux Sound Architecture.
+
+%description init -l pl.UTF-8
+Skrypt init dla Advanced Linux Sound Architecture.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__gettextize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
+CXXFLAGS="%{rpmcxxflags} -fno-rtti -fno-exceptions"
+# we need alsactl for udev as early as possible
+%configure \
+       --sbindir=/sbin \
+       --with-systemdsystemunitdir=%{systemdunitdir}
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
+
+install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/alsasound
+install -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/alsa-oss-pcm
+install -D %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/alsa/alsactl.conf
+
+install -d $RPM_BUILD_ROOT/lib/alsa
+mv $RPM_BUILD_ROOT%{_datadir}/alsa/init $RPM_BUILD_ROOT/lib/alsa
+
+ln -s /lib/alsa/init $RPM_BUILD_ROOT%{_datadir}/alsa/init
+install -d $RPM_BUILD_ROOT%{_sbindir}
+ln -s /sbin/alsactl $RPM_BUILD_ROOT%{_sbindir}/alsactl
+
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/arecord.1
+echo ".so aplay.1" > $RPM_BUILD_ROOT%{_mandir}/man1/arecord.1
+
+%find_lang alsa-utils --all-name
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%pretrans
+# this needs to be a dir
+if [ -d %{_datadir}/alsa/init -a ! -h %{_datadir}/alsa/init ]; then
+       mv -b %{_datadir}/alsa/init{,.dir}
+%banner -e %{name} <<EOF
+Check %{_datadir}/alsa/init.dir for your own files and remove it when done.
+EOF
+fi
+
+%post init
+/sbin/chkconfig --add alsasound
+%service alsasound restart "ALSA %{version} services"
+
+%preun init
+if [ "$1" = "0" ]; then
+       %service alsasound stop
+       /sbin/chkconfig --del alsasound
+fi
+
+%triggerpostun -- %{name} < 1.0.24.2-2
+install -d /var/lib/alsa
+if [ -f /etc/asound.state ]; then
+       mv -f /etc/asound.state /var/lib/alsa/asound.state
+fi
+
+%files -f alsa-utils.lang
+%defattr(644,root,root,755)
+%doc ChangeLog README TODO
+%attr(755,root,root) /sbin/alsa-info.sh
+%attr(755,root,root) /sbin/alsaconf
+%attr(755,root,root) /sbin/alsactl
+%attr(755,root,root) %{_bindir}/aconnect
+%attr(755,root,root) %{_bindir}/alsaloop
+%attr(755,root,root) %{_bindir}/alsamixer
+%attr(755,root,root) %{_bindir}/alsaucm
+%attr(755,root,root) %{_bindir}/amidi
+%attr(755,root,root) %{_bindir}/amixer
+%attr(755,root,root) %{_bindir}/aplay
+%attr(755,root,root) %{_bindir}/aplaymidi
+%attr(755,root,root) %{_bindir}/arecord
+%attr(755,root,root) %{_bindir}/arecordmidi
+%attr(755,root,root) %{_bindir}/aseqdump
+%attr(755,root,root) %{_bindir}/aseqnet
+%attr(755,root,root) %{_bindir}/iecset
+%attr(755,root,root) %{_bindir}/speaker-test
+# symlink
+%attr(755,root,root) %{_sbindir}/alsactl
+%{_sysconfdir}/alsa/alsactl.conf
+/lib/udev/rules.d/90-alsa-restore.rules
+%{systemdunitdir}/alsa-restore.service
+%{systemdunitdir}/alsa-store.service
+%{systemdunitdir}/basic.target.wants/alsa-restore.service
+%{systemdunitdir}/shutdown.target.wants/alsa-store.service
+%dir /var/lib/alsa
+%dir /lib/alsa
+/lib/alsa/init
+%{_datadir}/alsa/init
+%{_datadir}/alsa/speaker-test
+%{_datadir}/sounds/alsa
+%{_mandir}/man1/aconnect.1*
+%{_mandir}/man1/alsactl.1*
+%{_mandir}/man1/alsaloop.1*
+%{_mandir}/man1/alsamixer.1*
+%{_mandir}/man1/amidi.1*
+%{_mandir}/man1/amixer.1*
+%{_mandir}/man1/aplay.1*
+%{_mandir}/man1/aplaymidi.1*
+%{_mandir}/man1/arecord.1*
+%{_mandir}/man1/arecordmidi.1*
+%{_mandir}/man1/aseqnet.1*
+%{_mandir}/man1/aseqdump.1*
+%{_mandir}/man1/iecset.1*
+%{_mandir}/man1/speaker-test.1*
+%{_mandir}/man7/alsactl_init.7*
+%{_mandir}/man8/alsaconf.8*
+%lang(fr) %{_mandir}/fr/man8/alsaconf.8*
+
+%files init
+%defattr(644,root,root,755)
+%attr(754,root,root) /etc/rc.d/init.d/alsasound
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/alsa-oss-pcm
+%{systemdunitdir}/alsa-state.service
+%{systemdunitdir}/basic.target.wants/alsa-state.service
diff --git a/alsactl.conf b/alsactl.conf
new file mode 100644 (file)
index 0000000..71f0d80
--- /dev/null
@@ -0,0 +1,14 @@
+#
+# ALSA library configuration file for alsactl tool
+# (/usr/share/alsa tree is not necessary for alsactl)
+#
+
+ctl.hw {
+       @args [ CARD ]
+       @args.CARD {
+               type string
+               default "0"
+       }
+       type hw
+       card $CARD
+}
diff --git a/alsasound.init b/alsasound.init
new file mode 100644 (file)
index 0000000..a37e667
--- /dev/null
@@ -0,0 +1,161 @@
+#!/bin/sh
+#
+# alsasound    This shell script takes care of starting and stopping \
+#              ALSA sound driver.
+#
+# Copyright (c) by Jaroslav Kysela <perex@jcu.cz>
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  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, write to the Free Software
+#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#
+# For PLD Linux Distribution:
+# chkconfig:   2345 87 14
+# description: ALSA driver
+#
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+driver_start()
+{
+  #
+  # insert all sound modules
+  #
+  modprobe -c | awk '$1 == "alias" && $3 != "off" && ($2 ~ /^snd-card-[0-9]$/) {print $3}' | \
+    while read line; do \
+      msg_starting "sound driver: $line"
+      busy
+      /sbin/modprobe $line
+      ok
+    done
+  modprobe -c | awk '$1 == "alias" && $3 != "off" && ($2 ~ /^sound-service-[0-9]-[0-9]+$/) {print $3}' | \
+    while read line; do \
+      msg_starting "sound driver: $line"
+      busy
+      /sbin/modprobe $line
+      ok
+    done
+}
+
+detect_stop()
+{
+  #
+  # remove all sound modules
+  #
+  /sbin/lsmod | awk '/^(snd|ac97_bus)/ { print $1 }' | while read module; do \
+     /sbin/rmmod $module
+  done
+}
+
+driver_stop()
+{
+  #
+  # remove all sound modules
+  #
+  detect_stop
+}
+
+detect_start()
+{
+  #
+  # run only detect module
+  #
+  /sbin/modprobe snd-detect
+}
+
+# Start driver.
+start() {
+       if [ ! -d /proc/asound ]; then
+               driver_start
+               if [ -d /proc/asound ]; then
+                       touch /var/lock/subsys/alsasound
+               else
+                       exit 1
+               fi
+       else
+               if [ -f /proc/asound/detect ]; then
+                       show "Shutting down sound detect module"
+                       detect_stop
+                       ok
+                       driver_start
+                       if [ -d /proc/asound ]; then
+                               touch /var/lock/subsys/alsasound
+                       else
+                               exit 1
+                       fi
+               else
+                       msg_already_running "ALSA driver"
+               fi
+       fi
+}
+
+# Stop daemons.
+stop() {
+       if [ -d /proc/asound ]; then
+               show "Shutting down sound driver"
+               busy
+               if [ -f /proc/asound/detect ]; then
+                       detect_stop
+               else
+                       driver_stop
+               fi
+               (rmmod isapnp; rmmod soundcore) 2> /dev/null
+               if [ -d /var/lock/subsys ]; then
+                       rm -f /var/lock/subsys/alsasound
+               fi
+               ok
+       else
+               msg_not_running "ALSA driver"
+       fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/alsasound ]; then
+               stop
+               start
+       else
+               msg_not_running "ALSA driver"
+               RETVAL=$1
+       fi
+}
+
+
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
+  status)
+       # TODO
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+       exit 3
+esac
+
+exit 0