Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/alsa-utils/files/, media-sound/alsa-utils/
Date: Thu, 31 Mar 2016 20:30:22
Message-Id: 1459456199.933de72a61a2ac6a967a69f0b3ff436e6144bd21.polynomial-c@gentoo
1 commit: 933de72a61a2ac6a967a69f0b3ff436e6144bd21
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 31 19:54:19 2016 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 31 20:29:59 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=933de72a
7
8 media-sound/alsa-utils: Removed old.
9
10 Package-Manager: portage-2.2.28
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 media-sound/alsa-utils/Manifest | 2 -
14 media-sound/alsa-utils/alsa-utils-1.0.27.2.ebuild | 76 --------------------
15 media-sound/alsa-utils/alsa-utils-1.0.28-r1.ebuild | 79 --------------------
16 media-sound/alsa-utils/alsa-utils-1.0.28.ebuild | 76 --------------------
17 .../files/alsa-utils-1.0.28-aplay-return.patch | 45 ------------
18 .../files/alsa-utils-1.0.28-mixer-proto.patch | 24 -------
19 .../files/alsa-utils-1.0.28-monitor-proto.patch | 24 -------
20 .../files/alsa-utils-1.0.28-va-end.patch | 39 ----------
21 media-sound/alsa-utils/files/alsasound.initd-r5 | 83 ----------------------
22 9 files changed, 448 deletions(-)
23
24 diff --git a/media-sound/alsa-utils/Manifest b/media-sound/alsa-utils/Manifest
25 index 2a85b3a..370aed6 100644
26 --- a/media-sound/alsa-utils/Manifest
27 +++ b/media-sound/alsa-utils/Manifest
28 @@ -1,5 +1,3 @@
29 -DIST alsa-utils-1.0.27.2.tar.bz2 1143802 SHA256 02bfac39092f3b68d743c23ad3d688d6c5aa8df69f2ccd692c5b8282edb352ea SHA512 c9a4943852ec1a71a5a8d2c99e1df0ba96a5d9d1196cabfdb6655f58c6a9a5a9d40dea62de019f5ed0fad0885800403c48a4a6c86b67af7fbd842097881c2bd6 WHIRLPOOL 9e95c37f307498bb9a7829fd721bf54888f3fe9ec78f014702cc26493e81369a44b571f1f5e65b3e32dbde926f97ab1152e22cf66fdff17be209e61ae34d9d46
30 -DIST alsa-utils-1.0.28.tar.bz2 1146887 SHA256 f3ff4c89b0125a7797b1b13cd094cc92276e655458274967386e812d03642acc SHA512 faa5abf3f066106c80d019944efa2298e2d3157469c1c7bc52deb9aa1bcd5f5439a2e22b04ad9210e292fcef97bdacc27aa75fc275d0d7cae2c2f88729c84786 WHIRLPOOL d58587d9f302f3f1a7ab4de45c3889ce82e5be782e4aa9a953c39a908a4693e99c8ea9aeeb5669f0f606d980983beb7d5fc53e4c76ce1bb76500c7c2bcb45013
31 DIST alsa-utils-1.0.29.tar.bz2 1154497 SHA256 5160058f3e14483ced5de919dd473f93932059454530a9b7ef97dcabd6833e9b SHA512 0d83805aa7b1c975524cc5ecd4aa6eb36126bc434458f9e9475e4bd1b14bbb4bf9691096ca7973342a3798e97a361451c078f4595f8f4275db64d6b443ca5928 WHIRLPOOL ccad5115148045e0c5f139d70306e801e250aa3946f60d9cd0a47c84c72f6d8689e53105030589309c98ddd4a7b871bb8dc03f00fcc3d46cc3e08c4718299407
32 DIST alsa-utils-1.1.0.tar.bz2 1181085 SHA256 3b1c3135b76e14532d3dd23fb15759ddd7daf9ffbc183f7a9a0a3a86374748f1 SHA512 c61f056959feba015bb4a6f49980c4beb6a0c34be09e7196864583897ea86373b593a8807999a07df9c87a3a0c714075b9aae516752e83a946d0d60bc8f90f98 WHIRLPOOL 50d8e1506fb9f969b3dfcd618933efbeda6f938c3350eccf99526fb8329afd1ea4381ff1a548590f0f9bae12bdb63c1e8ab068641743d52b3ba609eae2d337e5
33 DIST alsa-utils-1.1.1.tar.bz2 1186408 SHA256 89757c9abaf420831b088fce354d492acc170bd02bb50eb7392c175f594b8041 SHA512 3af1e43cb2eab7e5119d83036ab6f4eeb106b66b4a57122cc8df243b6dbda90d39a0290a2af3a904b4929e2d90e8fcded9eda2a38bae1fd8e371a6d7a043376e WHIRLPOOL ea7daaf4055469dd5cb128abbe9a986e2b99b27c59d964041a92e82667e520adadb1e87d38bfa83d5b8ffbc382d7d9401c9d4887ca19546e4d1f34ba1cf7d705
34
35 diff --git a/media-sound/alsa-utils/alsa-utils-1.0.27.2.ebuild b/media-sound/alsa-utils/alsa-utils-1.0.27.2.ebuild
36 deleted file mode 100644
37 index 6a5a8b5..0000000
38 --- a/media-sound/alsa-utils/alsa-utils-1.0.27.2.ebuild
39 +++ /dev/null
40 @@ -1,76 +0,0 @@
41 -# Copyright 1999-2014 Gentoo Foundation
42 -# Distributed under the terms of the GNU General Public License v2
43 -# $Id$
44 -
45 -EAPI=5
46 -inherit eutils systemd udev
47 -
48 -DESCRIPTION="Advanced Linux Sound Architecture Utils (alsactl, alsamixer, etc.)"
49 -HOMEPAGE="http://www.alsa-project.org/"
50 -SRC_URI="mirror://alsaproject/utils/${P}.tar.bz2"
51 -
52 -LICENSE="GPL-2"
53 -SLOT="0.9"
54 -KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86"
55 -IUSE="doc +libsamplerate +ncurses nls selinux"
56 -
57 -CDEPEND=">=media-libs/alsa-lib-1.0.27.1
58 - libsamplerate? ( media-libs/libsamplerate )
59 - ncurses? ( >=sys-libs/ncurses-5.7-r7:0= )"
60 -DEPEND="${CDEPEND}
61 - virtual/pkgconfig
62 - doc? ( app-text/xmlto )"
63 -RDEPEND="${CDEPEND}
64 - selinux? ( sec-policy/selinux-alsa )"
65 -
66 -src_prepare() {
67 - epatch_user
68 -}
69 -
70 -src_configure() {
71 - local myconf
72 - use doc || myconf='--disable-xmlto'
73 -
74 - # --disable-alsaconf because it doesn't work with sys-apps/kmod wrt #456214
75 - econf \
76 - --disable-maintainer-mode \
77 - $(use_enable libsamplerate alsaloop) \
78 - $(use_enable nls) \
79 - $(use_enable ncurses alsamixer) \
80 - --disable-alsaconf \
81 - "$(systemd_with_unitdir)" \
82 - --with-udev-rules-dir="$(get_udevdir)"/rules.d \
83 - ${myconf}
84 -}
85 -
86 -src_install() {
87 - emake DESTDIR="${D}" install
88 - dodoc ChangeLog README TODO seq/*/README.*
89 -
90 - newinitd "${FILESDIR}"/alsasound.initd-r5 alsasound
91 - newconfd "${FILESDIR}"/alsasound.confd-r4 alsasound
92 -
93 - insinto /etc/modprobe.d
94 - newins "${FILESDIR}"/alsa-modules.conf-rc alsa.conf
95 -
96 - keepdir /var/lib/alsa
97 -
98 - # ALSA lib parser.c:1266:(uc_mgr_scan_master_configs) error: could not
99 - # scan directory /usr/share/alsa/ucm: No such file or directory
100 - # alsaucm: unable to obtain card list: No such file or directory
101 - keepdir /usr/share/alsa/ucm
102 -}
103 -
104 -pkg_postinst() {
105 - if [[ -z ${REPLACING_VERSIONS} ]]; then
106 - elog
107 - elog "To take advantage of the init script, and automate the process of"
108 - elog "saving and restoring sound-card mixer levels you should"
109 - elog "add alsasound to the boot runlevel. You can do this as"
110 - elog "root like so:"
111 - elog "# rc-update add alsasound boot"
112 - ewarn
113 - ewarn "The ALSA core should be built into the kernel or loaded through other"
114 - ewarn "means. There is no longer any modular auto(un)loading in alsa-utils."
115 - fi
116 -}
117
118 diff --git a/media-sound/alsa-utils/alsa-utils-1.0.28-r1.ebuild b/media-sound/alsa-utils/alsa-utils-1.0.28-r1.ebuild
119 deleted file mode 100644
120 index 4f24db5..0000000
121 --- a/media-sound/alsa-utils/alsa-utils-1.0.28-r1.ebuild
122 +++ /dev/null
123 @@ -1,79 +0,0 @@
124 -# Copyright 1999-2014 Gentoo Foundation
125 -# Distributed under the terms of the GNU General Public License v2
126 -# $Id$
127 -
128 -EAPI=5
129 -inherit eutils systemd udev
130 -
131 -DESCRIPTION="Advanced Linux Sound Architecture Utils (alsactl, alsamixer, etc.)"
132 -HOMEPAGE="http://www.alsa-project.org/"
133 -SRC_URI="mirror://alsaproject/utils/${P}.tar.bz2"
134 -
135 -LICENSE="GPL-2"
136 -SLOT="0.9"
137 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
138 -IUSE="doc +libsamplerate +ncurses nls selinux"
139 -
140 -CDEPEND=">=media-libs/alsa-lib-${PV}
141 - libsamplerate? ( media-libs/libsamplerate )
142 - ncurses? ( >=sys-libs/ncurses-5.7-r7:0= )"
143 -DEPEND="${CDEPEND}
144 - virtual/pkgconfig
145 - doc? ( app-text/xmlto )"
146 -RDEPEND="${CDEPEND}
147 - selinux? ( sec-policy/selinux-alsa )"
148 -
149 -src_prepare() {
150 - epatch "${FILESDIR}"/${P}-aplay-return.patch
151 - epatch "${FILESDIR}"/${P}-va-end.patch
152 - epatch "${FILESDIR}"/${P}-{mixer,monitor}-proto.patch
153 - epatch_user
154 -}
155 -
156 -src_configure() {
157 - local myconf
158 - use doc || myconf='--disable-xmlto'
159 -
160 - # --disable-alsaconf because it doesn't work with sys-apps/kmod wrt #456214
161 - econf \
162 - --disable-maintainer-mode \
163 - $(use_enable libsamplerate alsaloop) \
164 - $(use_enable nls) \
165 - $(use_enable ncurses alsamixer) \
166 - --disable-alsaconf \
167 - "$(systemd_with_unitdir)" \
168 - --with-udev-rules-dir="$(get_udevdir)"/rules.d \
169 - ${myconf}
170 -}
171 -
172 -src_install() {
173 - default
174 - dodoc seq/*/README.*
175 -
176 - newinitd "${FILESDIR}"/alsasound.initd-r6 alsasound
177 - newconfd "${FILESDIR}"/alsasound.confd-r4 alsasound
178 -
179 - insinto /etc/modprobe.d
180 - newins "${FILESDIR}"/alsa-modules.conf-rc alsa.conf
181 -
182 - keepdir /var/lib/alsa
183 -
184 - # ALSA lib parser.c:1266:(uc_mgr_scan_master_configs) error: could not
185 - # scan directory /usr/share/alsa/ucm: No such file or directory
186 - # alsaucm: unable to obtain card list: No such file or directory
187 - keepdir /usr/share/alsa/ucm
188 -}
189 -
190 -pkg_postinst() {
191 - if [[ -z ${REPLACING_VERSIONS} ]]; then
192 - elog
193 - elog "To take advantage of the init script, and automate the process of"
194 - elog "saving and restoring sound-card mixer levels you should"
195 - elog "add alsasound to the boot runlevel. You can do this as"
196 - elog "root like so:"
197 - elog "# rc-update add alsasound boot"
198 - ewarn
199 - ewarn "The ALSA core should be built into the kernel or loaded through other"
200 - ewarn "means. There is no longer any modular auto(un)loading in alsa-utils."
201 - fi
202 -}
203
204 diff --git a/media-sound/alsa-utils/alsa-utils-1.0.28.ebuild b/media-sound/alsa-utils/alsa-utils-1.0.28.ebuild
205 deleted file mode 100644
206 index 62ca437..0000000
207 --- a/media-sound/alsa-utils/alsa-utils-1.0.28.ebuild
208 +++ /dev/null
209 @@ -1,76 +0,0 @@
210 -# Copyright 1999-2014 Gentoo Foundation
211 -# Distributed under the terms of the GNU General Public License v2
212 -# $Id$
213 -
214 -EAPI=5
215 -inherit eutils systemd udev
216 -
217 -DESCRIPTION="Advanced Linux Sound Architecture Utils (alsactl, alsamixer, etc.)"
218 -HOMEPAGE="http://www.alsa-project.org/"
219 -SRC_URI="mirror://alsaproject/utils/${P}.tar.bz2"
220 -
221 -LICENSE="GPL-2"
222 -SLOT="0.9"
223 -KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86"
224 -IUSE="doc +libsamplerate +ncurses nls selinux"
225 -
226 -CDEPEND=">=media-libs/alsa-lib-${PV}
227 - libsamplerate? ( media-libs/libsamplerate )
228 - ncurses? ( >=sys-libs/ncurses-5.7-r7:0= )"
229 -DEPEND="${CDEPEND}
230 - virtual/pkgconfig
231 - doc? ( app-text/xmlto )"
232 -RDEPEND="${CDEPEND}
233 - selinux? ( sec-policy/selinux-alsa )"
234 -
235 -src_prepare() {
236 - epatch_user
237 -}
238 -
239 -src_configure() {
240 - local myconf
241 - use doc || myconf='--disable-xmlto'
242 -
243 - # --disable-alsaconf because it doesn't work with sys-apps/kmod wrt #456214
244 - econf \
245 - --disable-maintainer-mode \
246 - $(use_enable libsamplerate alsaloop) \
247 - $(use_enable nls) \
248 - $(use_enable ncurses alsamixer) \
249 - --disable-alsaconf \
250 - "$(systemd_with_unitdir)" \
251 - --with-udev-rules-dir="$(get_udevdir)"/rules.d \
252 - ${myconf}
253 -}
254 -
255 -src_install() {
256 - emake DESTDIR="${D}" install
257 - dodoc ChangeLog README TODO seq/*/README.*
258 -
259 - newinitd "${FILESDIR}"/alsasound.initd-r6 alsasound
260 - newconfd "${FILESDIR}"/alsasound.confd-r4 alsasound
261 -
262 - insinto /etc/modprobe.d
263 - newins "${FILESDIR}"/alsa-modules.conf-rc alsa.conf
264 -
265 - keepdir /var/lib/alsa
266 -
267 - # ALSA lib parser.c:1266:(uc_mgr_scan_master_configs) error: could not
268 - # scan directory /usr/share/alsa/ucm: No such file or directory
269 - # alsaucm: unable to obtain card list: No such file or directory
270 - keepdir /usr/share/alsa/ucm
271 -}
272 -
273 -pkg_postinst() {
274 - if [[ -z ${REPLACING_VERSIONS} ]]; then
275 - elog
276 - elog "To take advantage of the init script, and automate the process of"
277 - elog "saving and restoring sound-card mixer levels you should"
278 - elog "add alsasound to the boot runlevel. You can do this as"
279 - elog "root like so:"
280 - elog "# rc-update add alsasound boot"
281 - ewarn
282 - ewarn "The ALSA core should be built into the kernel or loaded through other"
283 - ewarn "means. There is no longer any modular auto(un)loading in alsa-utils."
284 - fi
285 -}
286
287 diff --git a/media-sound/alsa-utils/files/alsa-utils-1.0.28-aplay-return.patch b/media-sound/alsa-utils/files/alsa-utils-1.0.28-aplay-return.patch
288 deleted file mode 100644
289 index e257888..0000000
290 --- a/media-sound/alsa-utils/files/alsa-utils-1.0.28-aplay-return.patch
291 +++ /dev/null
292 @@ -1,45 +0,0 @@
293 -http://crbug.com/433899
294 -
295 -From 8f361d83cfcb39887f5fc591633e68d9448e3425 Mon Sep 17 00:00:00 2001
296 -From: Jaroslav Kysela <perex@×××××.cz>
297 -Date: Wed, 1 Oct 2014 15:43:57 +0200
298 -Subject: [PATCH [alsa-utils]] Revert "aplay: fix pcm_read() return value"
299 -
300 -This reverts commit 8aa13eec80eac312e4b99423909387660fb99b8f.
301 -
302 -The semantics for pcm_read() and pcm_readv() was changed, but the
303 -callers expect the exact frame count as requested. It's possible
304 -to fix callers, but the fix is more complicated than to revert the
305 -change. Note that '-d' processing was broken in some cases.
306 -
307 -Note: The reverted commit allows that the return value might be
308 -greater than requested (see the first condition in read routines).
309 ----
310 - aplay/aplay.c | 4 ++--
311 - 1 file changed, 2 insertions(+), 2 deletions(-)
312 -
313 -diff --git a/aplay/aplay.c b/aplay/aplay.c
314 -index 30d3f31..e58e1bc 100644
315 ---- a/aplay/aplay.c
316 -+++ b/aplay/aplay.c
317 -@@ -2039,7 +2039,7 @@ static ssize_t pcm_read(u_char *data, size_t rcount)
318 - data += r * bits_per_frame / 8;
319 - }
320 - }
321 -- return result;
322 -+ return rcount;
323 - }
324 -
325 - static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
326 -@@ -2084,7 +2084,7 @@ static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
327 - count -= r;
328 - }
329 - }
330 -- return result;
331 -+ return rcount;
332 - }
333 -
334 - /*
335 ---
336 -2.1.3
337 -
338
339 diff --git a/media-sound/alsa-utils/files/alsa-utils-1.0.28-mixer-proto.patch b/media-sound/alsa-utils/files/alsa-utils-1.0.28-mixer-proto.patch
340 deleted file mode 100644
341 index fdd26c3..0000000
342 --- a/media-sound/alsa-utils/files/alsa-utils-1.0.28-mixer-proto.patch
343 +++ /dev/null
344 @@ -1,24 +0,0 @@
345 -From c788ce9b6088e2c937f77231eab520c3d16e0c76 Mon Sep 17 00:00:00 2001
346 -From: Jaroslav Kysela <perex@×××××.cz>
347 -Date: Wed, 25 Jun 2014 10:49:23 +0200
348 -Subject: [PATCH [alsa-utils]] alsamixer: include missing mixer_controls.h
349 -
350 ----
351 - alsamixer/mainloop.c | 1 +
352 - 1 file changed, 1 insertion(+)
353 -
354 -diff --git a/alsamixer/mainloop.c b/alsamixer/mainloop.c
355 -index 351f57f..79d81a9 100644
356 ---- a/alsamixer/mainloop.c
357 -+++ b/alsamixer/mainloop.c
358 -@@ -29,6 +29,7 @@
359 - #include "widget.h"
360 - #include "mixer_widget.h"
361 - #include "mixer_display.h"
362 -+#include "mixer_controls.h"
363 - #include "mainloop.h"
364 -
365 - static WINDOW *curses_initialized;
366 ---
367 -2.1.3
368 -
369
370 diff --git a/media-sound/alsa-utils/files/alsa-utils-1.0.28-monitor-proto.patch b/media-sound/alsa-utils/files/alsa-utils-1.0.28-monitor-proto.patch
371 deleted file mode 100644
372 index 55d93f8..0000000
373 --- a/media-sound/alsa-utils/files/alsa-utils-1.0.28-monitor-proto.patch
374 +++ /dev/null
375 @@ -1,24 +0,0 @@
376 -From 74e5d57c999f8afed4f87046dcac84f6709b9196 Mon Sep 17 00:00:00 2001
377 -From: Jaroslav Kysela <perex@×××××.cz>
378 -Date: Wed, 24 Sep 2014 10:46:02 +0200
379 -Subject: [PATCH [alsa-utils]] alsactl: aded missing monitor() prototype
380 -
381 ----
382 - alsactl/alsactl.h | 1 +
383 - 1 file changed, 1 insertion(+)
384 -
385 -diff --git a/alsactl/alsactl.h b/alsactl/alsactl.h
386 -index bd9bf23..4f969ec 100644
387 ---- a/alsactl/alsactl.h
388 -+++ b/alsactl/alsactl.h
389 -@@ -31,6 +31,7 @@ int save_state(const char *file, const char *cardname);
390 - int load_state(const char *file, const char *initfile, const char *cardname,
391 - int do_init);
392 - int power(const char *argv[], int argc);
393 -+int monitor(const char *name);
394 - int state_daemon(const char *file, const char *cardname, int period,
395 - const char *pidfile);
396 - int state_daemon_kill(const char *pidfile, const char *cmd);
397 ---
398 -2.1.3
399 -
400
401 diff --git a/media-sound/alsa-utils/files/alsa-utils-1.0.28-va-end.patch b/media-sound/alsa-utils/files/alsa-utils-1.0.28-va-end.patch
402 deleted file mode 100644
403 index a4153bd..0000000
404 --- a/media-sound/alsa-utils/files/alsa-utils-1.0.28-va-end.patch
405 +++ /dev/null
406 @@ -1,39 +0,0 @@
407 -From 89a4f490bd974e454d82942100f241bb1a2270f3 Mon Sep 17 00:00:00 2001
408 -From: Jaroslav Kysela <perex@×××××.cz>
409 -Date: Wed, 24 Sep 2014 10:52:17 +0200
410 -Subject: [PATCH [alsa-utils]] =?UTF-8?q?alsactl:=20coverity=20-=20missing?=
411 - =?UTF-8?q?=5Fva=5Fend=20=E2=80=93=20va=5Fend=20was=20not=20called=20for?=
412 - =?UTF-8?q?=20"ap"?=
413 -MIME-Version: 1.0
414 -Content-Type: text/plain; charset=UTF-8
415 -Content-Transfer-Encoding: 8bit
416 -
417 ----
418 - alsactl/utils.c | 4 ++--
419 - 1 file changed, 2 insertions(+), 2 deletions(-)
420 -
421 -diff --git a/alsactl/utils.c b/alsactl/utils.c
422 -index b5d183c..304df7c 100644
423 ---- a/alsactl/utils.c
424 -+++ b/alsactl/utils.c
425 -@@ -157,8 +157,8 @@ void cerror_(const char *fcn, long line, int cond, const char *fmt, ...)
426 - fprintf(stderr, "%s: %s:%ld: ", command, fcn, line);
427 - vfprintf(stderr, fmt, ap);
428 - putc('\n', stderr);
429 -- va_end(ap);
430 - }
431 -+ va_end(ap);
432 - }
433 -
434 - void dbg_(const char *fcn, long line, const char *fmt, ...)
435 -@@ -174,6 +174,6 @@ void dbg_(const char *fcn, long line, const char *fmt, ...)
436 - fprintf(stderr, "%s: %s:%ld: ", command, fcn, line);
437 - vfprintf(stderr, fmt, ap);
438 - putc('\n', stderr);
439 -- va_end(ap);
440 - }
441 -+ va_end(ap);
442 - }
443 ---
444 -2.1.3
445 -
446
447 diff --git a/media-sound/alsa-utils/files/alsasound.initd-r5 b/media-sound/alsa-utils/files/alsasound.initd-r5
448 deleted file mode 100644
449 index fdb081f..0000000
450 --- a/media-sound/alsa-utils/files/alsasound.initd-r5
451 +++ /dev/null
452 @@ -1,83 +0,0 @@
453 -#!/sbin/runscript
454 -# $Id$
455 -# Copyright 1999-2012 Gentoo Foundation
456 -# Distributed under the terms of the GNU General Public License v2
457 -
458 -alsastatedir=/var/lib/alsa
459 -alsascrdir=/etc/alsa.d
460 -
461 -extra_commands="save restore"
462 -
463 -depend() {
464 - need localmount
465 - after bootmisc modules isapnp coldplug hotplug
466 -}
467 -
468 -restore() {
469 - ebegin "Restoring Mixer Levels"
470 -
471 - if [ ! -r "${alsastatedir}/asound.state" ] ; then
472 - ewarn "No mixer config in ${alsastatedir}/asound.state, you have to unmute your card!"
473 - eend 0
474 - return 0
475 - fi
476 -
477 - local cards="$(sed -n -e 's/ *\([[:digit:]]*\) .*/\1/p' /proc/asound/cards)"
478 - local CARDNUM
479 - for cardnum in ${cards}; do
480 - [ -e /dev/snd/controlC${cardnum} ] || sleep 2
481 - [ -e /dev/snd/controlC${cardnum} ] || sleep 2
482 - [ -e /dev/snd/controlC${cardnum} ] || sleep 2
483 - [ -e /dev/snd/controlC${cardnum} ] || sleep 2
484 - alsactl -I -f "${alsastatedir}/asound.state" restore ${cardnum} \
485 - || ewarn "Errors while restoring defaults, ignoring"
486 - done
487 -
488 - for ossfile in "${alsastatedir}"/oss/card*_pcm* ; do
489 - [ -e "${ossfile}" ] || continue
490 - # We use cat because I'm not sure if cp works properly on /proc
491 - local procfile=${ossfile##${alsastatedir}/oss}
492 - procfile="$(echo "${procfile}" | sed -e 's,_,/,g')"
493 - if [ -e /proc/asound/"${procfile}"/oss ] ; then
494 - cat "${ossfile}" > /proc/asound/"${procfile}"/oss
495 - fi
496 - done
497 -
498 - eend 0
499 -}
500 -
501 -save() {
502 - ebegin "Storing ALSA Mixer Levels"
503 -
504 - mkdir -p "${alsastatedir}"
505 - if ! alsactl -f "${alsastatedir}/asound.state" store; then
506 - eerror "Error saving levels."
507 - eend 1
508 - return 1
509 - fi
510 -
511 - for ossfile in /proc/asound/card*/pcm*/oss; do
512 - [ -e "${ossfile}" ] || continue
513 - local device=${ossfile##/proc/asound/} ; device=${device%%/oss}
514 - device="$(echo "${device}" | sed -e 's,/,_,g')"
515 - mkdir -p "${alsastatedir}/oss/"
516 - cp "${ossfile}" "${alsastatedir}/oss/${device}"
517 - done
518 -
519 - eend 0
520 -}
521 -
522 -start() {
523 - if [ "${RESTORE_ON_START}" = "yes" ]; then
524 - restore
525 - fi
526 -
527 - return 0
528 -}
529 -
530 -stop() {
531 - if [ "${SAVE_ON_STOP}" = "yes" ]; then
532 - save
533 - fi
534 - return 0
535 -}