openSUSE Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
November 2010
- 1 participants
- 1023 discussions
Hello community,
here is the log from the commit of package arpwatch-ethercodes for openSUSE:Factory
checked in at Mon Nov 29 11:54:44 CET 2010.
--------
--- AUTO/all/arpwatch-ethercodes/arpwatch-ethercodes.changes 2010-11-24 06:40:07.000000000 +0100
+++ /mounts/work_src_done/STABLE/arpwatch-ethercodes/arpwatch-ethercodes.changes 2010-11-27 06:40:08.000000000 +0100
@@ -2 +2 @@
-Wed Nov 24 06:40:07 CET 2010 - autobuild(a)suse.de
+Sat Nov 27 06:40:08 CET 2010 - autobuild(a)suse.de
@@ -4 +4 @@
-- automated update on 2010-11-24
+- automated update on 2010-11-27
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ arpwatch-ethercodes.spec ++++++
--- /var/tmp/diff_new_pack.cqzgSa/_old 2010-11-29 11:54:04.000000000 +0100
+++ /var/tmp/diff_new_pack.cqzgSa/_new 2010-11-29 11:54:04.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package arpwatch-ethercodes (Version 2010.11.24)
+# spec file for package arpwatch-ethercodes (Version 2010.11.27)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -25,7 +25,7 @@
Group: Productivity/Networking/Diagnostic
AutoReqProv: on
Summary: Ethercodes Data for arpwatch
-Version: 2010.11.24
+Version: 2010.11.27
Release: 1
Source: http://standards.ieee.org/regauth/oui/oui.txt.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ oui.txt.bz2 ++++++
--- /var/tmp/diff_new_pack.cqzgSa/_old 2010-11-29 11:54:05.000000000 +0100
+++ /var/tmp/diff_new_pack.cqzgSa/_new 2010-11-29 11:54:05.000000000 +0100
@@ -87148,6 +87148,12 @@
Seongnam-si Gyeonggi-do 463-862
KOREA, REPUBLIC OF
+9C-80-7D (hex) SYSCABLE Korea Inc.
+9C807D (base 16) SYSCABLE Korea Inc.
+ 2F KAMA Bldg 1461-15 Secho-3dong Seocho-Gu
+ Seoul 137-720
+ KOREA, REPUBLIC OF
+
9C-AD-EF (hex) Obihai Technology, Inc.
9CADEF (base 16) Obihai Technology, Inc.
19638 Stevens Creek Blvd
@@ -88297,6 +88303,12 @@
Guangzhou Guangdong Privince 511458
CHINA
+B8-E5-89 (hex) Payter BV
+B8E589 (base 16) Payter BV
+ Beukelsdijk 107
+ Rotterdam Zuid-Holland 3021 AE
+ NETHERLANDS
+
B8-E7-79 (hex) PRIVATE
B8E779 (base 16)
@@ -89606,6 +89618,13 @@
Budapest 1191
HUNGARY
+DC-07-C1 (hex) HangZhou QiYang Technology Co.,Ltd.
+DC07C1 (base 16) HangZhou QiYang Technology Co.,Ltd.
+ Floor 5, Building 2, Road XiYuanYi, WestLake Technology Park,
+ SanDun, XiHu Distribute
+ HangZhou ZheJiang 310028
+ CHINA
+
DC-1D-9F (hex) U & B tech
DC1D9F (base 16) U & B tech
2F, Daeyoung buliding, 1423-6, Kwanyang-1Dong,
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package alsa-utils for openSUSE:Factory
checked in at Mon Nov 29 11:53:51 CET 2010.
--------
--- alsa-utils/alsa-utils.changes 2010-09-02 16:07:59.000000000 +0200
+++ /mounts/work_src_done/STABLE/alsa-utils/alsa-utils.changes 2010-11-26 12:56:49.000000000 +0100
@@ -1,0 +2,50 @@
+Fri Nov 26 09:58:58 CET 2010 - tiwai(a)suse.de
+
+- add /lib/systemd/service/alsasound.service to make systemd
+ skipping old sysv script
+
+-------------------------------------------------------------------
+Fri Nov 26 09:21:16 CET 2010 - tiwai(a)suse.de
+
+- drop explicit buildrequires on systemd
+
+-------------------------------------------------------------------
+Fri Nov 26 09:05:03 CET 2010 - tiwai(a)suse.de
+
+- backport GIT PATCHES:
+ * A few alsactl init fix patches:
+ 0014-alsactl-init-Handle-Capture-Source-and-Mic-Boost-in-.patch
+ 0015-alsactl-init-Initialize-also-Master-Front-Playback-V.patch
+ * amixer control-id parse fix
+ 0016-amixer-fix-parsing-of-control-ID-name.patch
+ * new aloop utility
+ 0017-Introduce-alsaloop-utility.patch
+ 0018-alsaloop-Fix-loopbacks-pointer-initialization-and-al.patch
+ 0019-alsaloop-Fix-thread-handling.patch
+ 0020-alsaloop-fix-a-option-and-slave-mode-processing.patch
+ 0021-alsaloop-fix-resample-argument-parsing.patch
+ 0022-alsaloop-added-resampling-for-unsupported-soundcard-.patch
+ 0023-alsaloop-Add-OSS-mixer-redirection-support.patch
+ 0024-alsaloop-Fix-command-line-parsing-and-pollfd-initial.patch
+ 0025-alsaloop-Fixes-and-added-workaround-option.patch
+ 0026-alsaloop-add-pctl-and-cctl-options.patch
+ 0027-alsaloop-add-pctl-and-cctl-options-to-man-page.patch
+ 0028-alsaloop-added-xrun-profiling-support-U-xrun-added-S.patch
+ 0029-alsaloop-add-U-xrun-to-alsaloop.1-man-page.patch
+ 0030-alsaloop-fixes-added-W-wake-option.patch
+ 0031-alsaloop-Fix-latency-print.patch
+ 0033-alsaloop-Delay-the-restart-a-bit-to-handle-snd-aloop.patch
+ 0034-alsaloop-rework-the-ctl-event-handling-routine.patch
+ * robusitfy speaker-test
+ 0032-speaker-test-Don-t-retry-after-fatal-errors.patch
+ * misc clean up, translation updates
+ 0035-alsamixer-remove-obsolete-e-mail.patch
+ 0036-update-German-translations.patch
+ * systemd integration
+ 0037-alsactl-systemd-and-udev-hookup.patch
+ 0038-alsactl-Move-asound.state-location-to-var-lib-alsa.patch
+ 0039-configure.in-Fix-variable-name.patch
+- Use systemd for openSUSE 11.4
+- Put udev rules into this package instead of alsa.rpm
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
0014-alsactl-init-Handle-Capture-Source-and-Mic-Boost-in-.patch
0015-alsactl-init-Initialize-also-Master-Front-Playback-V.patch
0016-amixer-fix-parsing-of-control-ID-name.patch
0017-Introduce-alsaloop-utility.patch
0018-alsaloop-Fix-loopbacks-pointer-initialization-and-al.patch
0019-alsaloop-Fix-thread-handling.patch
0020-alsaloop-fix-a-option-and-slave-mode-processing.patch
0021-alsaloop-fix-resample-argument-parsing.patch
0022-alsaloop-added-resampling-for-unsupported-soundcard-.patch
0023-alsaloop-Add-OSS-mixer-redirection-support.patch
0024-alsaloop-Fix-command-line-parsing-and-pollfd-initial.patch
0025-alsaloop-Fixes-and-added-workaround-option.patch
0026-alsaloop-add-pctl-and-cctl-options.patch
0027-alsaloop-add-pctl-and-cctl-options-to-man-page.patch
0028-alsaloop-added-xrun-profiling-support-U-xrun-added-S.patch
0029-alsaloop-add-U-xrun-to-alsaloop.1-man-page.patch
0030-alsaloop-fixes-added-W-wake-option.patch
0031-alsaloop-Fix-latency-print.patch
0032-speaker-test-Don-t-retry-after-fatal-errors.patch
0033-alsaloop-Delay-the-restart-a-bit-to-handle-snd-aloop.patch
0034-alsaloop-rework-the-ctl-event-handling-routine.patch
0035-alsamixer-remove-obsolete-e-mail.patch
0036-update-German-translations.patch
0037-alsactl-systemd-and-udev-hookup.patch
0038-alsactl-Move-asound.state-location-to-var-lib-alsa.patch
0039-configure.in-Fix-variable-name.patch
alsa-utils-po-pre-patch.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ alsa-utils.spec ++++++
--- /var/tmp/diff_new_pack.eeIe1L/_old 2010-11-29 11:53:31.000000000 +0100
+++ /var/tmp/diff_new_pack.eeIe1L/_new 2010-11-29 11:53:31.000000000 +0100
@@ -17,9 +17,14 @@
# norootforbuild
+%if %suse_version > 1130
+%define use_systemd 1
+%else
+%define use_systemd 0
+%endif
Name: alsa-utils
-BuildRequires: alsa-devel ncurses-devel xmlto
+BuildRequires: alsa-devel ncurses-devel pkgconfig xmlto
%define package_version 1.0.23
License: GPLv2+
Group: Productivity/Multimedia/Sound/Players
@@ -28,7 +33,7 @@
AutoReqProv: on
Summary: Advanced Linux Sound Architecture Utilities
Version: 1.0.23
-Release: 4
+Release: 5
Source: ftp://ftp.alsa-project.org/pub/util/alsa-utils-%{package_version}.tar.bz2
# Patch: alsa-utils-git-fixes.diff
Patch1: 0001-alsactl-use-snd_config_imake-functions.patch
@@ -44,8 +49,34 @@
Patch11: 0011-alsactl-init-Use-Found-hardware-instead-Unknown-hard.patch
Patch12: 0012-alsactl-init-use-generic-method-instead-guess-method.patch
Patch13: 0013-alsactl-Change-handling-of-inactive-controls.patch
+Patch14: 0014-alsactl-init-Handle-Capture-Source-and-Mic-Boost-in-.patch
+Patch15: 0015-alsactl-init-Initialize-also-Master-Front-Playback-V.patch
+Patch16: 0016-amixer-fix-parsing-of-control-ID-name.patch
+Patch17: 0017-Introduce-alsaloop-utility.patch
+Patch18: 0018-alsaloop-Fix-loopbacks-pointer-initialization-and-al.patch
+Patch19: 0019-alsaloop-Fix-thread-handling.patch
+Patch20: 0020-alsaloop-fix-a-option-and-slave-mode-processing.patch
+Patch21: 0021-alsaloop-fix-resample-argument-parsing.patch
+Patch22: 0022-alsaloop-added-resampling-for-unsupported-soundcard-.patch
+Patch23: 0023-alsaloop-Add-OSS-mixer-redirection-support.patch
+Patch24: 0024-alsaloop-Fix-command-line-parsing-and-pollfd-initial.patch
+Patch25: 0025-alsaloop-Fixes-and-added-workaround-option.patch
+Patch26: 0026-alsaloop-add-pctl-and-cctl-options.patch
+Patch27: 0027-alsaloop-add-pctl-and-cctl-options-to-man-page.patch
+Patch28: 0028-alsaloop-added-xrun-profiling-support-U-xrun-added-S.patch
+Patch29: 0029-alsaloop-add-U-xrun-to-alsaloop.1-man-page.patch
+Patch30: 0030-alsaloop-fixes-added-W-wake-option.patch
+Patch31: 0031-alsaloop-Fix-latency-print.patch
+Patch32: 0032-speaker-test-Don-t-retry-after-fatal-errors.patch
+Patch33: 0033-alsaloop-Delay-the-restart-a-bit-to-handle-snd-aloop.patch
+Patch34: 0034-alsaloop-rework-the-ctl-event-handling-routine.patch
+Patch35: 0035-alsamixer-remove-obsolete-e-mail.patch
+Patch36: 0036-update-German-translations.patch
+Patch37: 0037-alsactl-systemd-and-udev-hookup.patch
+Patch38: 0038-alsactl-Move-asound.state-location-to-var-lib-alsa.patch
+Patch39: 0039-configure.in-Fix-variable-name.patch
Patch99: alsa-utils-gettext-version-removal.diff
-# Patch100: alsa-utils-po-pre-patch.diff
+Patch100: alsa-utils-po-pre-patch.diff
Url: http://www.alsa-project.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -65,9 +96,9 @@
# fix stupid automake's automatic action
sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am
# fix po changes in tarball first
-# %patch100 -p1
+%patch100 -p1
# rm -f po/Makefile* po/*.gmo po/*.pot po/*.header po/stamp-*
-# %patch -p1
+# %%patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
@@ -81,6 +112,32 @@
%patch11 -p1
%patch12 -p1
%patch13 -p1
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
+%patch19 -p1
+%patch20 -p1
+%patch21 -p1
+%patch22 -p1
+%patch23 -p1
+%patch24 -p1
+%patch25 -p1
+%patch26 -p1
+%patch27 -p1
+%patch28 -p1
+%patch29 -p1
+%patch30 -p1
+%patch31 -p1
+%patch32 -p1
+%patch33 -p1
+%patch34 -p1
+%patch35 -p1
+%patch36 -p1
+%patch37 -p1
+%patch38 -p1
+%patch39 -p1
%if %suse_version < 1020
%patch99 -p1
%endif
@@ -91,17 +148,25 @@
gettextize -f
%endif
autoreconf -fi
+opts=""
+%if %use_systemd
+opts="$opts --with-systemdsystemunitdir=/lib/systemd/system"
+%endif
+%if %suse_version < 1140
+opts="$opts --with-asound-state-dir=/etc"
+%endif
%if %suse_version < 1030
-%define moreopts --disable-xmlto
-%else
-%define moreopts
+opts="$opts --disable-xmlto"
%endif
-%configure --with-curses=ncursesw %moreopts
+%configure --with-curses=ncursesw $opts
make %{?jobs:-j %jobs}
%install
%makeinstall
%find_lang %{name} --all-name
+%if %use_systemd
+ln -s alsa-restore.service $RPM_BUILD_ROOT/lib/systemd/system/alsasound.service
+%endif
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
@@ -117,5 +182,9 @@
%{_sbindir}/*
%{_datadir}/sounds/alsa
%{_datadir}/alsa
+/lib/udev
+%if %use_systemd
+/lib/systemd
+%endif
%changelog
++++++ 0014-alsactl-init-Handle-Capture-Source-and-Mic-Boost-in-.patch ++++++
>From 52bd2f8acedaacce32ca8e89cb1f21683658648e Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Tue, 7 Sep 2010 17:07:12 +0200
Subject: [PATCH 14/38] alsactl init: Handle "Capture Source" and "Mic Boost" in the default script
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsactl/init/default | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/alsactl/init/default b/alsactl/init/default
index 35acfc3..9fd7972 100644
--- a/alsactl/init/default
+++ b/alsactl/init/default
@@ -185,6 +185,11 @@ CTL{name}="Capture Volume",CTL{do_search}=="1", \
CTL{name}="Capture Switch",CTL{do_search}=="1", \
CTL{values}="on"
+CTL{name}="Capture Source",PROGRAM!="__ctl_search", GOTO=""
+CTL{enums}=="*|Internal Mic|*",CTL{values}="Internal Mic", GOTO=""
+CTL{enums}=="*|Mic|*",CTL{values}="Mic"
+LABEL=""
+
CTL{name}="Input Source",PROGRAM!="__ctl_search", GOTO=""
CTL{enums}=="*|Internal Mic|*",CTL{values}="Internal Mic", GOTO=""
CTL{enums}=="*|Mic|*",CTL{values}="Mic"
@@ -195,4 +200,5 @@ CTL{enums}=="*|Digital Mic 1|*",CTL{values}="Digital Mic 1", GOTO=""
CTL{enums}=="*|Mic|*",CTL{values}="Mic"
LABEL=""
+CTL{name}="Mic Boost",CTL{do_search}=="1", CTL{values}="on"
CTL{name}="Internal Mic Boost",CTL{do_search}=="1", CTL{values}="on"
--
1.7.3.1
++++++ 0015-alsactl-init-Initialize-also-Master-Front-Playback-V.patch ++++++
>From ef919a4724169f4c0dc14168dec32c168b2471e4 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Tue, 7 Sep 2010 17:33:14 +0200
Subject: [PATCH 15/38] alsactl init: Initialize also "Master Front Playback Volume" & "Switch"
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsactl/init/default | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/alsactl/init/default b/alsactl/init/default
index 9fd7972..7f8ec4c 100644
--- a/alsactl/init/default
+++ b/alsactl/init/default
@@ -30,6 +30,13 @@ CTL{name}="Master Playback Switch",CTL{do_search}=="1", \
CTL{values}="on"
CTL{reset}="mixer"
+CTL{name}="Master Front Playback Volume",CTL{do_search}=="1", \
+ ENV{has_pmaster_vol}:="true", \
+ CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}"
+CTL{name}="Master Front Playback Switch",CTL{do_search}=="1", \
+ CTL{values}="on"
+
+CTL{reset}="mixer"
CTL{name}="Master Digital Playback Volume",CTL{do_search}=="1", \
CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}"
CTL{name}="Master Digital Playback Switch",CTL{do_search}=="1", \
--
1.7.3.1
++++++ 0016-amixer-fix-parsing-of-control-ID-name.patch ++++++
>From 87c58b59b5c443fe3244bd06417c451581d1f635 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Tue, 5 Oct 2010 10:02:45 +0200
Subject: [PATCH 16/38] amixer: fix parsing of control ID name
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
amixer/amixer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/amixer/amixer.c b/amixer/amixer.c
index c9ea572..a177288 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -1120,8 +1120,8 @@ static int parse_control_id(const char *str, snd_ctl_elem_id_t *id)
}
str++;
}
- *ptr = '\0';
}
+ *ptr = '\0';
snd_ctl_elem_id_set_name(id, buf);
} else if (!strncasecmp(str, "index=", 6)) {
str += 6;
--
1.7.3.1
++++++ 0017-Introduce-alsaloop-utility.patch ++++++
++++ 3313 lines (skipped)
++++++ 0018-alsaloop-Fix-loopbacks-pointer-initialization-and-al.patch ++++++
>From ad0e562373af1de5e911cf1d5def598a7b6523f2 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Wed, 6 Oct 2010 18:30:18 +0200
Subject: [PATCH 18/38] alsaloop: Fix loopbacks pointer initialization and allocation, fix -T option
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/alsaloop.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
index 4ba5203..0001358 100644
--- a/alsaloop/alsaloop.c
+++ b/alsaloop/alsaloop.c
@@ -45,7 +45,7 @@ struct loopback_thread {
int verbose = 0;
int daemonize = 0;
int use_syslog = 0;
-struct loopback **loopbacks;
+struct loopback **loopbacks = NULL;
int loopbacks_count = 0;
static void my_exit(struct loopback_thread *thread, int exitcode)
@@ -199,7 +199,8 @@ static long timediff(struct timeval t1, struct timeval t2)
static void add_loop(struct loopback *loop)
{
- loopbacks = realloc(loopbacks, loopbacks_count * sizeof(struct loopback *));
+ loopbacks = realloc(loopbacks, (loopbacks_count + 1) *
+ sizeof(struct loopback *));
if (loopbacks == NULL) {
logit(LOG_CRIT, "No enough memory\n");
exit(EXIT_FAILURE);
@@ -321,7 +322,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
morehelp = 0;
while (1) {
int c;
- if ((c = getopt_long(argc, argv, "hdg:P:C:l:t:F:f:c:r:s:benvA:S:a:m:", long_option, NULL)) < 0)
+ if ((c = getopt_long(argc, argv, "hdg:P:C:l:t:F:f:c:r:s:benvA:S:a:m:T:", long_option, NULL)) < 0)
break;
switch (c) {
case 'h':
--
1.7.3.1
++++++ 0019-alsaloop-Fix-thread-handling.patch ++++++
>From 4fe4d22b73dd205521348583f8105de1c155f4a6 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Wed, 6 Oct 2010 18:51:29 +0200
Subject: [PATCH 19/38] alsaloop: Fix thread handling
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/alsaloop.c | 5 ++---
alsaloop/test.sh | 19 +++++++++++++++++++
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
index 0001358..743e0ef 100644
--- a/alsaloop/alsaloop.c
+++ b/alsaloop/alsaloop.c
@@ -687,7 +687,7 @@ int main(int argc, char *argv[])
}
/* we must sort thread IDs */
- j = 0;
+ j = -1;
do {
k = 0x7fffffff;
for (i = 0; i < loopbacks_count; i++) {
@@ -695,11 +695,11 @@ int main(int argc, char *argv[])
loopbacks[i]->thread > j)
k = loopbacks[i]->thread;
}
+ j++;
for (i = 0; i < loopbacks_count; i++) {
if (loopbacks[i]->thread == k)
loopbacks[i]->thread = j;
}
- j++;
} while (k != 0x7fffffff);
/* fix maximum thread id */
for (i = 0, j = -1; i < loopbacks_count; i++) {
@@ -729,7 +729,6 @@ int main(int argc, char *argv[])
for (k = 0; k < j; k++)
thread_job(&threads[k]);
- logit(LOG_CRIT, "threads = %i %i\n", j, loopbacks_count);
if (j > 1) {
for (k = 0; k < j; k++)
pthread_join(threads[k].thread, NULL);
diff --git a/alsaloop/test.sh b/alsaloop/test.sh
index 2033add..bc42480 100755
--- a/alsaloop/test.sh
+++ b/alsaloop/test.sh
@@ -27,8 +27,27 @@ EOF
$DBG ./alsaloop -d --config $CFGFILE
}
+test3() {
+ echo "TEST2"
+cat > $CFGFILE <<EOF
+-C hw:1,0,0 -P dmix:0 --tlatency 50000 --thread 0 \
+ --mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
+ --mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
+ --mixer "name='PCM Playback Volume'"
+-C hw:1,0,1 -P dmix:0 --tlatency 50000 --thread 1
+-C hw:1,0,2 -P dmix:0 --tlatency 50000 --thread 2
+-C hw:1,0,3 -P dmix:0 --tlatency 50000 --thread 3
+-C hw:1,0,4 -P dmix:0 --tlatency 50000 --thread 4
+-C hw:1,0,5 -P dmix:0 --tlatency 50000 --thread 5
+-C hw:1,0,6 -P dmix:0 --tlatency 50000 --thread 6
+-C hw:1,0,7 -P dmix:0 --tlatency 50000 --thread 7
+EOF
+ $DBG ./alsaloop --config $CFGFILE
+}
+
case "$1" in
test1) test1 ;;
test2) test2 ;;
+test3) test3 ;;
*) test1 ;;
esac
--
1.7.3.1
++++++ 0020-alsaloop-fix-a-option-and-slave-mode-processing.patch ++++++
>From 5ad13c4825085ac28ed12afb0daf73c315fe0ed6 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Wed, 6 Oct 2010 20:34:03 +0200
Subject: [PATCH 20/38] alsaloop: fix -a option and slave mode processing
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/alsaloop.c | 4 ++--
alsaloop/pcmjob.c | 3 +++
alsaloop/test.sh | 18 +++++++++---------
3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
index 743e0ef..48bd21a 100644
--- a/alsaloop/alsaloop.c
+++ b/alsaloop/alsaloop.c
@@ -424,9 +424,9 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
case 'a':
if (optarg[0] == 'a')
arg_slave = SLAVE_TYPE_AUTO;
- else if (strcasecmp(optarg, "off"))
+ else if (strcasecmp(optarg, "on") == 0)
arg_slave = SLAVE_TYPE_ON;
- else if (strcasecmp(optarg, "on"))
+ else if (strcasecmp(optarg, "off") == 0)
arg_slave = SLAVE_TYPE_OFF;
else
arg_slave = atoi(optarg);
diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 47256e0..51d9ea6 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -1432,6 +1432,8 @@ int pcmjob_pollfds_handle(struct loopback *loop, struct pollfd *fds)
}
if (verbose > 9)
snd_output_printf(loop->output, "%s: prevents = 0x%x, crevents = 0x%x\n", loop->id, prevents, crevents);
+ if (prevents == 0 && crevents == 0)
+ goto __pcm_end;
do {
ccount = readit(capt);
buf_add(loop, ccount);
@@ -1520,6 +1522,7 @@ int pcmjob_pollfds_handle(struct loopback *loop, struct pollfd *fds)
else
snd_output_printf(loop->output, "%s: end delay %li\n", capt->id, cdelay);
}
+ __pcm_end:
if (verbose > 13) {
getcurtimestamp(&loop->tstamp_end);
snd_output_printf(loop->output, "%s: processing time %lius\n", capt->id, timediff(loop->tstamp_end, loop->tstamp_start));
diff --git a/alsaloop/test.sh b/alsaloop/test.sh
index bc42480..a1d4dbe 100755
--- a/alsaloop/test.sh
+++ b/alsaloop/test.sh
@@ -28,19 +28,19 @@ EOF
}
test3() {
- echo "TEST2"
+ echo "TEST3"
cat > $CFGFILE <<EOF
--C hw:1,0,0 -P dmix:0 --tlatency 50000 --thread 0 \
+-C hw:1,0,0 -P plug:dmix:0 --tlatency 50000 --thread 0 \
--mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
--mixer "name='PCM Playback Volume'"
--C hw:1,0,1 -P dmix:0 --tlatency 50000 --thread 1
--C hw:1,0,2 -P dmix:0 --tlatency 50000 --thread 2
--C hw:1,0,3 -P dmix:0 --tlatency 50000 --thread 3
--C hw:1,0,4 -P dmix:0 --tlatency 50000 --thread 4
--C hw:1,0,5 -P dmix:0 --tlatency 50000 --thread 5
--C hw:1,0,6 -P dmix:0 --tlatency 50000 --thread 6
--C hw:1,0,7 -P dmix:0 --tlatency 50000 --thread 7
+-C hw:1,0,1 -P plug:dmix:0 --tlatency 50000 --thread 1
+-C hw:1,0,2 -P plug:dmix:0 --tlatency 50000 --thread 2
+-C hw:1,0,3 -P plug:dmix:0 --tlatency 50000 --thread 3
+-C hw:1,0,4 -P plug:dmix:0 --tlatency 50000 --thread 4
+-C hw:1,0,5 -P plug:dmix:0 --tlatency 50000 --thread 5
+-C hw:1,0,6 -P plug:dmix:0 --tlatency 50000 --thread 6
+-C hw:1,0,7 -P plug:dmix:0 --tlatency 50000 --thread 7
EOF
$DBG ./alsaloop --config $CFGFILE
}
--
1.7.3.1
++++++ 0021-alsaloop-fix-resample-argument-parsing.patch ++++++
>From f956c329aa1271c89cf13a01d1bcea8fae6b03f8 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Thu, 7 Oct 2010 00:12:38 +0200
Subject: [PATCH 21/38] alsaloop: fix resample argument parsing
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/alsaloop.c | 4 ++--
alsaloop/pcmjob.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
index 48bd21a..6fb9c2a 100644
--- a/alsaloop/alsaloop.c
+++ b/alsaloop/alsaloop.c
@@ -81,7 +81,7 @@ static int create_loopback_handle(struct loopback_handle **_handle,
handle->format = SND_PCM_FORMAT_S16_LE;
handle->rate = 48000;
handle->channels = 2;
- handle->resample = 1;
+ handle->resample = 0;
*_handle = handle;
return 0;
}
@@ -384,7 +384,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
arg_effect = 1;
break;
case 'n':
- arg_resample = 0;
+ arg_resample = 1;
break;
case 'A':
if (strcasecmp(optarg, "sincbest") == 0)
diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 51d9ea6..4ad752d 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -108,7 +108,7 @@ static int setparams_stream(struct loopback_handle *lhandle,
rrate = 0;
snd_pcm_hw_params_get_rate(params, &rrate, 0);
if ((int)rrate != lhandle->rate) {
- logit(LOG_CRIT, "Rate does not match (requested %iHz, get %iHz)\n", lhandle->rate, err);
+ logit(LOG_CRIT, "Rate does not match (requested %iHz, got %iHz, resample %i)\n", lhandle->rate, rrate, lhandle->resample);
return -EINVAL;
}
return 0;
--
1.7.3.1
++++++ 0022-alsaloop-added-resampling-for-unsupported-soundcard-.patch ++++++
++++ 618 lines (skipped)
++++++ 0023-alsaloop-Add-OSS-mixer-redirection-support.patch ++++++
>From 147a1cc75cf6002eb5ea2983a374d2e84eee8e1d Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Fri, 8 Oct 2010 15:10:23 +0200
Subject: [PATCH 23/38] alsaloop: Add OSS mixer redirection support
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/alsaloop.1 | 16 +++++++++++++
alsaloop/alsaloop.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++-
alsaloop/alsaloop.h | 12 +++++++++-
alsaloop/control.c | 48 +++++++++++++++++++++++++++++++++++++-
alsaloop/pcmjob.c | 1 +
alsaloop/test.sh | 4 ++-
6 files changed, 138 insertions(+), 6 deletions(-)
diff --git a/alsaloop/alsaloop.1 b/alsaloop/alsaloop.1
index 66be499..1554b6e 100644
--- a/alsaloop/alsaloop.1
+++ b/alsaloop/alsaloop.1
@@ -153,6 +153,22 @@ Known attributes:
numid - control ID numid
.TP
+\fI\-O <ossmixid>\fP | \fI\-\-ossmixer=<midid>\fP
+
+Redirect mixer control from the OSS Mixer emulation layer (capture card)
+to the ALSA layer (capture card). Format of \fIossmixid\fP is
+ALSAID[,INDEX]@OSSID:
+
+ "Master@VOLUME"
+ "PCM,1@ALTPCM"
+
+Known OSS attributes:
+
+ VOLUME, BASS, TREBLE, SYNTH, PCM, SPEAKER, LINE, MIC, CD, IMIX, ALTPCM,
+ RECLEV, IGAIN, OGAIN, LINE1, LINE2, LINE3, DIGITAL1, DIGITAL2, DIGITAL3,
+ PHONEIN, PHONEOUT, VIDEO, RADIO, MONITOR
+
+.TP
\fI\-v\fP | \fI\-\-verbose\fP
Verbose mode. Use multiple times to increase verbosity.
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
index bbf570e..effa073 100644
--- a/alsaloop/alsaloop.c
+++ b/alsaloop/alsaloop.c
@@ -164,7 +164,9 @@ void help(void)
"-a,--slave stream parameters slave mode (0=auto, 1=on, 2=off)\n"
"-T,--thread thread number (-1 = create unique)\n"
"-m,--mixer redirect mixer, argument is:\n"
-" SRC_SLAVE_ID(PLAYBACK)@DST_SLAVE_ID(CAPTURE)\n"
+" SRC_SLAVE_ID(PLAYBACK)[@DST_SLAVE_ID(CAPTURE)]\n"
+"-O,--ossmixer rescan and redirect oss mixer, argument is:\n"
+" ALSA_ID@OSS_ID (for example: \"Master@VOLUME\")\n"
"-e,--effect apply an effect (bandpass filter sweep)\n"
"-v,--verbose verbose mode (more -v means more verbose)\n"
);
@@ -266,6 +268,46 @@ static int add_mixers(struct loopback *loop,
return 0;
}
+static int add_oss_mixers(struct loopback *loop,
+ char **mixers,
+ int mixers_count)
+{
+ struct loopback_ossmixer *mixer, *last = NULL;
+ char *str1, *str2;
+
+ while (mixers_count > 0) {
+ mixer = calloc(1, sizeof(*mixer));
+ if (mixer == NULL)
+ return -ENOMEM;
+ if (last)
+ last->next = mixer;
+ else
+ loop->oss_controls = mixer;
+ last = mixer;
+ str1 = strchr(*mixers, ',');
+ if (str1)
+ *str1 = '\0';
+ str2 = strchr(str1 ? str1 + 1 : *mixers, '@');
+ if (str2)
+ *str2 = '\0';
+ mixer->alsa_id = strdup(*mixers);
+ if (str1)
+ mixer->alsa_index = atoi(str1);
+ mixer->oss_id = strdup(str2 ? str2 + 1 : *mixers);
+ if (mixer->alsa_id == NULL || mixer->oss_id == NULL) {
+ logit(LOG_CRIT, "Not enough memory");
+ return -ENOMEM;
+ }
+ if (str1)
+ *str1 = ',';
+ if (str2)
+ *str2 = ',';
+ mixers++;
+ mixers_count--;
+ }
+ return 0;
+}
+
static int parse_config_file(const char *file, snd_output_t *output);
static int parse_config(int argc, char *argv[], snd_output_t *output)
@@ -294,6 +336,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
{"slave", 1, NULL, 'a'},
{"thread", 1, NULL, 'T'},
{"mixer", 1, NULL, 'm'},
+ {"ossmixer", 1, NULL, 'O'},
{NULL, 0, NULL, 0},
};
int err, morehelp;
@@ -318,11 +361,15 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
struct loopback *loop = NULL;
char *arg_mixers[MAX_MIXERS];
int arg_mixers_count = 0;
+ char *arg_ossmixers[MAX_MIXERS];
+ int arg_ossmixers_count = 0;
morehelp = 0;
while (1) {
int c;
- if ((c = getopt_long(argc, argv, "hdg:P:C:l:t:F:f:c:r:s:benvA:S:a:m:T:", long_option, NULL)) < 0)
+ if ((c = getopt_long(argc, argv,
+ "hdg:P:C:l:t:F:f:c:r:s:benvA:S:a:m:T:O:",
+ long_option, NULL)) < 0)
break;
switch (c) {
case 'h':
@@ -445,6 +492,13 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
}
arg_mixers[arg_mixers_count++] = optarg;
break;
+ case 'O':
+ if (arg_ossmixers_count >= MAX_MIXERS) {
+ logit(LOG_CRIT, "Maximum redirected mixer controls reached (max %i)\n", (int)MAX_MIXERS);
+ exit(EXIT_FAILURE);
+ }
+ arg_ossmixers[arg_ossmixers_count++] = optarg;
+ break;
case 'v':
verbose++;
break;
@@ -490,6 +544,11 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
logit(LOG_CRIT, "Unable to add mixer controls.\n");
exit(EXIT_FAILURE);
}
+ err = add_oss_mixers(loop, arg_ossmixers, arg_ossmixers_count);
+ if (err < 0) {
+ logit(LOG_CRIT, "Unable to add ossmixer controls.\n");
+ exit(EXIT_FAILURE);
+ }
#ifdef USE_SAMPLERATE
loop->src_enable = arg_samplerate > 0;
if (loop->src_enable)
diff --git a/alsaloop/alsaloop.h b/alsaloop/alsaloop.h
index 9753c41..366a296 100644
--- a/alsaloop/alsaloop.h
+++ b/alsaloop/alsaloop.h
@@ -65,16 +65,25 @@ struct loopback_control {
};
struct loopback_mixer {
- unsigned int skip: 1;
+ unsigned int skip:1;
struct loopback_control src;
struct loopback_control dst;
struct loopback_mixer *next;
};
+struct loopback_ossmixer {
+ unsigned int skip:1;
+ const char *alsa_id;
+ int alsa_index;
+ const char *oss_id;
+ struct loopback_ossmixer *next;
+};
+
struct loopback_handle {
struct loopback *loopback;
char *device;
char *id;
+ int card_number;
snd_pcm_t *handle;
snd_pcm_access_t access;
snd_pcm_format_t format;
@@ -143,6 +152,7 @@ struct loopback {
snd_timestamp_t tstamp_end;
/* control mixer */
struct loopback_mixer *controls;
+ struct loopback_ossmixer *oss_controls;
/* sample rate */
unsigned int use_samplerate:1;
#ifdef USE_SAMPLERATE
diff --git a/alsaloop/control.c b/alsaloop/control.c
index ade7733..967f1e9 100644
--- a/alsaloop/control.c
+++ b/alsaloop/control.c
@@ -205,6 +205,34 @@ static int copy_value(struct loopback_control *dst,
return 0;
}
+static int oss_set(struct loopback *loop,
+ struct loopback_ossmixer *ossmix,
+ int enable)
+{
+ char buf[128], file[128];
+ int fd;
+
+ if (loop->capt->card_number < 0)
+ return 0;
+ if (!enable) {
+ sprintf(buf, "%s \"\" 0\n", ossmix->oss_id);
+ } else {
+ sprintf(buf, "%s \"%s\" %i\n", ossmix->oss_id, ossmix->alsa_id, ossmix->alsa_index);
+ }
+ sprintf(file, "/proc/asound/card%i/oss_mixer", loop->capt->card_number);
+ if (verbose)
+ snd_output_printf(loop->output, "%s: Initialize OSS volume %s: %s", loop->id, file, buf);
+ fd = open(file, O_WRONLY);
+ if (fd >= 0 && write(fd, buf, strlen(buf)) == strlen(buf)) {
+ close(fd);
+ return 0;
+ }
+ if (fd >= 0)
+ close(fd);
+ logit(LOG_INFO, "%s: Unable to initialize OSS Mixer ID '%s'\n", loop->id, ossmix->oss_id);
+ return -1;
+}
+
static int control_init2(struct loopback *loop,
struct loopback_mixer *mix)
{
@@ -280,12 +308,15 @@ static int control_init2(struct loopback *loop,
int control_init(struct loopback *loop)
{
struct loopback_mixer *mix;
+ struct loopback_ossmixer *ossmix;
int err;
+ for (ossmix = loop->oss_controls; ossmix; ossmix = ossmix->next)
+ oss_set(loop, ossmix, 0);
for (mix = loop->controls; mix; mix = mix->next) {
err = control_init1(loop->play, &mix->src);
if (err < 0) {
- logit(LOG_WARNING, "Disabling playback control '%s'\n", id_str(mix->src.id));
+ logit(LOG_WARNING, "%s: Disabling playback control '%s'\n", loop->id, id_str(mix->src.id));
mix->skip = 1;
continue;
}
@@ -293,22 +324,35 @@ int control_init(struct loopback *loop)
if (err < 0)
return err;
}
+ for (ossmix = loop->oss_controls; ossmix; ossmix = ossmix->next) {
+ err = oss_set(loop, ossmix, 1);
+ if (err < 0) {
+ ossmix->skip = 1;
+ logit(LOG_WARNING, "%s: Disabling OSS mixer ID '%s'\n", loop->id, ossmix->oss_id);
+ }
+ }
return 0;
}
int control_done(struct loopback *loop)
{
struct loopback_mixer *mix;
+ struct loopback_ossmixer *ossmix;
int err;
if (loop->capt->ctl == NULL)
return 0;
+ for (ossmix = loop->oss_controls; ossmix; ossmix = ossmix->next) {
+ err = oss_set(loop, ossmix, 0);
+ if (err < 0)
+ logit(LOG_WARNING, "%s: Unable to remove OSS control '%s'\n", loop->id, ossmix->oss_id);
+ }
for (mix = loop->controls; mix; mix = mix->next) {
if (mix->skip)
continue;
err = snd_ctl_elem_remove(loop->capt->ctl, mix->dst.id);
if (err < 0)
- logit(LOG_WARNING, "Unable to remove control '%s': %s\n", id_str(mix->dst.id), snd_strerror(err));
+ logit(LOG_WARNING, "%s: Unable to remove control '%s': %s\n", loop->id, id_str(mix->dst.id), snd_strerror(err));
}
return 0;
}
diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 86917ef..5c2fed0 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -1022,6 +1022,7 @@ static int openit(struct loopback_handle *lhandle)
device = snd_pcm_info_get_device(info);
subdevice = snd_pcm_info_get_subdevice(info);
snd_pcm_info_free(info);
+ lhandle->card_number = card;
lhandle->ctl = NULL;
if (card >= 0) {
char name[16];
diff --git a/alsaloop/test.sh b/alsaloop/test.sh
index fbd40c0..13a5ba7 100755
--- a/alsaloop/test.sh
+++ b/alsaloop/test.sh
@@ -10,7 +10,9 @@ test1() {
--tlatency 50000 \
--mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
- --mixer "name='PCM Playback Volume'"
+ --mixer "name='PCM Playback Volume'" \
+ --ossmixer "Master@VOLUME" \
+ --ossmixer "PCM@PCM"
}
test2() {
--
1.7.3.1
++++++ 0024-alsaloop-Fix-command-line-parsing-and-pollfd-initial.patch ++++++
>From e77983d3c55a7822e2151dfd60d9a20ec2023c9f Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Fri, 8 Oct 2010 22:23:05 +0200
Subject: [PATCH 24/38] alsaloop: Fix command-line parsing and pollfd initialization
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/alsaloop.c | 28 ++++++++++++++++++++--------
alsaloop/control.c | 4 ++++
alsaloop/pcmjob.c | 24 +++++++++++++-----------
alsaloop/test.sh | 18 +++++++++++++++++-
4 files changed, 54 insertions(+), 20 deletions(-)
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
index effa073..97b00d5 100644
--- a/alsaloop/alsaloop.c
+++ b/alsaloop/alsaloop.c
@@ -47,6 +47,8 @@ int daemonize = 0;
int use_syslog = 0;
struct loopback **loopbacks = NULL;
int loopbacks_count = 0;
+char **my_argv = NULL;
+int my_argc = 0;
static void my_exit(struct loopback_thread *thread, int exitcode)
{
@@ -575,9 +577,6 @@ static int parse_config_file(const char *file, snd_output_t *output)
int argc, c, err = 0;
char **argv;
- argv = malloc(sizeof(char *) * MAX_ARGS);
- if (argv == NULL)
- return -ENOMEM;
fp = fopen(file, "r");
if (fp == NULL) {
logit(LOG_CRIT, "Unable to open file '%s': %s\n", file, strerror(errno));
@@ -587,8 +586,13 @@ static int parse_config_file(const char *file, snd_output_t *output)
if (fgets(line, sizeof(line)-1, fp) == NULL)
break;
line[sizeof(line)-1] = '\0';
+ my_argv = realloc(my_argv, my_argc + MAX_ARGS * sizeof(char *));
+ if (my_argv == NULL)
+ return -ENOMEM;
+ argv = my_argv + my_argc;
argc = 0;
argv[argc++] = strdup("<prog>");
+ my_argc++;
str = line;
while (*str) {
ptr = word;
@@ -607,25 +611,30 @@ static int parse_config_file(const char *file, snd_output_t *output)
*ptr++ = *str++;
}
if (ptr != word) {
+ if (*(ptr-1) == '\n')
+ ptr--;
*ptr = '\0';
+ if (argc >= MAX_ARGS) {
+ logit(LOG_CRIT, "Too many arguments.");
+ goto __error;
+ }
argv[argc++] = strdup(word);
+ my_argc++;
}
}
/* erase runtime variables for getopt */
optarg = NULL;
optind = opterr = 1;
- optopt = 63;
+ optopt = '?';
err = parse_config(argc, argv, output);
__next:
- while (argc > 0)
- free(argv[--argc]);
if (err < 0)
break;
err = 0;
}
+ __error:
fclose(fp);
- free(argv);
return err;
}
@@ -656,7 +665,7 @@ static void thread_job1(void *_data)
pfds_count += thread->loopbacks[i]->pollfd_count;
}
pfds = calloc(pfds_count, sizeof(struct pollfd));
- if (pfds == NULL) {
+ if (pfds == NULL || pfds_count <= 0) {
logit(LOG_CRIT, "Poll FDs allocation failed.\n");
my_exit(thread, EXIT_FAILURE);
}
@@ -723,6 +732,9 @@ int main(int argc, char *argv[])
logit(LOG_CRIT, "Unable to parse arguments or configuration...\n");
exit(EXIT_FAILURE);
}
+ while (my_argc > 0)
+ free(my_argv[--my_argc]);
+ free(my_argv);
if (loopbacks_count <= 0) {
logit(LOG_CRIT, "No loopback defined...\n");
diff --git a/alsaloop/control.c b/alsaloop/control.c
index 967f1e9..8383d79 100644
--- a/alsaloop/control.c
+++ b/alsaloop/control.c
@@ -164,6 +164,10 @@ static int control_init1(struct loopback_handle *lhandle,
snd_ctl_elem_info_set_id(ctl->info, ctl->id);
snd_ctl_elem_value_set_id(ctl->value, ctl->id);
+ if (lhandle->ctl == NULL) {
+ logit(LOG_WARNING, "Unable to read control info for '%s'\n", id_str(ctl->id));
+ return -EIO;
+ }
err = snd_ctl_elem_info(lhandle->ctl, ctl->info);
if (err < 0) {
logit(LOG_WARNING, "Unable to read control info '%s': %s\n", id_str(ctl->id), snd_strerror(err));
diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 5c2fed0..df835f0 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -1195,6 +1195,16 @@ int pcmjob_start(struct loopback *loop)
snd_pcm_uframes_t count;
int err;
+ loop->pollfd_count = loop->play->ctl_pollfd_count +
+ loop->capt->ctl_pollfd_count;
+ if ((err = snd_pcm_poll_descriptors_count(loop->play->handle)) < 0)
+ goto __error;
+ loop->play->pollfd_count = err;
+ loop->pollfd_count += err;
+ if ((err = snd_pcm_poll_descriptors_count(loop->capt->handle)) < 0)
+ goto __error;
+ loop->capt->pollfd_count = err;
+ loop->pollfd_count += err;
if (loop->slave == SLAVE_TYPE_ON) {
err = get_active(loop->capt);
if (err < 0)
@@ -1214,8 +1224,6 @@ int pcmjob_start(struct loopback *loop)
goto __error;
loop->play->channels = loop->capt->channels = err;
}
- loop->pollfd_count = loop->play->ctl_pollfd_count +
- loop->capt->ctl_pollfd_count;
loop->reinit = 0;
loop->use_samplerate = 0;
loop->latency = loop->latency_req;
@@ -1258,14 +1266,6 @@ int pcmjob_start(struct loopback *loop)
if (loop->capt->rate_req != loop->capt->rate)
loop->use_samplerate = 1;
}
- if ((err = snd_pcm_poll_descriptors_count(loop->play->handle)) < 0)
- goto __error;
- loop->play->pollfd_count = err;
- loop->pollfd_count += err;
- if ((err = snd_pcm_poll_descriptors_count(loop->capt->handle)) < 0)
- goto __error;
- loop->capt->pollfd_count = err;
- loop->pollfd_count += err;
#ifdef USE_SAMPLERATE
if (loop->sync == SYNC_TYPE_SAMPLERATE)
loop->use_samplerate = 1;
@@ -1463,9 +1463,11 @@ static int handle_ctl_events(struct loopback_handle *lhandle,
if (lhandle == lhandle->loopback->play)
goto __ctl_check;
if (verbose > 6)
- snd_output_printf(lhandle->loopback->output, "ctl event!!!! %s\n", snd_ctl_event_elem_get_name(ev));
+ snd_output_printf(lhandle->loopback->output, "%s: ctl event!!!! %s\n", lhandle->id, snd_ctl_event_elem_get_name(ev));
if (ctl_event_check(lhandle->ctl_active, ev)) {
err = get_active(lhandle);
+ if (verbose > 7)
+ snd_output_printf(lhandle->loopback->output, "%s: ctl event active %i\n", lhandle->id, err);
if (err != lhandle->loopback->running)
goto __restart;
} else if (ctl_event_check(lhandle->ctl_format, ev)) {
diff --git a/alsaloop/test.sh b/alsaloop/test.sh
index 13a5ba7..91f4cbc 100755
--- a/alsaloop/test.sh
+++ b/alsaloop/test.sh
@@ -2,6 +2,7 @@
#DBG="gdb --args "
#DBG="strace"
+#DBG="valgrind --leak-check=full"
CFGFILE="/tmp/alsaloop.test.cfg"
test1() {
@@ -35,7 +36,8 @@ cat > $CFGFILE <<EOF
-C hw:1,0,0 -P plug:dmix:0 --tlatency 50000 --thread 0 \
--mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
- --mixer "name='PCM Playback Volume'"
+ --mixer "name='PCM Playback Volume'" \
+ --ossmixer "name=Master@VOLUME"
-C hw:1,0,1 -P plug:dmix:0 --tlatency 50000 --thread 1
-C hw:1,0,2 -P plug:dmix:0 --tlatency 50000 --thread 2
-C hw:1,0,3 -P plug:dmix:0 --tlatency 50000 --thread 3
@@ -56,10 +58,24 @@ test4() {
--mixer "name='PCM Playback Volume'"
}
+test5() {
+ echo "TEST5"
+cat > $CFGFILE <<EOF
+-C hw:1,0,0 -P plughw:0,0 --tlatency 50000 --thread 1 \
+ --mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
+ --mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
+ --mixer "name='PCM Playback Volume'" \
+ --ossmixer "name=Master@VOLUME"
+-C hw:1,0,1 -P plughw:0,1 --tlatency 50000 --thread 2
+EOF
+ $DBG ./alsaloop --config $CFGFILE
+}
+
case "$1" in
test1) test1 ;;
test2) test2 ;;
test3) test3 ;;
test4) test4 ;;
+test5) test5 ;;
*) test1 ;;
esac
--
1.7.3.1
++++++ 0025-alsaloop-Fixes-and-added-workaround-option.patch ++++++
>From bee994f509e6829647aa68fd276f5e8821d15445 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Mon, 11 Oct 2010 10:24:14 +0200
Subject: [PATCH 25/38] alsaloop: Fixes and added --workaround option
- added workaround for alsa-lib (pthread configuration parsing issue) -
the workaround must be activated manually using ('--workaround serialopen')
- fixed avail_min initialization (caused high CPU usage or xruns)
- fixed shared buffer initialization (both capture and playback buffers
must have equal number of samples in this config)
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/Makefile.am | 1 +
alsaloop/alsaloop.c | 9 ++++-
alsaloop/alsaloop.h | 3 +
alsaloop/pcmjob.c | 111 ++++++++++++++++++++++++++++++++++++++------------
alsaloop/test.sh | 26 +++++++-----
5 files changed, 112 insertions(+), 38 deletions(-)
diff --git a/alsaloop/Makefile.am b/alsaloop/Makefile.am
index 97d2e6f..f76eafd 100644
--- a/alsaloop/Makefile.am
+++ b/alsaloop/Makefile.am
@@ -1,5 +1,6 @@
INCLUDES = -I$(top_srcdir)/include
LDADD = -lm
+CFLAGS += -D_GNU_SOURCE
if HAVE_SAMPLERATE
LDADD += -lsamplerate
endif
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
index 97b00d5..3af3dd7 100644
--- a/alsaloop/alsaloop.c
+++ b/alsaloop/alsaloop.c
@@ -43,6 +43,7 @@ struct loopback_thread {
};
int verbose = 0;
+int workarounds = 0;
int daemonize = 0;
int use_syslog = 0;
struct loopback **loopbacks = NULL;
@@ -171,6 +172,7 @@ void help(void)
" ALSA_ID@OSS_ID (for example: \"Master@VOLUME\")\n"
"-e,--effect apply an effect (bandpass filter sweep)\n"
"-v,--verbose verbose mode (more -v means more verbose)\n"
+"-w,--workaround use workaround (serialopen)\n"
);
printf("\nRecognized sample formats are:");
for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) {
@@ -339,6 +341,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
{"thread", 1, NULL, 'T'},
{"mixer", 1, NULL, 'm'},
{"ossmixer", 1, NULL, 'O'},
+ {"workaround", 1, NULL, 'w'},
{NULL, 0, NULL, 0},
};
int err, morehelp;
@@ -370,7 +373,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
while (1) {
int c;
if ((c = getopt_long(argc, argv,
- "hdg:P:C:l:t:F:f:c:r:s:benvA:S:a:m:T:O:",
+ "hdg:P:C:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:",
long_option, NULL)) < 0)
break;
switch (c) {
@@ -504,6 +507,10 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
case 'v':
verbose++;
break;
+ case 'w':
+ if (strcasecmp(optarg, "serialopen") == 0)
+ workarounds |= WORKAROUND_SERIALOPEN;
+ break;
}
}
diff --git a/alsaloop/alsaloop.h b/alsaloop/alsaloop.h
index 366a296..6c4f40a 100644
--- a/alsaloop/alsaloop.h
+++ b/alsaloop/alsaloop.h
@@ -40,6 +40,8 @@ enum {
#define FILE_CWRITE "/tmp/alsaloop.craw"
#endif
+#define WORKAROUND_SERIALOPEN (1<<0)
+
typedef enum _sync_type {
SYNC_TYPE_NONE = 0,
SYNC_TYPE_SIMPLE, /* add or remove samples */
@@ -171,6 +173,7 @@ struct loopback {
};
extern int verbose;
+extern int workarounds;
extern int use_syslog;
#define logit(priority, fmt, args...) do { \
diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index df835f0..8b3e568 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -31,9 +31,11 @@
#include <sys/time.h>
#include <math.h>
#include <syslog.h>
+#include <pthread.h>
#include "alsaloop.h"
static int set_rate_shift(struct loopback_handle *lhandle, double pitch);
+static int get_rate(struct loopback_handle *lhandle);
#define SYNCTYPE(v) [SYNC_TYPE_##v] = #v
@@ -56,6 +58,21 @@ static const char *src_types[] = {
SRCTYPE(LINEAR)
};
+static pthread_mutex_t pcm_open_mutex =
+ PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+
+static inline void pcm_open_lock(void)
+{
+ if (workarounds & WORKAROUND_SERIALOPEN)
+ pthread_mutex_lock(&pcm_open_mutex);
+}
+
+static inline void pcm_open_unlock(void)
+{
+ if (workarounds & WORKAROUND_SERIALOPEN)
+ pthread_mutex_unlock(&pcm_open_mutex);
+}
+
static inline snd_pcm_uframes_t get_whole_latency(struct loopback *loop)
{
return loop->latency;
@@ -76,7 +93,7 @@ static int setparams_stream(struct loopback_handle *lhandle,
err = snd_pcm_hw_params_any(handle, params);
if (err < 0) {
- logit(LOG_CRIT, "Broken configuration for %s PCM: no configurations available: %s\n", snd_strerror(err), lhandle->id);
+ logit(LOG_CRIT, "Broken configuration for %s PCM: no configurations available: %s\n", lhandle->id, snd_strerror(err));
return err;
}
err = snd_pcm_hw_params_set_rate_resample(handle, params, lhandle->resample);
@@ -153,6 +170,8 @@ static int setparams_bufsize(struct loopback_handle *lhandle,
goto __again;
}
snd_pcm_hw_params_get_buffer_size(params, &periodsize);
+ if (verbose > 6)
+ snd_output_printf(lhandle->loopback->output, "%s: buffer_size=%li\n", lhandle->id, periodsize);
if (lhandle->period_size_req > 0)
periodsize = lhandle->period_size_req;
else
@@ -163,6 +182,8 @@ static int setparams_bufsize(struct loopback_handle *lhandle,
goto __again;
}
snd_pcm_hw_params_get_period_size(params, &periodsize, NULL);
+ if (verbose > 6)
+ snd_output_printf(lhandle->loopback->output, "%s: period_size=%li\n", lhandle->id, periodsize);
if (periodsize != bufsize)
bufsize = periodsize;
snd_pcm_hw_params_get_buffer_size(params, &buffersize);
@@ -175,11 +196,12 @@ static int setparams_bufsize(struct loopback_handle *lhandle,
static int setparams_set(struct loopback_handle *lhandle,
snd_pcm_hw_params_t *params,
- snd_pcm_sw_params_t *swparams)
+ snd_pcm_sw_params_t *swparams,
+ snd_pcm_uframes_t bufsize)
{
snd_pcm_t *handle = lhandle->handle;
int err;
- snd_pcm_uframes_t val, val1;
+ snd_pcm_uframes_t val, period_size, buffer_size;
err = snd_pcm_hw_params(handle, params);
if (err < 0) {
@@ -196,21 +218,29 @@ static int setparams_set(struct loopback_handle *lhandle,
logit(LOG_CRIT, "Unable to set start threshold mode for %s: %s\n", lhandle->id, snd_strerror(err));
return err;
}
- snd_pcm_hw_params_get_period_size(params, &val, NULL);
- snd_pcm_hw_params_get_buffer_size(params, &val1);
+ snd_pcm_hw_params_get_period_size(params, &period_size, NULL);
+ snd_pcm_hw_params_get_buffer_size(params, &buffer_size);
if (lhandle->nblock) {
if (lhandle == lhandle->loopback->play) {
- val = val1 - (2 * val - 4);
+ val = buffer_size - (2 * period_size - 4);
} else {
val = 4;
}
+ if (verbose > 6)
+ snd_output_printf(lhandle->loopback->output, "%s: avail_min1=%li\n", lhandle->id, val);
} else {
if (lhandle == lhandle->loopback->play) {
- snd_pcm_hw_params_get_buffer_size(params, &val1);
- val = val1 - val - val / 2;
+ val = bufsize / 2 + bufsize / 4 + bufsize / 8;
+ if (val > buffer_size / 4)
+ val = buffer_size / 4;
+ val = buffer_size - val;
} else {
- val /= 2;
+ val = bufsize / 2;
+ if (val > buffer_size / 4)
+ val = buffer_size / 4;
}
+ if (verbose > 6)
+ snd_output_printf(lhandle->loopback->output, "%s: avail_min2=%li\n", lhandle->id, val);
}
err = snd_pcm_sw_params_set_avail_min(handle, swparams, val);
if (err < 0) {
@@ -256,11 +286,11 @@ static int setparams(struct loopback *loop, snd_pcm_uframes_t bufsize)
return err;
}
- if ((err = setparams_set(loop->play, p_params, p_swparams)) < 0) {
+ if ((err = setparams_set(loop->play, p_params, p_swparams, bufsize / loop->play->pitch)) < 0) {
logit(LOG_CRIT, "Unable to set sw parameters for %s stream: %s\n", loop->play->id, snd_strerror(err));
return err;
}
- if ((err = setparams_set(loop->capt, c_params, c_swparams)) < 0) {
+ if ((err = setparams_set(loop->capt, c_params, c_swparams, bufsize / loop->capt->pitch)) < 0) {
logit(LOG_CRIT, "Unable to set sw parameters for %s stream: %s\n", loop->capt->id, snd_strerror(err));
return err;
}
@@ -495,6 +525,12 @@ static int readit(struct loopback_handle *lhandle)
int err;
avail = snd_pcm_avail_update(lhandle->handle);
+ if (avail == -EPIPE) {
+ return xrun(lhandle);
+ } else if (avail == -ESTRPIPE) {
+ if ((err = suspend(lhandle)) < 0)
+ return err;
+ }
if (avail > buf_avail(lhandle)) {
lhandle->buf_over += avail - buf_avail(lhandle);
avail = buf_avail(lhandle);
@@ -1008,7 +1044,10 @@ static int openit(struct loopback_handle *lhandle)
SND_PCM_STREAM_PLAYBACK :
SND_PCM_STREAM_CAPTURE;
int err, card, device, subdevice;
- if ((err = snd_pcm_open(&lhandle->handle, lhandle->device, stream, SND_PCM_NONBLOCK)) < 0) {
+ pcm_open_lock();
+ err = snd_pcm_open(&lhandle->handle, lhandle->device, stream, SND_PCM_NONBLOCK);
+ pcm_open_unlock();
+ if (err < 0) {
logit(LOG_CRIT, "%s open error: %s\n", lhandle->id, snd_strerror(err));
return err;
}
@@ -1027,7 +1066,9 @@ static int openit(struct loopback_handle *lhandle)
if (card >= 0) {
char name[16];
sprintf(name, "hw:%i", card);
+ pcm_open_lock();
err = snd_ctl_open(&lhandle->ctl, name, SND_CTL_NONBLOCK);
+ pcm_open_unlock();
if (err < 0) {
logit(LOG_CRIT, "%s [%s] ctl open error: %s\n", lhandle->id, name, snd_strerror(err));
lhandle->ctl = NULL;
@@ -1254,6 +1295,17 @@ int pcmjob_start(struct loopback *loop)
goto __error;
}
loop->play->buf = nbuf;
+ loop->play->buf_size = loop->capt->buf_size;
+ } else if (loop->capt->buf_size < loop->play->buf_size) {
+ char *nbuf = realloc(loop->capt->buf,
+ loop->play->buf_size *
+ loop->play->frame_size);
+ if (nbuf == NULL) {
+ err = -ENOMEM;
+ goto __error;
+ }
+ loop->capt->buf = nbuf;
+ loop->capt->buf_size = loop->play->buf_size;
}
loop->capt->buf = loop->play->buf;
} else {
@@ -1278,7 +1330,7 @@ int pcmjob_start(struct loopback *loop)
if (loop->use_samplerate) {
if (loop->capt->format != SND_PCM_FORMAT_S16 ||
loop->play->format != SND_PCM_FORMAT_S16) {
- logit(LOG_CRIT, "samplerate conversion supports only S16_LE format (%i, %i)\n", loop->play->format, loop->capt->format);
+ logit(LOG_CRIT, "samplerate conversion supports only %s format (play=%s, capt=%s)\n", snd_pcm_format_name(SND_PCM_FORMAT_S16), snd_pcm_format_name(loop->play->format), snd_pcm_format_name(loop->capt->format));
loop->use_samplerate = 0;
err = -EIO;
goto __error;
@@ -1325,6 +1377,8 @@ int pcmjob_start(struct loopback *loop)
logit(LOG_CRIT, "%s: silence error\n", loop->id);
goto __error;
}
+ if (verbose > 4)
+ snd_output_printf(loop->output, "%s: capt->buffer_size = %li, play->buffer_size = %li\n", loop->id, loop->capt->buf_size, loop->play->buf_size);
loop->pitch = 1.0;
update_pitch(loop);
loop->pitch_delta = 1.0 / ((double)loop->capt->rate * 4);
@@ -1334,8 +1388,13 @@ int pcmjob_start(struct loopback *loop)
loop->play->buf_count = count;
if (loop->play->buf == loop->capt->buf)
loop->capt->buf_pos = count;
- if (writeit(loop->play) != count) {
- logit(LOG_CRIT, "%s: initial playback fill error\n", loop->id);
+ err = writeit(loop->play);
+ if (verbose > 4)
+ snd_output_printf(loop->output, "%s: silence queued %i samples\n", loop->id, err);
+ if (count > loop->play->buffer_size)
+ count = loop->play->buffer_size;
+ if (err != count) {
+ logit(LOG_CRIT, "%s: initial playback fill error (%i/%i/%i)\n", loop->id, err, (int)count, loop->play->buffer_size);
err = -EIO;
goto __error;
}
@@ -1511,13 +1570,13 @@ int pcmjob_pollfds_handle(struct loopback *loop, struct pollfd *fds)
if (verbose > 12) {
snd_pcm_sframes_t pdelay, cdelay;
if ((err = snd_pcm_delay(play->handle, &pdelay)) < 0)
- snd_output_printf(loop->output, "%s: delay error: %s\n", play->id, snd_strerror(err));
+ snd_output_printf(loop->output, "%s: delay error: %s / %li / %li\n", play->id, snd_strerror(err), play->buf_size, play->buf_count);
else
- snd_output_printf(loop->output, "%s: delay %li\n", play->id, pdelay);
+ snd_output_printf(loop->output, "%s: delay %li / %li / %li\n", play->id, pdelay, play->buf_size, play->buf_count);
if ((err = snd_pcm_delay(capt->handle, &cdelay)) < 0)
- snd_output_printf(loop->output, "%s: delay error: %s\n", capt->id, snd_strerror(err));
+ snd_output_printf(loop->output, "%s: delay error: %s / %li / %li\n", capt->id, snd_strerror(err), capt->buf_size, capt->buf_count);
else
- snd_output_printf(loop->output, "%s: delay %li\n", capt->id, cdelay);
+ snd_output_printf(loop->output, "%s: delay %li / %li / %li\n", capt->id, cdelay, capt->buf_size, capt->buf_count);
}
idx = 0;
if (loop->running) {
@@ -1570,7 +1629,7 @@ int pcmjob_pollfds_handle(struct loopback *loop, struct pollfd *fds)
}
if (verbose > 9)
snd_output_printf(loop->output, "%s: prevents = 0x%x, crevents = 0x%x\n", loop->id, prevents, crevents);
- if (prevents == 0 && crevents == 0)
+ if (!loop->running)
goto __pcm_end;
do {
ccount = readit(capt);
@@ -1637,22 +1696,22 @@ int pcmjob_pollfds_handle(struct loopback *loop, struct pollfd *fds)
if (verbose > 4)
snd_output_printf(loop->output, "%s: queued %li/%li samples\n", loop->id, pqueued, cqueued);
if (pqueued > 0)
- loop->play->total_queued += pqueued;
+ play->total_queued += pqueued;
if (cqueued > 0)
- loop->capt->total_queued += cqueued;
+ capt->total_queued += cqueued;
if (pqueued > 0 || cqueued > 0)
loop->total_queued_count += 1;
}
if (verbose > 12) {
snd_pcm_sframes_t pdelay, cdelay;
if ((err = snd_pcm_delay(play->handle, &pdelay)) < 0)
- snd_output_printf(loop->output, "%s: end delay error: %s\n", play->id, snd_strerror(err));
+ snd_output_printf(loop->output, "%s: end delay error: %s / %li / %li\n", play->id, snd_strerror(err), play->buf_size, play->buf_count);
else
- snd_output_printf(loop->output, "%s: end delay %li\n", play->id, pdelay);
+ snd_output_printf(loop->output, "%s: end delay %li / %li / %li\n", play->id, pdelay, play->buf_size, play->buf_count);
if ((err = snd_pcm_delay(capt->handle, &cdelay)) < 0)
- snd_output_printf(loop->output, "%s: end delay error: %s\n", capt->id, snd_strerror(err));
+ snd_output_printf(loop->output, "%s: end delay error: %s / %li / %li\n", capt->id, snd_strerror(err), capt->buf_size, capt->buf_count);
else
- snd_output_printf(loop->output, "%s: end delay %li\n", capt->id, cdelay);
+ snd_output_printf(loop->output, "%s: end delay %li / %li / %li\n", capt->id, cdelay, capt->buf_size, capt->buf_count);
}
__pcm_end:
if (verbose > 13) {
diff --git a/alsaloop/test.sh b/alsaloop/test.sh
index 91f4cbc..e3d81b1 100755
--- a/alsaloop/test.sh
+++ b/alsaloop/test.sh
@@ -3,6 +3,7 @@
#DBG="gdb --args "
#DBG="strace"
#DBG="valgrind --leak-check=full"
+ARGS=
CFGFILE="/tmp/alsaloop.test.cfg"
test1() {
@@ -13,7 +14,8 @@ test1() {
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
--mixer "name='PCM Playback Volume'" \
--ossmixer "Master@VOLUME" \
- --ossmixer "PCM@PCM"
+ --ossmixer "PCM@PCM" \
+ $ARGS
}
test2() {
@@ -27,7 +29,7 @@ cat > $CFGFILE <<EOF
# next line - second job
-C hw:1,0,1 -P hw:0,1,0 --tlatency 50000 --thread 2
EOF
- $DBG ./alsaloop -d --config $CFGFILE
+ $DBG ./alsaloop -d --config $CFGFILE $ARGS
}
test3() {
@@ -46,7 +48,8 @@ cat > $CFGFILE <<EOF
-C hw:1,0,6 -P plug:dmix:0 --tlatency 50000 --thread 6
-C hw:1,0,7 -P plug:dmix:0 --tlatency 50000 --thread 7
EOF
- $DBG ./alsaloop --config $CFGFILE
+ LD_PRELOAD="/home/perex/alsa/alsa-lib/src/.libs/libasound.so" \
+ $DBG ./alsaloop --config $CFGFILE $ARGS
}
test4() {
@@ -55,7 +58,8 @@ test4() {
--tlatency 50000 \
--mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
- --mixer "name='PCM Playback Volume'"
+ --mixer "name='PCM Playback Volume'" \
+ $ARGS
}
test5() {
@@ -68,14 +72,14 @@ cat > $CFGFILE <<EOF
--ossmixer "name=Master@VOLUME"
-C hw:1,0,1 -P plughw:0,1 --tlatency 50000 --thread 2
EOF
- $DBG ./alsaloop --config $CFGFILE
+ $DBG ./alsaloop --config $CFGFILE $ARGS
}
case "$1" in
-test1) test1 ;;
-test2) test2 ;;
-test3) test3 ;;
-test4) test4 ;;
-test5) test5 ;;
-*) test1 ;;
+test1) shift; ARGS="$@"; test1 ;;
+test2) shift; ARGS="$@"; test2 ;;
+test3) shift; ARGS="$@"; test3 ;;
+test4) shift; ARGS="$@"; test4 ;;
+test5) shift; ARGS="$@"; test5 ;;
+*) ARGS="$@"; test1 ;;
esac
--
1.7.3.1
++++++ 0026-alsaloop-add-pctl-and-cctl-options.patch ++++++
>From 38c2ef96b78d8733957f03b74799d953b83e045d Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Mon, 11 Oct 2010 11:53:50 +0200
Subject: [PATCH 26/38] alsaloop: add --pctl and --cctl options
In some cases it might be usefull to specify another CTL device names.
Add -X/--pctl and -Y/--cctl options.
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/alsaloop.c | 28 +++++++++++++++++++++++++---
alsaloop/alsaloop.h | 1 +
alsaloop/pcmjob.c | 13 ++++++++-----
3 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
index 3af3dd7..1b3505e 100644
--- a/alsaloop/alsaloop.c
+++ b/alsaloop/alsaloop.c
@@ -66,6 +66,7 @@ static void my_exit(struct loopback_thread *thread, int exitcode)
static int create_loopback_handle(struct loopback_handle **_handle,
const char *device,
+ const char *ctldev,
const char *id)
{
char idbuf[1024];
@@ -77,6 +78,15 @@ static int create_loopback_handle(struct loopback_handle **_handle,
if (device == NULL)
device = "hw:0,0";
handle->device = strdup(device);
+ if (handle->device == NULL)
+ return -ENOMEM;
+ if (ctldev) {
+ handle->ctldev = strdup(ctldev);
+ if (handle->ctldev == NULL)
+ return -ENOMEM;
+ } else {
+ handle->ctldev = NULL;
+ }
snprintf(idbuf, sizeof(idbuf)-1, "%s %s", id, device);
idbuf[sizeof(idbuf)-1] = '\0';
handle->id = strdup(idbuf);
@@ -150,6 +160,8 @@ void help(void)
"-d,--daemonize daemonize the main process and use syslog for errors\n"
"-P,--pdevice playback device\n"
"-C,--cdevice capture device\n"
+"-X,--pctl playback ctl device\n"
+"-Y,--cctl capture ctl device\n"
"-l,--latency requested latency in frames\n"
"-t,--tlatency requested latency in usec (1/1000000sec)\n"
"-f,--format sample format\n"
@@ -323,6 +335,8 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
{"daemonize", 0, NULL, 'd'},
{"pdevice", 1, NULL, 'P'},
{"cdevice", 1, NULL, 'C'},
+ {"pctl", 1, NULL, 'X'},
+ {"cctl", 1, NULL, 'Y'},
{"latency", 1, NULL, 'l'},
{"tlatency", 1, NULL, 't'},
{"format", 1, NULL, 'f'},
@@ -348,6 +362,8 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
char *arg_config = NULL;
char *arg_pdevice = NULL;
char *arg_cdevice = NULL;
+ char *arg_pctl = NULL;
+ char *arg_cctl = NULL;
unsigned int arg_latency_req = 0;
unsigned int arg_latency_reqtime = 10000;
snd_pcm_format_t arg_format = SND_PCM_FORMAT_S16_LE;
@@ -373,7 +389,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
while (1) {
int c;
if ((c = getopt_long(argc, argv,
- "hdg:P:C:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:",
+ "hdg:P:C:X:Y:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:",
long_option, NULL)) < 0)
break;
switch (c) {
@@ -394,6 +410,12 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
case 'C':
arg_cdevice = strdup(optarg);
break;
+ case 'X':
+ arg_pctl = strdup(optarg);
+ break;
+ case 'Y':
+ arg_cctl = strdup(optarg);
+ break;
case 'l':
err = atoi(optarg);
arg_latency_req = err >= 4 ? err : 4;
@@ -521,12 +543,12 @@ static int parse_config(int argc, char *argv[], snd_output_t *output)
if (arg_config == NULL) {
struct loopback_handle *play;
struct loopback_handle *capt;
- err = create_loopback_handle(&play, arg_pdevice, "playback");
+ err = create_loopback_handle(&play, arg_pdevice, arg_pctl, "playback");
if (err < 0) {
logit(LOG_CRIT, "Unable to create playback handle.\n");
exit(EXIT_FAILURE);
}
- err = create_loopback_handle(&capt, arg_cdevice, "capture");
+ err = create_loopback_handle(&capt, arg_cdevice, arg_cctl, "capture");
if (err < 0) {
logit(LOG_CRIT, "Unable to create capture handle.\n");
exit(EXIT_FAILURE);
diff --git a/alsaloop/alsaloop.h b/alsaloop/alsaloop.h
index 6c4f40a..7516807 100644
--- a/alsaloop/alsaloop.h
+++ b/alsaloop/alsaloop.h
@@ -84,6 +84,7 @@ struct loopback_ossmixer {
struct loopback_handle {
struct loopback *loopback;
char *device;
+ char *ctldev;
char *id;
int card_number;
snd_pcm_t *handle;
diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 8b3e568..9d1bb01 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -1063,14 +1063,17 @@ static int openit(struct loopback_handle *lhandle)
snd_pcm_info_free(info);
lhandle->card_number = card;
lhandle->ctl = NULL;
- if (card >= 0) {
- char name[16];
- sprintf(name, "hw:%i", card);
+ if (card >= 0 || lhandle->ctldev) {
+ char name[16], *dev = lhandle->ctldev;
+ if (dev == NULL) {
+ sprintf(name, "hw:%i", card);
+ dev = name;
+ }
pcm_open_lock();
- err = snd_ctl_open(&lhandle->ctl, name, SND_CTL_NONBLOCK);
+ err = snd_ctl_open(&lhandle->ctl, dev, SND_CTL_NONBLOCK);
pcm_open_unlock();
if (err < 0) {
- logit(LOG_CRIT, "%s [%s] ctl open error: %s\n", lhandle->id, name, snd_strerror(err));
+ logit(LOG_CRIT, "%s [%s] ctl open error: %s\n", lhandle->id, dev, snd_strerror(err));
lhandle->ctl = NULL;
}
if (lhandle->ctl)
--
1.7.3.1
++++++ 0027-alsaloop-add-pctl-and-cctl-options-to-man-page.patch ++++++
>From af61ea60cfabb6b59b29a1e26769a7068a5742e1 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Mon, 11 Oct 2010 11:56:16 +0200
Subject: [PATCH 27/38] alsaloop: add --pctl and --cctl options to man page
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz># Please enter the commit message for your changes. Lines starting
---
alsaloop/alsaloop.1 | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/alsaloop/alsaloop.1 b/alsaloop/alsaloop.1
index 1554b6e..0b57b59 100644
--- a/alsaloop/alsaloop.1
+++ b/alsaloop/alsaloop.1
@@ -48,6 +48,16 @@ Use given playback device.
Use given capture device.
.TP
+\fI\-X <device>\fP | \fI\-\-pctl=<device>\fP
+
+Use given CTL device for playback.
+
+.TP
+\fI\-Y <device>\fP | \fI\-\-cctl=<device>\fP
+
+Use given CTL device for capture.
+
+.TP
\fI\-l <latency>\fP | \fI\-\-latency=<frames>\fP
Requested latency in frames.
--
1.7.3.1
++++++ 0028-alsaloop-added-xrun-profiling-support-U-xrun-added-S.patch ++++++
++++ 677 lines (skipped)
++++++ 0029-alsaloop-add-U-xrun-to-alsaloop.1-man-page.patch ++++++
>From b68986fb4a946ef736295d3b2f24f1e6fab1e77d Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Wed, 13 Oct 2010 23:41:29 +0200
Subject: [PATCH 29/38] alsaloop: add -U/--xrun to alsaloop.1 man page
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/alsaloop.1 | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/alsaloop/alsaloop.1 b/alsaloop/alsaloop.1
index 0b57b59..65edba1 100644
--- a/alsaloop/alsaloop.1
+++ b/alsaloop/alsaloop.1
@@ -184,6 +184,12 @@ Known OSS attributes:
Verbose mode. Use multiple times to increase verbosity.
+.TP
+\fI\-U\fP | \fI\-\-xrun\fP
+
+Verbose xrun profiling.
+
+
.SH EXAMPLES
.TP
--
1.7.3.1
++++++ 0030-alsaloop-fixes-added-W-wake-option.patch ++++++
>From 513a9c7ad179e9786a7d2ff0aa651d42f9674697 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Thu, 14 Oct 2010 11:17:25 +0200
Subject: [PATCH 30/38] alsaloop: fixes, added -W/--wake option
- added -W/--wake option to reduce poll time
- another try to fix the avail_min parameter for playback
- fixed initial silence fill
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/alsaloop.1 | 4 ++
alsaloop/alsaloop.c | 20 +++++++++--
alsaloop/alsaloop.h | 4 ++
alsaloop/pcmjob.c | 90 ++++++++++++++++++++++++++++++++++++++-------------
alsaloop/test.sh | 17 +++++----
5 files changed, 101 insertions(+), 34 deletions(-)
diff --git a/alsaloop/alsaloop.1 b/alsaloop/alsaloop.1
index 65edba1..048d1e0 100644
--- a/alsaloop/alsaloop.1
+++ b/alsaloop/alsaloop.1
@@ -189,6 +189,10 @@ Verbose mode. Use multiple times to increase verbosity.
Verbose xrun profiling.
+.TP
+\fI\-W <timeout>\fP | \fI\-\-wake=<timeout>\fP
+
+Set process wake timeout.
.SH EXAMPLES
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
index 561fdd7..8710dd1 100644
--- a/alsaloop/alsaloop.c
+++ b/alsaloop/alsaloop.c
@@ -56,6 +56,7 @@ struct loopback_thread *threads;
int threads_count = 0;
pthread_t main_job;
int arg_default_xrun = 0;
+int arg_default_wake = 0;
static void my_exit(struct loopback_thread *thread, int exitcode)
{
@@ -193,6 +194,7 @@ void help(void)
"-v,--verbose verbose mode (more -v means more verbose)\n"
"-w,--workaround use workaround (serialopen)\n"
"-U,--xrun xrun profiling\n"
+"-W,--wake process wake timeout in ms\n"
);
printf("\nRecognized sample formats are:");
for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) {
@@ -395,12 +397,13 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
char *arg_ossmixers[MAX_MIXERS];
int arg_ossmixers_count = 0;
int arg_xrun = arg_default_xrun;
+ int arg_wake = arg_default_wake;
morehelp = 0;
while (1) {
int c;
if ((c = getopt_long(argc, argv,
- "hdg:P:C:X:Y:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:U",
+ "hdg:P:C:X:Y:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:UW:",
long_option, NULL)) < 0)
break;
switch (c) {
@@ -549,6 +552,11 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
if (cmdline)
arg_default_xrun = 1;
break;
+ case 'W':
+ arg_wake = atoi(optarg);
+ if (cmdline)
+ arg_default_wake = arg_wake;
+ break;
}
}
@@ -587,6 +595,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
loop->slave = arg_slave;
loop->thread = arg_thread;
loop->xrun = arg_xrun;
+ loop->wake = arg_wake;
err = add_mixers(loop, arg_mixers, arg_mixers_count);
if (err < 0) {
logit(LOG_CRIT, "Unable to add mixer controls.\n");
@@ -691,7 +700,7 @@ static void thread_job1(void *_data)
snd_output_t *output = thread->output;
struct pollfd *pfds = NULL;
int pfds_count = 0;
- int i, j, err;
+ int i, j, err, wake = 1000000;
setscheduler();
@@ -709,7 +718,12 @@ static void thread_job1(void *_data)
my_exit(thread, EXIT_FAILURE);
}
pfds_count += thread->loopbacks[i]->pollfd_count;
+ j = thread->loopbacks[i]->wake;
+ if (j > 0 && j < wake)
+ wake = j;
}
+ if (wake >= 1000000)
+ wake = -1;
pfds = calloc(pfds_count, sizeof(struct pollfd));
if (pfds == NULL || pfds_count <= 0) {
logit(LOG_CRIT, "Poll FDs allocation failed.\n");
@@ -727,7 +741,7 @@ static void thread_job1(void *_data)
}
if (verbose > 10)
gettimeofday(&tv1, NULL);
- err = poll(pfds, j, -1);
+ err = poll(pfds, j, wake);
if (err < 0)
err = -errno;
if (verbose > 10) {
diff --git a/alsaloop/alsaloop.h b/alsaloop/alsaloop.h
index 839fc6d..e506427 100644
--- a/alsaloop/alsaloop.h
+++ b/alsaloop/alsaloop.h
@@ -146,6 +146,7 @@ struct loopback {
sync_type_t sync; /* type of sync */
slave_type_t slave;
int thread; /* thread number */
+ unsigned int wake;
/* statistics */
double pitch;
double pitch_delta;
@@ -164,6 +165,9 @@ struct loopback {
snd_timestamp_t xrun_last_check;
snd_pcm_sframes_t xrun_last_pdelay;
snd_pcm_sframes_t xrun_last_cdelay;
+ snd_pcm_uframes_t xrun_buf_pcount;
+ snd_pcm_uframes_t xrun_buf_ccount;
+ unsigned int xrun_out_frames;
long xrun_max_proctime;
double xrun_max_missing;
/* control mixer */
diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 0f1a853..6aa8bfe 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -83,16 +83,16 @@ static inline snd_pcm_uframes_t get_whole_latency(struct loopback *loop)
}
static inline unsigned long long
- frames_to_time(struct loopback_handle *lhandle,
+ frames_to_time(unsigned int rate,
snd_pcm_uframes_t frames)
{
- return (frames * 1000000ULL) / lhandle->rate;
+ return (frames * 1000000ULL) / rate;
}
-static inline snd_pcm_uframes_t time_to_frames(struct loopback_handle *lhandle,
+static inline snd_pcm_uframes_t time_to_frames(unsigned int rate,
unsigned long long time)
{
- return (time * lhandle->rate) / 1000000ULL;
+ return (time * rate) / 1000000ULL;
}
static int setparams_stream(struct loopback_handle *lhandle,
@@ -245,12 +245,16 @@ static int setparams_set(struct loopback_handle *lhandle,
snd_output_printf(lhandle->loopback->output, "%s: avail_min1=%li\n", lhandle->id, val);
} else {
if (lhandle == lhandle->loopback->play) {
- val = bufsize / 2 + bufsize / 4 + bufsize / 8;
- if (val > buffer_size / 4)
- val = buffer_size / 4;
+ val = bufsize + bufsize / 2;
+ if (val < (period_size * 3) / 4)
+ val = (period_size * 3) / 4;
+ if (val > (buffer_size * 3) / 4)
+ val = (buffer_size * 3) / 4;
val = buffer_size - val;
} else {
val = bufsize / 2;
+ if (val < period_size / 2)
+ val = period_size / 2;
if (val > buffer_size / 4)
val = buffer_size / 4;
}
@@ -372,6 +376,11 @@ static void xrun_profile0(struct loopback *loop)
getcurtimestamp(&loop->xrun_last_update);
loop->xrun_last_pdelay = pdelay;
loop->xrun_last_cdelay = cdelay;
+ loop->xrun_buf_pcount = loop->play->buf_count;
+ loop->xrun_buf_ccount = loop->capt->buf_count;
+#ifdef USE_SAMPLERATE
+ loop->xrun_out_frames = loop->src_out_frames;
+#endif
}
}
@@ -384,27 +393,45 @@ static inline void xrun_profile(struct loopback *loop)
static void xrun_stats0(struct loopback *loop)
{
snd_timestamp_t t;
- double expected, last, wake, check, queued = -1, proc, missing;
+ double expected, last, wake, check, queued = -1, proc, missing = -1;
+ double maxbuf, pfilled, cfilled, cqueued = -1, avail_min;
+ double sincejob;
expected = ((double)loop->latency /
- (double)loop->play->rate) * 1000;
+ (double)loop->play->rate_req) * 1000;
getcurtimestamp(&t);
last = (double)timediff(t, loop->xrun_last_update) / 1000;
wake = (double)timediff(t, loop->xrun_last_wake) / 1000;
check = (double)timediff(t, loop->xrun_last_check) / 1000;
+ sincejob = (double)timediff(t, loop->tstamp_start) / 1000;
if (loop->xrun_last_pdelay != XRUN_PROFILE_UNKNOWN)
- queued = (((double)loop->xrun_last_pdelay *
- loop->play->pitch) /
+ queued = ((double)loop->xrun_last_pdelay /
+ (double)loop->play->rate) * 1000;
+ if (loop->xrun_last_cdelay != XRUN_PROFILE_UNKNOWN)
+ cqueued = ((double)loop->xrun_last_cdelay /
+ (double)loop->capt->rate) * 1000;
+ maxbuf = ((double)loop->play->buffer_size /
(double)loop->play->rate) * 1000;
proc = (double)loop->xrun_max_proctime / 1000;
- missing = last - queued;
- if (loop->xrun_max_missing < missing)
+ pfilled = ((double)(loop->xrun_buf_pcount + loop->xrun_out_frames) /
+ (double)loop->play->rate) * 1000;
+ cfilled = ((double)loop->xrun_buf_ccount /
+ (double)loop->capt->rate) * 1000;
+ avail_min = (((double)loop->play->buffer_size -
+ (double)loop->play->avail_min ) /
+ (double)loop->play->rate) * 1000;
+ avail_min = expected - avail_min;
+ if (queued >= 0)
+ missing = last - queued;
+ if (missing >= 0 && loop->xrun_max_missing < missing)
loop->xrun_max_missing = missing;
loop->xrun_max_proctime = 0;
getcurtimestamp(&t);
- logit(LOG_INFO, " last write before %.4fms, queued %.4fms -> missing %.4fms\n", last, queued, missing);
+ logit(LOG_INFO, " last write before %.4fms, queued %.4fms/%.4fms -> missing %.4fms\n", last, queued, cqueued, missing);
logit(LOG_INFO, " expected %.4fms, processing %.4fms, max missing %.4fms\n", expected, proc, loop->xrun_max_missing);
- logit(LOG_INFO, " last wake before %.4fms, last check before %.4fms\n", wake, check);
+ logit(LOG_INFO, " last wake %.4fms, last check %.4fms, avail_min %.4fms\n", wake, check, avail_min);
+ logit(LOG_INFO, " max buf %.4fms, pfilled %.4fms, cfilled %.4fms\n", maxbuf, pfilled, cfilled);
+ logit(LOG_INFO, " job started before %.4fms\n", sincejob);
}
static inline void xrun_stats(struct loopback *loop)
@@ -483,7 +510,14 @@ static void buf_add_src(struct loopback *loop)
count1 = count;
if (count1 + pos1 > capt->buf_size)
count1 = capt->buf_size - pos1;
- src_short_to_float_array((short *)(capt->buf +
+ if (capt->format == SND_PCM_FORMAT_S32)
+ src_int_to_float_array((int *)(capt->buf +
+ pos1 * capt->frame_size),
+ loop->src_data.data_in +
+ pos * capt->channels,
+ count1 * capt->channels);
+ else
+ src_short_to_float_array((short *)(capt->buf +
pos1 * capt->frame_size),
loop->src_data.data_in +
pos * capt->channels,
@@ -514,7 +548,14 @@ static void buf_add_src(struct loopback *loop)
count1 = buf_avail(play);
if (count1 == 0)
break;
- src_float_to_short_array(loop->src_data.data_out +
+ if (capt->format == SND_PCM_FORMAT_S32)
+ src_float_to_int_array(loop->src_data.data_out +
+ pos * play->channels,
+ (int *)(play->buf +
+ pos1 * play->frame_size),
+ count1 * play->channels);
+ else
+ src_float_to_short_array(loop->src_data.data_out +
pos * play->channels,
(short *)(play->buf +
pos1 * play->frame_size),
@@ -691,12 +732,12 @@ static int writeit(struct loopback_handle *lhandle)
fwrite(lhandle->buf + lhandle->buf_pos * lhandle->frame_size,
r, lhandle->frame_size, lhandle->loopback->pfile);
#endif
- xrun_profile(lhandle->loopback);
res += r;
lhandle->counter += r;
lhandle->buf_count -= r;
lhandle->buf_pos += r;
lhandle->buf_pos %= lhandle->buf_size;
+ xrun_profile(lhandle->loopback);
}
return res;
}
@@ -919,6 +960,7 @@ static int xrun_sync(struct loopback *loop)
snd_output_printf(loop->output, "%s: sync verify: %li\n", loop->id, delay1);
}
}
+ loop->xrun_max_proctime = 0;
return 0;
}
@@ -1344,11 +1386,11 @@ int pcmjob_start(struct loopback *loop)
loop->reinit = 0;
loop->use_samplerate = 0;
if (loop->latency_req) {
- loop->latency_reqtime = frames_to_time(loop->play,
+ loop->latency_reqtime = frames_to_time(loop->play->rate_req,
loop->latency_req);
loop->latency_req = 0;
}
- loop->latency = time_to_frames(loop->play, loop->latency_reqtime);
+ loop->latency = time_to_frames(loop->play->rate_req, loop->latency_reqtime);
if ((err = setparams(loop, loop->latency/2)) < 0)
goto __error;
if (verbose)
@@ -1406,9 +1448,11 @@ int pcmjob_start(struct loopback *loop)
goto __error;
}
if (loop->use_samplerate) {
- if (loop->capt->format != SND_PCM_FORMAT_S16 ||
- loop->play->format != SND_PCM_FORMAT_S16) {
- logit(LOG_CRIT, "samplerate conversion supports only %s format (play=%s, capt=%s)\n", snd_pcm_format_name(SND_PCM_FORMAT_S16), snd_pcm_format_name(loop->play->format), snd_pcm_format_name(loop->capt->format));
+ if ((loop->capt->format != SND_PCM_FORMAT_S16 ||
+ loop->play->format != SND_PCM_FORMAT_S16) &&
+ (loop->capt->format != SND_PCM_FORMAT_S32 ||
+ loop->play->format != SND_PCM_FORMAT_S32)) {
+ logit(LOG_CRIT, "samplerate conversion supports only %s or %s formats (play=%s, capt=%s)\n", snd_pcm_format_name(SND_PCM_FORMAT_S16), snd_pcm_format_name(SND_PCM_FORMAT_S32), snd_pcm_format_name(loop->play->format), snd_pcm_format_name(loop->capt->format));
loop->use_samplerate = 0;
err = -EIO;
goto __error;
diff --git a/alsaloop/test.sh b/alsaloop/test.sh
index ff9aa4e..fac72b9 100755
--- a/alsaloop/test.sh
+++ b/alsaloop/test.sh
@@ -34,19 +34,20 @@ EOF
test3() {
echo "TEST3"
+ LATENCY=180000
cat > $CFGFILE <<EOF
--C hw:1,0,0 -P plug:dmix:0 --tlatency 30000 --thread 0 \
+-C hw:1,0,0 -P plug:dmix:0 --tlatency $LATENCY --thread 0 \
--mixer "name='Master Playback Volume'@name='Master Playback Volume'" \
--mixer "name='Master Playback Switch'@name='Master Playback Switch'" \
--mixer "name='PCM Playback Volume'" \
--ossmixer "name=Master@VOLUME"
--C hw:1,0,1 -P plug:dmix:0 --tlatency 30000 --thread 1
--C hw:1,0,2 -P plug:dmix:0 --tlatency 30000 --thread 2
--C hw:1,0,3 -P plug:dmix:0 --tlatency 30000 --thread 3
--C hw:1,0,4 -P plug:dmix:0 --tlatency 30000 --thread 4
--C hw:1,0,5 -P plug:dmix:0 --tlatency 30000 --thread 5
--C hw:1,0,6 -P plug:dmix:0 --tlatency 30000 --thread 6
--C hw:1,0,7 -P plug:dmix:0 --tlatency 30000 --thread 7
+-C hw:1,0,1 -P plug:dmix:0 --tlatency $LATENCY --thread 1
+-C hw:1,0,2 -P plug:dmix:0 --tlatency $LATENCY --thread 2
+-C hw:1,0,3 -P plug:dmix:0 --tlatency $LATENCY --thread 3
+-C hw:1,0,4 -P plug:dmix:0 --tlatency $LATENCY --thread 4
+-C hw:1,0,5 -P plug:dmix:0 --tlatency $LATENCY --thread 5
+-C hw:1,0,6 -P plug:dmix:0 --tlatency $LATENCY --thread 6
+-C hw:1,0,7 -P plug:dmix:0 --tlatency $LATENCY --thread 7
EOF
$DBG ./alsaloop --config $CFGFILE $ARGS
}
--
1.7.3.1
++++++ 0031-alsaloop-Fix-latency-print.patch ++++++
>From 1ae28cae89a12ed39532bc2a3596e4efa0189e4c Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Thu, 14 Oct 2010 15:39:28 +0200
Subject: [PATCH 31/38] alsaloop: Fix latency print
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/pcmjob.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 6aa8bfe..925380c 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -1394,7 +1394,7 @@ int pcmjob_start(struct loopback *loop)
if ((err = setparams(loop, loop->latency/2)) < 0)
goto __error;
if (verbose)
- showlatency(loop->output, loop->latency, loop->play->rate, "Latency");
+ showlatency(loop->output, loop->latency, loop->play->rate_req, "Latency");
if (loop->play->access == loop->capt->access &&
loop->play->format == loop->capt->format &&
loop->play->rate == loop->capt->rate &&
--
1.7.3.1
++++++ 0032-speaker-test-Don-t-retry-after-fatal-errors.patch ++++++
>From b67d215d20bcf546617de962dec60cc29b238e4e Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson(a)canonical.com>
Date: Fri, 15 Oct 2010 12:30:44 +0200
Subject: [PATCH 32/38] speaker-test: Don't retry after fatal errors
Fixup commit 9b1a2566: Remove error loop
Signed-off-by: David Henningsson <david.henningsson(a)canonical.com>
Signed-off-by: Takashi Iwai <tiwai(a)suse.de>
---
speaker-test/speaker-test.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c
index 458a8d7..3029110 100644
--- a/speaker-test/speaker-test.c
+++ b/speaker-test/speaker-test.c
@@ -993,9 +993,9 @@ int main(int argc, char *argv[]) {
}
- while ((err = snd_pcm_open(&handle, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
+ if ((err = snd_pcm_open(&handle, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
printf(_("Playback open error: %d,%s\n"), err,snd_strerror(err));
- sleep(1);
+ exit(EXIT_FAILURE);
}
if ((err = set_hwparams(handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) {
--
1.7.3.1
++++++ 0033-alsaloop-Delay-the-restart-a-bit-to-handle-snd-aloop.patch ++++++
>From d53eb0309df34f058b33c18210c8949c8a2d8b8e Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Wed, 20 Oct 2010 09:26:24 +0200
Subject: [PATCH 33/38] alsaloop: Delay the restart a bit (to handle snd-aloop playback xruns better)
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/alsaloop.h | 2 ++
alsaloop/pcmjob.c | 33 ++++++++++++++++++++++++++-------
2 files changed, 28 insertions(+), 7 deletions(-)
diff --git a/alsaloop/alsaloop.h b/alsaloop/alsaloop.h
index e506427..8dc445a 100644
--- a/alsaloop/alsaloop.h
+++ b/alsaloop/alsaloop.h
@@ -143,6 +143,8 @@ struct loopback {
unsigned int linked:1; /* linked streams */
unsigned int reinit:1;
unsigned int running:1;
+ unsigned int stop_pending:1;
+ snd_pcm_uframes_t stop_count;
sync_type_t sync; /* type of sync */
slave_type_t slave;
int thread; /* thread number */
diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 925380c..23270a0 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -738,6 +738,15 @@ static int writeit(struct loopback_handle *lhandle)
lhandle->buf_pos += r;
lhandle->buf_pos %= lhandle->buf_size;
xrun_profile(lhandle->loopback);
+ if (lhandle->loopback->stop_pending) {
+ lhandle->loopback->stop_count += r;
+ if (lhandle->loopback->stop_count * lhandle->pitch >
+ lhandle->loopback->latency * 3) {
+ lhandle->loopback->stop_pending = 0;
+ lhandle->loopback->reinit = 1;
+ break;
+ }
+ }
}
return res;
}
@@ -1521,6 +1530,7 @@ int pcmjob_start(struct loopback *loop)
goto __error;
}
loop->running = 1;
+ loop->stop_pending = 0;
if (loop->xrun) {
getcurtimestamp(&loop->xrun_last_update);
loop->xrun_last_pdelay = XRUN_PROFILE_UNKNOWN;
@@ -1638,6 +1648,7 @@ static int ctl_event_check(snd_ctl_elem_value_t *val, snd_ctl_event_t *ev)
static int handle_ctl_events(struct loopback_handle *lhandle,
unsigned short events)
{
+ struct loopback *loop = lhandle->loopback;
snd_ctl_event_t *ev;
int err;
@@ -1647,16 +1658,24 @@ static int handle_ctl_events(struct loopback_handle *lhandle,
break;
if (snd_ctl_event_get_type(ev) != SND_CTL_EVENT_ELEM)
continue;
- if (lhandle == lhandle->loopback->play)
+ if (lhandle == loop->play)
goto __ctl_check;
if (verbose > 6)
- snd_output_printf(lhandle->loopback->output, "%s: ctl event!!!! %s\n", lhandle->id, snd_ctl_event_elem_get_name(ev));
+ snd_output_printf(loop->output, "%s: ctl event!!!! %s\n", lhandle->id, snd_ctl_event_elem_get_name(ev));
if (ctl_event_check(lhandle->ctl_active, ev)) {
err = get_active(lhandle);
if (verbose > 7)
- snd_output_printf(lhandle->loopback->output, "%s: ctl event active %i\n", lhandle->id, err);
- if (err != lhandle->loopback->running)
- goto __restart;
+ snd_output_printf(loop->output, "%s: ctl event active %i\n", lhandle->id, err);
+ if (!err) {
+ if (lhandle->loopback->running) {
+ loop->stop_pending = 1;
+ loop->stop_count = 0;
+ }
+ } else {
+ loop->stop_pending = 0;
+ if (loop->running == 0)
+ goto __restart;
+ }
} else if (ctl_event_check(lhandle->ctl_format, ev)) {
err = get_format(lhandle);
if (lhandle->format != err)
@@ -1676,8 +1695,8 @@ static int handle_ctl_events(struct loopback_handle *lhandle,
return 0;
__restart:
- pcmjob_stop(lhandle->loopback);
- err = pcmjob_start(lhandle->loopback);
+ pcmjob_stop(loop);
+ err = pcmjob_start(loop);
if (err < 0)
return err;
return 1;
--
1.7.3.1
++++++ 0034-alsaloop-rework-the-ctl-event-handling-routine.patch ++++++
>From 7a11a2b5464e86573f01af6cf4637ffdc0351478 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Thu, 21 Oct 2010 20:38:06 +0200
Subject: [PATCH 34/38] alsaloop: rework the ctl event handling routine
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
alsaloop/pcmjob.c | 51 +++++++++++++++++++++++++++------------------------
1 files changed, 27 insertions(+), 24 deletions(-)
diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 23270a0..0b84803 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -1650,7 +1650,7 @@ static int handle_ctl_events(struct loopback_handle *lhandle,
{
struct loopback *loop = lhandle->loopback;
snd_ctl_event_t *ev;
- int err;
+ int err, restart = 0;
snd_ctl_event_alloca(&ev);
while ((err = snd_ctl_read(lhandle->ctl, ev)) != 0 && err != -EAGAIN) {
@@ -1663,42 +1663,45 @@ static int handle_ctl_events(struct loopback_handle *lhandle,
if (verbose > 6)
snd_output_printf(loop->output, "%s: ctl event!!!! %s\n", lhandle->id, snd_ctl_event_elem_get_name(ev));
if (ctl_event_check(lhandle->ctl_active, ev)) {
- err = get_active(lhandle);
- if (verbose > 7)
- snd_output_printf(loop->output, "%s: ctl event active %i\n", lhandle->id, err);
- if (!err) {
- if (lhandle->loopback->running) {
- loop->stop_pending = 1;
- loop->stop_count = 0;
- }
- } else {
- loop->stop_pending = 0;
- if (loop->running == 0)
- goto __restart;
- }
+ continue;
} else if (ctl_event_check(lhandle->ctl_format, ev)) {
err = get_format(lhandle);
if (lhandle->format != err)
- goto __restart;
+ restart = 1;
+ continue;
} else if (ctl_event_check(lhandle->ctl_rate, ev)) {
err = get_rate(lhandle);
if (lhandle->rate != err)
- goto __restart;
+ restart = 1;
+ continue;
} else if (ctl_event_check(lhandle->ctl_channels, ev)) {
err = get_channels(lhandle);
if (lhandle->channels != err)
- goto __restart;
+ restart = 1;
+ continue;
}
__ctl_check:
control_event(lhandle, ev);
}
- return 0;
-
- __restart:
- pcmjob_stop(loop);
- err = pcmjob_start(loop);
- if (err < 0)
- return err;
+ err = get_active(lhandle);
+ if (verbose > 7)
+ snd_output_printf(loop->output, "%s: ctl event active %i\n", lhandle->id, err);
+ if (!err) {
+ if (lhandle->loopback->running) {
+ loop->stop_pending = 1;
+ loop->stop_count = 0;
+ }
+ } else {
+ loop->stop_pending = 0;
+ if (loop->running == 0)
+ restart = 1;
+ }
+ if (restart) {
+ pcmjob_stop(loop);
+ err = pcmjob_start(loop);
+ if (err < 0)
+ return err;
+ }
return 1;
}
--
1.7.3.1
++++++ 0035-alsamixer-remove-obsolete-e-mail.patch ++++++
>From f2e9e9a5b017a3834941256da52e1d608f9c4c7b Mon Sep 17 00:00:00 2001
From: Clemens Ladisch <clemens(a)ladisch.de>
Date: Wed, 10 Nov 2010 10:14:53 +0100
Subject: [PATCH 35/38] alsamixer: remove obsolete e-mail
Tim Janik's e-mail address is no longer valid.
Signed-off-by: Clemens Ladisch <clemens(a)ladisch.de>
---
alsamixer/cli.c | 2 +-
alsamixer/colors.c | 2 +-
alsamixer/mixer_controls.c | 2 +-
alsamixer/mixer_widget.c | 4 ++--
alsamixer/textbox.c | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/alsamixer/cli.c b/alsamixer/cli.c
index ab6255f..3898196 100644
--- a/alsamixer/cli.c
+++ b/alsamixer/cli.c
@@ -1,6 +1,6 @@
/*
* alsamixer - curses mixer for the ALSA project
- * Copyright (c) 1998,1999 Tim Janik <timj(a)gtk.org>
+ * Copyright (c) 1998,1999 Tim Janik
* Jaroslav Kysela <perex(a)perex.cz>
* Copyright (c) 2009 Clemens Ladisch <clemens(a)ladisch.de>
*
diff --git a/alsamixer/colors.c b/alsamixer/colors.c
index fcceb16..b4b98e5 100644
--- a/alsamixer/colors.c
+++ b/alsamixer/colors.c
@@ -1,6 +1,6 @@
/*
* colors.c - color and attribute definitions
- * Copyright (c) 1998,1999 Tim Janik <timj(a)gtk.org>
+ * Copyright (c) 1998,1999 Tim Janik
* Jaroslav Kysela <perex(a)perex.cz>
* Copyright (c) 2009 Clemens Ladisch <clemens(a)ladisch.de>
*
diff --git a/alsamixer/mixer_controls.c b/alsamixer/mixer_controls.c
index 796df7b..cc98b64 100644
--- a/alsamixer/mixer_controls.c
+++ b/alsamixer/mixer_controls.c
@@ -1,6 +1,6 @@
/*
* mixer_controls.c - handles mixer controls and mapping from selems
- * Copyright (c) 1998,1999 Tim Janik <timj(a)gtk.org>
+ * Copyright (c) 1998,1999 Tim Janik
* Jaroslav Kysela <perex(a)perex.cz>
* Copyright (c) 2009 Clemens Ladisch <clemens(a)ladisch.de>
*
diff --git a/alsamixer/mixer_widget.c b/alsamixer/mixer_widget.c
index 796ea1d..c8ca156 100644
--- a/alsamixer/mixer_widget.c
+++ b/alsamixer/mixer_widget.c
@@ -1,6 +1,6 @@
/*
* mixer_widget.c - mixer widget and keys handling
- * Copyright (c) 1998,1999 Tim Janik <timj(a)gtk.org>
+ * Copyright (c) 1998,1999 Tim Janik
* Jaroslav Kysela <perex(a)perex.cz>
* Copyright (c) 2009 Clemens Ladisch <clemens(a)ladisch.de>
*
@@ -211,7 +211,7 @@ static void show_help(void)
_("; ' Toggle left/right capture"),
"",
_("Authors:"),
- _(" Tim Janik <timj(a)gtk.org>"),
+ _(" Tim Janik"),
_(" Jaroslav Kysela <perex(a)perex.cz>"),
_(" Clemens Ladisch <clemens(a)ladisch.de>"),
};
diff --git a/alsamixer/textbox.c b/alsamixer/textbox.c
index d743a14..a979d3c 100644
--- a/alsamixer/textbox.c
+++ b/alsamixer/textbox.c
@@ -1,6 +1,6 @@
/*
* textbox.c - show a text box for messages, files or help
- * Copyright (c) 1998,1999 Tim Janik <timj(a)gtk.org>
+ * Copyright (c) 1998,1999 Tim Janik
* Jaroslav Kysela <perex(a)perex.cz>
* Copyright (c) 2009 Clemens Ladisch <clemens(a)ladisch.de>
*
--
1.7.3.1
++++++ 0036-update-German-translations.patch ++++++
++++ 1170 lines (skipped)
++++++ 0037-alsactl-systemd-and-udev-hookup.patch ++++++
>From de7c3eff0e371ce155403bbcdcf81ee79266fa0f Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Tue, 23 Nov 2010 01:45:08 +0100
Subject: [PATCH 37/38] alsactl: systemd and udev hookup
Add minimal systemd and udev support to alsactl so that mixer settings
are restored at boot, when sound cards are plugged in and saved on
shutdown.
This is similar to existing udev/init script solutions in various
distributions.
Note that alsactl is called both synchronously from the udev rules as
well as asynchronously at boot. This is intended, and to ensure two
things:
- At boot the asound.state file might not be readable, since it resides
on a different file system. That means exclusively restoring sound card
settings from udev rules will no suffice, since if the rule is
executed at early boot (for example within udev settle) then the file
will no be readable and cannot be restored.
- We need to ensure that applications monitoring sound cards coming and
going (such as PA) must not get these events before the mixer settings
have been restored. That means the mixer settings must be restored
synchronously withing the udev rules, before the events are passed on
to the apps.
That basically means we need to restore the settings once in udev, to
deal with sound cards becoming available during runtime. And once in
early boot to deal with coldplugged soundcards whose data files might
not have been available at time of plugging. Hence we call alsactl
twice: one from the udev rule, and once from he systemd unit file.
Signed-off-by: Lennart Poettering <mznyfn(a)0pointer.de>
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
Makefile.am | 3 ++
alsactl/90-alsa-restore.rules.in | 2 +
alsactl/Makefile.am | 46 ++++++++++++++++++++++++++++++++++++++
alsactl/alsa-restore.service.in | 11 +++++++++
alsactl/alsa-store.service.in | 9 +++++++
configure.in | 17 +++++++++++--
7 files changed, 88 insertions(+), 3 deletions(-)
create mode 100644 alsactl/90-alsa-restore.rules.in
create mode 100644 alsactl/alsa-restore.service.in
create mode 100644 alsactl/alsa-store.service.in
diff --git a/Makefile.am b/Makefile.am
index 9951c46..62e1ba6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -37,3 +37,6 @@ dist-hook:
else \
$(TAR) --create --verbose --file=- $(distdir) | bzip2 -c -9 > $(distdir).tar.bz2 ; \
fi
+
+DISTCHECK_CONFIGURE_FLAGS = \
+ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
diff --git a/alsactl/90-alsa-restore.rules.in b/alsactl/90-alsa-restore.rules.in
new file mode 100644
index 0000000..0bcee5b
--- /dev/null
+++ b/alsactl/90-alsa-restore.rules.in
@@ -0,0 +1,2 @@
+ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS=="card*", \
+ RUN+="@sbindir@/alsactl restore $attr{number}"
diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am
index 359f73a..9a2d30e 100644
--- a/alsactl/Makefile.am
+++ b/alsactl/Makefile.am
@@ -10,5 +10,51 @@ EXTRA_DIST=alsactl.1 alsactl_init.xml
alsactl_SOURCES=alsactl.c state.c utils.c init_parse.c
noinst_HEADERS=alsactl.h list.h init_sysdeps.c init_utils_string.c init_utils_run.c init_sysfs.c
+udevrulesdir=/lib/udev/rules.d
+
+dist_udevrules_DATA = \
+ 90-alsa-restore.rules
+
+if HAVE_SYSTEMD
+
+systemdsystemunit_DATA = \
+ alsa-store.service \
+ alsa-restore.service
+
+install-data-hook:
+ $(MKDIR_P) -m 0755 \
+ $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants \
+ $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants
+ ( cd $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants && \
+ rm -f alsa-restore.service && \
+ $(LN_S) ../alsa-restore.service alsa-restore.service )
+ ( cd $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants && \
+ rm -f alsa-store.service && \
+ $(LN_S) ../alsa-store.service alsa-store.service )
+
+endif
+
+edit = \
+ sed $(SED) -r 's,@sbindir\@,$(sbindir),g' < $< > $@ || rm $@
+
+alsa-store.service: alsa-store.service.in
+ $(edit)
+
+alsa-restore.service: alsa-restore.service.in
+ $(edit)
+
+90-alsa-restore.rules: 90-alsa-restore.rules.in
+ $(edit)
+
+EXTRA_DIST += \
+ alsa-store.service.in \
+ alsa-restore.service.in \
+ 90-alsa-restore.rules.in
+
+CLEANFILES = \
+ alsa-store.service \
+ alsa-restore.service \
+ 90-alsa-restore.rules
+
%.7: %.xml
xmlto man $?
diff --git a/alsactl/alsa-restore.service.in b/alsactl/alsa-restore.service.in
new file mode 100644
index 0000000..e97d196
--- /dev/null
+++ b/alsactl/alsa-restore.service.in
@@ -0,0 +1,11 @@
+[Unit]
+Description=Restore Sound Card State
+DefaultDependencies=no
+After=sysinit.target
+Before=shutdown.target
+Conflicts=shutdown.target
+
+[Service]
+Type=oneshot
+ExecStart=-@sbindir@/alsactl restore
+StandardOutput=syslog
diff --git a/alsactl/alsa-store.service.in b/alsactl/alsa-store.service.in
new file mode 100644
index 0000000..0e2823c
--- /dev/null
+++ b/alsactl/alsa-store.service.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=Store Sound Card State
+DefaultDependencies=no
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+ExecStart=@sbindir@/alsactl store
+StandardOutput=syslog
diff --git a/configure.in b/configure.in
index 31fd581..54ea74c 100644
--- a/configure.in
+++ b/configure.in
@@ -26,6 +26,7 @@ fi
AC_PROG_CC
dnl AC_PROG_CXX
AC_PROG_INSTALL
+AC_PROG_MKDIR_P
AC_PROG_LN_S
AM_PATH_ALSA(1.0.16)
@@ -130,7 +131,7 @@ if test x$alsamixer = xtrue; then
CURSES_CFLAGS=`ncursesw5-config --cflags`
curseslib="ncursesw"
else
- AC_CHECK_LIB(ncursesw, initscr,
+ AC_CHECK_LIB(ncursesw, initscr,
[ CURSESINC='<ncurses.h>'; CURSESLIB='-lncursesw'; curseslib="ncursesw"])
fi
if test -n "$CURSESINC"; then
@@ -147,12 +148,12 @@ if test x$alsamixer = xtrue; then
CURSES_CFLAGS=`ncurses5-config --cflags`
curseslib="ncurses"
else
- AC_CHECK_LIB(ncurses, initscr,
+ AC_CHECK_LIB(ncurses, initscr,
[ CURSESINC='<ncurses.h>'; CURSESLIB='-lncurses'; curseslib="ncurses"])
fi
fi
if test "$curseslib" = "curses" -o "$curseslib" = "auto"; then
- AC_CHECK_LIB(curses, initscr,
+ AC_CHECK_LIB(curses, initscr,
[ CURSESINC='<curses.h>'; CURSESLIB='-lcurses'; curseslib="curses"])
fi
if test -z "$CURSESINC"; then
@@ -278,6 +279,16 @@ SAVE_UTIL_VERSION
AC_SUBST(LIBRT)
+dnl Check for systemd
+PKG_PROG_PKG_CONFIG
+AC_ARG_WITH([systemdsystemunitdir],
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+if test "x$with_systemdsystemunitdir" != xno; then
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+fi
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+
AC_OUTPUT(Makefile alsactl/Makefile alsactl/init/Makefile \
alsamixer/Makefile amidi/Makefile amixer/Makefile \
m4/Makefile po/Makefile.in \
--
1.7.3.1
++++++ 0038-alsactl-Move-asound.state-location-to-var-lib-alsa.patch ++++++
>From 81f015f5abdd8e6cfa75e37bd97eb22781019eec Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Tue, 23 Nov 2010 02:59:18 +0100
Subject: [PATCH 38/38] alsactl: Move asound.state location to /var/lib/alsa
.... and add configure switch for it.
/etc might be on a read-only partition which is not suitable for dynamic
data such as the mixer settings. Hence move the location of asound.state
to /var/lib.
This is based on a patch from Ubuntu/Debian which hardcoded the pah in
/var/lib.
Signed-off-by: Lennart Poettering <mznyfn(a)0pointer.de>
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
Makefile.am | 3 +++
alsaconf/alsaconf.in | 5 +++--
alsactl/Makefile.am | 1 +
alsactl/alsactl.1 | 4 ++--
alsactl/alsactl.c | 4 +++-
configure.in | 6 ++++++
6 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 62e1ba6..48a4780 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,5 +38,8 @@ dist-hook:
$(TAR) --create --verbose --file=- $(distdir) | bzip2 -c -9 > $(distdir).tar.bz2 ; \
fi
+install-data-hook:
+ $(MKDIR_P) -m 0755 $(DESTDIR)$(ASOUND_STATE_DIR)
+
DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
diff --git a/alsaconf/alsaconf.in b/alsaconf/alsaconf.in
index ccc1b37..5c23787 100644
--- a/alsaconf/alsaconf.in
+++ b/alsaconf/alsaconf.in
@@ -956,8 +956,9 @@ If you have a big amplifier, lower your volumes or say no.
aplay -N $TESTSOUND
fi
fi
- if [ ! -r /etc/asound.state ]; then
- xecho "Saving the mixer setup used for this in /etc/asound.state."
+ mkdir -p -m 0755 @ASOUND_STATE_DIR@
+ if [ ! -r @ASOUND_STATE_DIR@/asound.state ]; then
+ xecho "Saving the mixer setup used for this in @ASOUND_STATE_DIR@/asound.state."
$sbindir/alsactl store
fi
clear
diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am
index 9a2d30e..721b619 100644
--- a/alsactl/Makefile.am
+++ b/alsactl/Makefile.am
@@ -8,6 +8,7 @@ endif
EXTRA_DIST=alsactl.1 alsactl_init.xml
alsactl_SOURCES=alsactl.c state.c utils.c init_parse.c
+alsactl_CFLAGS=$(AM_CFLAGS) -DSYS_ASOUNDRC=\"$(ASOUND_STATE_DIR)/asound.state\"
noinst_HEADERS=alsactl.h list.h init_sysdeps.c init_utils_string.c init_utils_run.c init_sysfs.c
udevrulesdir=/lib/udev/rules.d
diff --git a/alsactl/alsactl.1 b/alsactl/alsactl.1
index eb3cbd1..eb5968c 100644
--- a/alsactl/alsactl.1
+++ b/alsactl/alsactl.1
@@ -43,7 +43,7 @@ Print alsactl version number.
.TP
\fI\-f, \-\-file\fP
-Select the configuration file to use. The default is /etc/asound.state.
+Select the configuration file to use. The default is /var/lib/alsa/asound.state.
.TP
\fI\-F, \-\-force\fP
@@ -90,7 +90,7 @@ The configuration file for init. By default, PREFIX/share/alsa/init/00main
is used.
.SH FILES
-\fI/etc/asound.state\fP (or whatever file you specify with the
+\fI/var/lib/alsa/asound.state\fP (or whatever file you specify with the
\fB\-f\fP flag) is used to store current settings for your
soundcards. The settings include all the usual soundcard mixer
settings. More importantly, alsactl is
diff --git a/alsactl/alsactl.c b/alsactl/alsactl.c
index 3b5dfda..c2120bd 100644
--- a/alsactl/alsactl.c
+++ b/alsactl/alsactl.c
@@ -30,7 +30,9 @@
#include <alsa/asoundlib.h>
#include "alsactl.h"
-#define SYS_ASOUNDRC "/etc/asound.state"
+#ifndef SYS_ASOUNDRC
+#define SYS_ASOUNDRC "/var/lib/alsa/asound.state"
+#endif
int debugflag = 0;
int force_restore = 1;
diff --git a/configure.in b/configure.in
index 54ea74c..94a2b17 100644
--- a/configure.in
+++ b/configure.in
@@ -289,6 +289,12 @@ if test "x$with_systemdsystemunitdir" != xno; then
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+AC_ARG_WITH(ASOUND_STATE_DIR,
+ AS_HELP_STRING([--with-asound-state-dir=DIR], [Directory to place asound.state file in]),
+ [ASOUND_STATE_DIR="$withval"],
+ [ASOUND_STATE_DIR="/var/lib/alsa"])
+AC_SUBST(ASOUND_STATE_DIR)
+
AC_OUTPUT(Makefile alsactl/Makefile alsactl/init/Makefile \
alsamixer/Makefile amidi/Makefile amixer/Makefile \
m4/Makefile po/Makefile.in \
--
1.7.3.1
++++++ 0039-configure.in-Fix-variable-name.patch ++++++
>From 53b08bfc1451937bb19a86e4b116d28cd15c81ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= <ozan(a)pardus.org.tr>
Date: Thu, 25 Nov 2010 09:36:37 +0200
Subject: [PATCH] configure.in: Fix variable name
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix variable name for --with-asound-state-dir as currently we have
to pass --with-ASOUND_STATE_DIR= which is wrong and inconsistent with
the other switches.
Signed-off-by: Ozan Çağlayan <ozan(a)pardus.org.tr>
Signed-off-by: Takashi Iwai <tiwai(a)suse.de>
---
configure.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in
index 94a2b17..77778da 100644
--- a/configure.in
+++ b/configure.in
@@ -289,7 +289,7 @@ if test "x$with_systemdsystemunitdir" != xno; then
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
-AC_ARG_WITH(ASOUND_STATE_DIR,
+AC_ARG_WITH([asound-state-dir],
AS_HELP_STRING([--with-asound-state-dir=DIR], [Directory to place asound.state file in]),
[ASOUND_STATE_DIR="$withval"],
[ASOUND_STATE_DIR="/var/lib/alsa"])
--
1.7.3.1
++++++ alsa-utils-po-pre-patch.diff ++++++
++++ 2200 lines (skipped)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package alsa for openSUSE:Factory
checked in at Mon Nov 29 11:53:05 CET 2010.
--------
--- alsa/alsa.changes 2010-10-25 09:41:00.000000000 +0200
+++ /mounts/work_src_done/STABLE/alsa/alsa.changes 2010-11-26 09:30:24.000000000 +0100
@@ -1,0 +2,21 @@
+Fri Nov 26 09:29:58 CET 2010 - tiwai(a)suse.de
+
+- don't install udev rule for 11.4, as it's provided in alsa-utils
+ now
+
+-------------------------------------------------------------------
+Wed Nov 24 06:24:00 CET 2010 - tiwai(a)suse.de
+
+- Backport pending fixes from upstream:
+ 0027-Version-check-libtool-correctly-when-doing-an-out-of.patch
+ 0028-configure.in-don-t-rely-on-test-a-not-all-shells-sup.patch
+ 0029-pcm-direct-plugins-change-timestamping-in-dsnoop.patch
+ 0030-USB-Audio.conf-fix-Audiophile-USB-card-name.patch
+ 0031-pcm-pass-hw_params-flags-to-slave.patch
+ 0032-support-for-period-wakeup-disabling.patch
+ 0033-pcm-fix-snd_pcm_avail_delay-function.patch
+ 0034-pcm_plugin-remove-unused-client_frames-and-slave_fra.patch
+ 0035-pcm-add-MMAP_EMUL-to-type-names.patch
+ 0036-pcm_plugin-fix-delay.patch
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
0027-Version-check-libtool-correctly-when-doing-an-out-of.patch
0028-configure.in-don-t-rely-on-test-a-not-all-shells-sup.patch
0029-pcm-direct-plugins-change-timestamping-in-dsnoop.patch
0030-USB-Audio.conf-fix-Audiophile-USB-card-name.patch
0031-pcm-pass-hw_params-flags-to-slave.patch
0032-support-for-period-wakeup-disabling.patch
0033-pcm-fix-snd_pcm_avail_delay-function.patch
0034-pcm_plugin-remove-unused-client_frames-and-slave_fra.patch
0035-pcm-add-MMAP_EMUL-to-type-names.patch
0036-pcm_plugin-fix-delay.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ alsa.spec ++++++
--- /var/tmp/diff_new_pack.UYkrOu/_old 2010-11-29 11:52:11.000000000 +0100
+++ /var/tmp/diff_new_pack.UYkrOu/_new 2010-11-29 11:52:11.000000000 +0100
@@ -34,7 +34,7 @@
#
Summary: Advanced Linux Sound Architecture
Version: 1.0.23
-Release: 7
+Release: 8
Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2
Source2: baselibs.conf
Source8: 40-alsa.rules
@@ -78,6 +78,16 @@
Patch24: 0024-namehint-Another-fix-to-properly-evaluate-hw-devices.patch
Patch25: 0025-config-file-processing-rewrite-the-locking-use-one-r.patch
Patch26: 0026-tlv-fix-returned-dB-information-for-min-is-mute-cont.patch
+Patch27: 0027-Version-check-libtool-correctly-when-doing-an-out-of.patch
+Patch28: 0028-configure.in-don-t-rely-on-test-a-not-all-shells-sup.patch
+Patch29: 0029-pcm-direct-plugins-change-timestamping-in-dsnoop.patch
+Patch30: 0030-USB-Audio.conf-fix-Audiophile-USB-card-name.patch
+Patch31: 0031-pcm-pass-hw_params-flags-to-slave.patch
+Patch32: 0032-support-for-period-wakeup-disabling.patch
+Patch33: 0033-pcm-fix-snd_pcm_avail_delay-function.patch
+Patch34: 0034-pcm_plugin-remove-unused-client_frames-and-slave_fra.patch
+Patch35: 0035-pcm-add-MMAP_EMUL-to-type-names.patch
+Patch36: 0036-pcm_plugin-fix-delay.patch
Url: http://www.alsa-project.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -179,6 +189,16 @@
%patch24 -p1
%patch25 -p1
%patch26 -p1
+%patch27 -p1
+%patch28 -p1
+%patch29 -p1
+%patch30 -p1
+%patch31 -p1
+%patch32 -p1
+%patch33 -p1
+%patch34 -p1
+%patch35 -p1
+%patch36 -p1
# hack to fix build on older distros
%if %suse_version < 1100
%ifarch %ix86
@@ -233,10 +253,12 @@
rm -f $RPM_BUILD_ROOT%{_sbindir}/rcjoystick
ln -s ../../etc/init.d/joystick $RPM_BUILD_ROOT%{_sbindir}/rcjoystick
#
-# udev rules
+# udev rules (only for non-systemd)
#
+%if %suse_version < 1140
mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
install -c -m 0644 %{SOURCE8} $RPM_BUILD_ROOT/etc/udev/rules.d
+%endif
#
# install template to update rc.config and sysconfig files:
# (updating the actual files is done in the %post-script)
@@ -287,7 +309,9 @@
/usr/lib/all_notes_off.*
%{_datadir}/sounds/alsa
/var/adm/fillup-templates/*
+%if %suse_version < 1140
/etc/udev
+%endif
%files devel
%defattr(-, root, root)
++++++ 0027-Version-check-libtool-correctly-when-doing-an-out-of.patch ++++++
>From 443c1057379f167639acad5dc197bd50a915b5ab Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv(a)debian.org>
Date: Fri, 8 Oct 2010 09:06:29 +0100
Subject: [PATCH 01/10] Version-check libtool correctly when doing an out-of-tree build
libtool is only created at the end of ./configure, so it doesn't make
sense to grep it in ./configure (the check would always fail the first
time). However, ltmain.sh is copied into the ${srcdir} by libtoolize and
should be safe to check at any time that configure can be run.
Signed-off-by: Simon McVittie <smcv(a)debian.org>
Signed-off-by: Takashi Iwai <tiwai(a)suse.de>
---
configure.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in
index abc4687..e904956 100644
--- a/configure.in
+++ b/configure.in
@@ -115,7 +115,7 @@ AC_ARG_WITH(versioned,
versioned="$withval", versioned="yes")
if test "$versioned" = "yes"; then
# it seems that GNU ld versions since 2.10 are not broken
- xres=`grep '^VERSION=' libtool | cut -d = -f 2 | cut -d \" -f 2`
+ xres=`grep '^VERSION=' ${srcdir}/ltmain.sh | cut -d = -f 2 | cut -d \" -f 2`
major=`echo $xres | cut -d . -f 1`
minor=`echo $xres | cut -d . -f 2`
pass=0
--
1.7.3.1
++++++ 0028-configure.in-don-t-rely-on-test-a-not-all-shells-sup.patch ++++++
>From 5cfa03d2f3a9e6bc62f740640d20bd137b4e3bb5 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv(a)debian.org>
Date: Fri, 8 Oct 2010 09:06:58 +0100
Subject: [PATCH 02/10] configure.in: don't rely on test -a, not all shells support it
Notably, /bin/sh in older Debian and Ubuntu is dash, which doesn't.
Signed-off-by: Takashi Iwai <tiwai(a)suse.de>
---
configure.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in
index e904956..c353759 100644
--- a/configure.in
+++ b/configure.in
@@ -119,7 +119,7 @@ if test "$versioned" = "yes"; then
major=`echo $xres | cut -d . -f 1`
minor=`echo $xres | cut -d . -f 2`
pass=0
- if test $major -eq 1 -a $minor -gt 3; then
+ if test $major -eq 1 && test $minor -gt 3; then
pass=1
else
if test $major -gt 1; then
--
1.7.3.1
++++++ 0029-pcm-direct-plugins-change-timestamping-in-dsnoop.patch ++++++
>From 13b5d972d2e7a5f0e6f3c066684dbb01fafd5121 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Fri, 29 Oct 2010 17:36:41 +0200
Subject: [PATCH 03/10] pcm direct plugins: change timestamping in dsnoop
Do not use own timestamps, try to sync hw.ptr with real timestamp.
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
src/pcm/pcm_direct.h | 1 +
src/pcm/pcm_dmix.c | 2 +-
src/pcm/pcm_dshare.c | 2 +-
src/pcm/pcm_dsnoop.c | 31 +++++++++++++++++++++++++------
4 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/src/pcm/pcm_direct.h b/src/pcm/pcm_direct.h
index 132c281..7f16481 100644
--- a/src/pcm/pcm_direct.h
+++ b/src/pcm/pcm_direct.h
@@ -137,6 +137,7 @@ struct snd_pcm_direct {
int (*sync_ptr)(snd_pcm_t *pcm);
snd_pcm_state_t state;
snd_htimestamp_t trigger_tstamp;
+ snd_htimestamp_t update_tstamp;
int server, client;
int comm_fd; /* communication file descriptor (socket) */
int hw_fd; /* hardware file descriptor */
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
index cb62de9..434fc65 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -852,7 +852,7 @@ static int snd_pcm_dmix_htimestamp(snd_pcm_t *pcm,
if (ok && *avail == avail1)
break;
*avail = avail1;
- *tstamp = snd_pcm_hw_fast_tstamp(pcm);
+ *tstamp = snd_pcm_hw_fast_tstamp(dmix->spcm);
}
return 0;
}
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
index 02782a7..77789a5 100644
--- a/src/pcm/pcm_dshare.c
+++ b/src/pcm/pcm_dshare.c
@@ -542,7 +542,7 @@ static int snd_pcm_dshare_htimestamp(snd_pcm_t *pcm,
if (ok && *avail == avail1)
break;
*avail = avail1;
- *tstamp = snd_pcm_hw_fast_tstamp(pcm);
+ *tstamp = snd_pcm_hw_fast_tstamp(dshare->spcm);
}
return 0;
}
diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c
index 15c727a..988f1f4 100644
--- a/src/pcm/pcm_dsnoop.c
+++ b/src/pcm/pcm_dsnoop.c
@@ -54,6 +54,23 @@ const char *_snd_module_pcm_dsnoop = "";
*
*/
+static int snoop_timestamp(snd_pcm_t *pcm)
+{
+ snd_pcm_direct_t *dsnoop = pcm->private_data;
+ snd_pcm_uframes_t ptr1 = -2LL /* invalid value */, ptr2;
+
+ /* loop is required to sync hw.ptr with timestamp */
+ while (1) {
+ ptr2 = *dsnoop->spcm->hw.ptr;
+ if (ptr1 == ptr2)
+ break;
+ ptr1 = ptr2;
+ dsnoop->update_tstamp = snd_pcm_hw_fast_tstamp(dsnoop->spcm);
+ }
+ dsnoop->slave_hw_ptr = ptr1;
+ return 0;
+}
+
static void snoop_areas(snd_pcm_direct_t *dsnoop,
const snd_pcm_channel_area_t *src_areas,
const snd_pcm_channel_area_t *dst_areas,
@@ -126,7 +143,8 @@ static int snd_pcm_dsnoop_sync_ptr(snd_pcm_t *pcm)
if (dsnoop->slowptr)
snd_pcm_hwsync(dsnoop->spcm);
old_slave_hw_ptr = dsnoop->slave_hw_ptr;
- slave_hw_ptr = dsnoop->slave_hw_ptr = *dsnoop->spcm->hw.ptr;
+ snoop_timestamp(pcm);
+ slave_hw_ptr = dsnoop->slave_hw_ptr;
diff = slave_hw_ptr - old_slave_hw_ptr;
if (diff == 0) /* fast path */
return 0;
@@ -172,7 +190,7 @@ static int snd_pcm_dsnoop_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
state = snd_pcm_state(dsnoop->spcm);
status->state = state == SND_PCM_STATE_RUNNING ? dsnoop->state : state;
status->trigger_tstamp = dsnoop->trigger_tstamp;
- gettimestamp(&status->tstamp, pcm->monotonic);
+ status->tstamp = dsnoop->update_tstamp;
status->avail = snd_pcm_mmap_capture_avail(pcm);
status->avail_max = status->avail > dsnoop->avail_max ? status->avail : dsnoop->avail_max;
dsnoop->avail_max = 0;
@@ -254,7 +272,7 @@ static int snd_pcm_dsnoop_reset(snd_pcm_t *pcm)
snd_pcm_direct_t *dsnoop = pcm->private_data;
dsnoop->hw_ptr %= pcm->period_size;
dsnoop->appl_ptr = dsnoop->hw_ptr;
- dsnoop->slave_appl_ptr = dsnoop->slave_hw_ptr = *dsnoop->spcm->hw.ptr;
+ dsnoop->slave_appl_ptr = dsnoop->slave_hw_ptr;
return 0;
}
@@ -266,12 +284,13 @@ static int snd_pcm_dsnoop_start(snd_pcm_t *pcm)
if (dsnoop->state != SND_PCM_STATE_PREPARED)
return -EBADFD;
snd_pcm_hwsync(dsnoop->spcm);
- dsnoop->slave_appl_ptr = dsnoop->slave_hw_ptr = *dsnoop->spcm->hw.ptr;
+ snoop_timestamp(pcm);
+ dsnoop->slave_appl_ptr = dsnoop->slave_hw_ptr;
err = snd_timer_start(dsnoop->timer);
if (err < 0)
return err;
dsnoop->state = SND_PCM_STATE_RUNNING;
- gettimestamp(&dsnoop->trigger_tstamp, pcm->monotonic);
+ dsnoop->trigger_tstamp = dsnoop->update_tstamp;
return 0;
}
@@ -437,7 +456,7 @@ static int snd_pcm_dsnoop_htimestamp(snd_pcm_t *pcm,
if (ok && *avail == avail1)
break;
*avail = avail1;
- *tstamp = snd_pcm_hw_fast_tstamp(pcm);
+ *tstamp = snd_pcm_hw_fast_tstamp(dsnoop->spcm);
}
return 0;
}
--
1.7.3.1
++++++ 0030-USB-Audio.conf-fix-Audiophile-USB-card-name.patch ++++++
>From ab6df229015f46bc2c7b50f5278480d996b232c0 Mon Sep 17 00:00:00 2001
From: Clemens Ladisch <clemens(a)ladisch.de>
Date: Wed, 10 Nov 2010 10:11:51 +0100
Subject: [PATCH 04/10] USB-Audio.conf: fix Audiophile USB card name
The device name of the M-Audio AudioPhile USB is actually "Audiophile USB (tm)".
Also keep the old string, just to be sure.
Signed-off-by: Clemens Ladisch <clemens(a)ladisch.de>
---
src/conf/cards/USB-Audio.conf | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf
index 5849e3f..0726c34 100644
--- a/src/conf/cards/USB-Audio.conf
+++ b/src/conf/cards/USB-Audio.conf
@@ -16,6 +16,7 @@
# here.
USB-Audio.pcm.use_dmix {
"AudioPhile" no # uses big-endian 24-bit samples
+ "Audiophile USB (tm)" no
}
# If a device does not have a four-channel mode for the front/rear outputs,
@@ -25,6 +26,7 @@ USB-Audio.pcm.use_dmix {
# two_stereo_devices - for devices that have two stereo audio interfaces
USB-Audio.pcm.surround40_type {
"AudioPhile" two_stereo_devices
+ "Audiophile USB (tm)" two_stereo_devices
"OmniStudio" two_stereo_devices
"Quattro" two_stereo_devices
"SB Audigy 2 NX" six_channels
@@ -43,7 +45,8 @@ USB-Audio.pcm.iec958_device {
# M-Audio AudioPhile USB:
# device 0: analog output, digital input
# device 1: digital output, analog input
-USB-Audio."AudioPhile".pcm.default {
+USB-Audio."AudioPhile".pcm.default "cards.USB-Audio.Audiophile USB (tm).pcm.default"
+USB-Audio."Audiophile USB (tm)".pcm.default {
@args [ CARD ]
@args.CARD { type string }
type asym
@@ -63,7 +66,8 @@ USB-Audio."AudioPhile".pcm.default {
}
}
}
-USB-Audio."AudioPhile".pcm.iec958 {
+USB-Audio."AudioPhile".pcm.iec958 "cards.USB-Audio.Audiophile USB (tm).pcm.iec958"
+USB-Audio."Audiophile USB (tm)".pcm.iec958 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
--
1.7.3.1
++++++ 0031-pcm-pass-hw_params-flags-to-slave.patch ++++++
>From 70dded6aba653b5f70b48fda22f9b322fd3ae2c9 Mon Sep 17 00:00:00 2001
From: Clemens Ladisch <clemens(a)ladisch.de>
Date: Mon, 15 Nov 2010 10:33:35 +0100
Subject: [PATCH 05/10] pcm: pass hw_params flags to slave
Fix required before interrupt disabling routines patch can be applied.
Without this fix, the interrupts are only disabled when directly
accessing hw devices.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart(a)intel.com>
Signed-off-by: Clemens Ladisch <clemens(a)ladisch.de>
---
src/pcm/pcm_params.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/pcm/pcm_params.c b/src/pcm/pcm_params.c
index 3a90bcd..b085d42 100644
--- a/src/pcm/pcm_params.c
+++ b/src/pcm/pcm_params.c
@@ -2126,6 +2126,7 @@ int _snd_pcm_hw_params_refine(snd_pcm_hw_params_t *params,
err = changed;
}
params->info &= src->info;
+ params->flags = src->flags; /* propagate all flags to slave */
return err;
}
--
1.7.3.1
++++++ 0032-support-for-period-wakeup-disabling.patch ++++++
>From 7c99bd24bcf6852d55e90e0f42f7ac5ea8f14fbb Mon Sep 17 00:00:00 2001
From: Clemens Ladisch <clemens(a)ladisch.de>
Date: Mon, 15 Nov 2010 10:43:13 +0100
Subject: [PATCH 06/10] support for period wakeup disabling
Add API to disable period wakeups.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart(a)intel.com>
Signed-off-by: Clemens Ladisch <clemens(a)ladisch.de>
---
include/pcm.h | 3 ++
include/sound/asound.h | 2 +
src/pcm/pcm.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++-
src/pcm/pcm_local.h | 3 ++
4 files changed, 79 insertions(+), 1 deletions(-)
diff --git a/include/pcm.h b/include/pcm.h
index f3618c3..7243ffb 100644
--- a/include/pcm.h
+++ b/include/pcm.h
@@ -531,6 +531,7 @@ int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params);
int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params);
int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params);
int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params);
int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
unsigned int *rate_num,
unsigned int *rate_den);
@@ -626,6 +627,8 @@ int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *par
int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
diff --git a/include/sound/asound.h b/include/sound/asound.h
index fa88938..17dfe8f 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -278,6 +278,7 @@ enum sndrv_pcm_subformat {
#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
+#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
enum sndrv_pcm_state {
SNDRV_PCM_STATE_OPEN = 0, /* stream is open */
@@ -346,6 +347,7 @@ enum sndrv_pcm_hw_param {
#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
+#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
struct sndrv_interval {
unsigned int min, max;
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index a49b5b9..f378779 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -726,8 +726,11 @@ int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock)
return err;
if (nonblock)
pcm->mode |= SND_PCM_NONBLOCK;
- else
+ else {
+ if (pcm->hw_flags & SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP)
+ return -EINVAL;
pcm->mode &= ~SND_PCM_NONBLOCK;
+ }
return 0;
}
@@ -3081,6 +3084,23 @@ int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params)
}
/**
+ * \brief Check if hardware can disable period wakeups
+ * \param params Configuration space
+ * \return Boolean value
+ * \retval 0 Hardware cannot disable period wakeups
+ * \retval 1 Hardware can disable period wakeups
+ */
+int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params)
+{
+ assert(params);
+ if (CHECK_SANITY(params->info == ~0U)) {
+ SNDMSG("invalid PCM info field");
+ return 0; /* FIXME: should be a negative error? */
+ }
+ return !!(params->info & SNDRV_PCM_INFO_NO_PERIOD_WAKEUP);
+}
+
+/**
* \brief Get rate exact info from a configuration space
* \param params Configuration space
* \param rate_num Pointer to returned rate numerator
@@ -4200,6 +4220,56 @@ int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *par
}
/**
+ * \brief Restrict a configuration space to settings without period wakeups
+ * \param pcm PCM handle
+ * \param params Configuration space
+ * \param val 0 = disable, 1 = enable (default) period wakeup
+ * \return Zero on success, otherwise a negative error code.
+ *
+ * This function must be called only on devices where non-blocking mode is
+ * enabled.
+ *
+ * To check whether the hardware does support disabling period wakeups, call
+ * #snd_pcm_hw_params_can_disable_period_wakeup(). If the hardware does not
+ * support this mode, standard period wakeups will be generated.
+ *
+ * Even with disabled period wakeups, the period size/time/count parameters
+ * are valid; it is suggested to use #snd_pcm_hw_params_set_period_size_last().
+ *
+ * When period wakeups are disabled, the application must not use any functions
+ * that could block on this device. The use of poll should be limited to error
+ * cases. The application needs to use an external event or a timer to
+ * check the state of the ring buffer and refill it apropriately.
+ */
+int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
+{
+ assert(pcm && params);
+
+ if (!val) {
+ if (!(pcm->mode & SND_PCM_NONBLOCK))
+ return -EINVAL;
+ params->flags |= SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP;
+ } else
+ params->flags &= ~SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP;
+
+ return snd_pcm_hw_refine(pcm, params);
+}
+
+/**
+ * \brief Extract period wakeup flag from a configuration space
+ * \param pcm PCM handle
+ * \param params Configuration space
+ * \param val 0 = disabled, 1 = enabled period wakeups
+ * \return Zero on success, otherwise a negative error code.
+ */
+int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
+{
+ assert(pcm && params && val);
+ *val = params->flags & SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP ? 0 : 1;
+ return 0;
+}
+
+/**
* \brief Extract period time from a configuration space
* \param params Configuration space
* \param val Returned approximate period duration in us
diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h
index 2f6fcd2..2e901d5 100644
--- a/src/pcm/pcm_local.h
+++ b/src/pcm/pcm_local.h
@@ -91,9 +91,12 @@ typedef enum sndrv_pcm_hw_param snd_pcm_hw_param_t;
#define SND_PCM_INFO_JOINT_DUPLEX SNDRV_PCM_INFO_JOINT_DUPLEX
/** device can do a kind of synchronized start */
#define SND_PCM_INFO_SYNC_START SNDRV_PCM_INFO_SYNC_START
+/** device can disable period wakeups */
+#define SND_PCM_INFO_NO_PERIOD_WAKEUP SNDRV_PCM_INFO_NO_PERIOD_WAKEUP
#define SND_PCM_HW_PARAMS_NORESAMPLE SNDRV_PCM_HW_PARAMS_NORESAMPLE
#define SND_PCM_HW_PARAMS_EXPORT_BUFFER SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER
+#define SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP
#define SND_PCM_INFO_MONOTONIC 0x80000000
--
1.7.3.1
++++++ 0033-pcm-fix-snd_pcm_avail_delay-function.patch ++++++
>From ba9332e9192814a5431a3a2505d25d74a9232124 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Thu, 18 Nov 2010 09:27:07 +0100
Subject: [PATCH 07/10] pcm: fix snd_pcm_avail_delay() function
For capture stream, the delay must be obtained as last, but we need to
update the ring buffer pointers for the avail_update call. So, rearrange
the code a bit and add hwsync call as first.
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
src/pcm/pcm.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index f378779..7409943 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -2470,18 +2470,22 @@ int snd_pcm_avail_delay(snd_pcm_t *pcm,
snd_pcm_sframes_t *delayp)
{
snd_pcm_sframes_t sf;
+ int err;
assert(pcm && availp && delayp);
if (CHECK_SANITY(! pcm->setup)) {
SNDMSG("PCM not set up");
return -EIO;
}
- sf = pcm->fast_ops->delay(pcm->fast_op_arg, delayp);
- if (sf < 0)
- return (int)sf;
+ err = pcm->fast_ops->hwsync(pcm->fast_op_arg);
+ if (err < 0)
+ return err;
sf = pcm->fast_ops->avail_update(pcm->fast_op_arg);
if (sf < 0)
return (int)sf;
+ err = pcm->fast_ops->delay(pcm->fast_op_arg, delayp);
+ if (err < 0)
+ return err;
*availp = sf;
return 0;
}
--
1.7.3.1
++++++ 0034-pcm_plugin-remove-unused-client_frames-and-slave_fra.patch ++++++
>From ade3efbd865967bf78d7f0ae6a2fe9809ea90719 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart(a)intel.com>
Date: Fri, 19 Nov 2010 10:35:31 -0600
Subject: [PATCH 08/10] pcm_plugin: remove unused client_frames and slave_frames routines
plug->client_frames and plug->slave_frames are not used by
any plugin, remove dead code.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart(a)intel.com>
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
src/pcm/pcm_plugin.c | 33 ++++-----------------------------
src/pcm/pcm_plugin.h | 2 --
2 files changed, 4 insertions(+), 31 deletions(-)
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
index 0ef394a..19d0dee 100644
--- a/src/pcm/pcm_plugin.c
+++ b/src/pcm/pcm_plugin.c
@@ -144,8 +144,6 @@ static int snd_pcm_plugin_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
int err = snd_pcm_delay(plugin->gen.slave, &sd);
if (err < 0)
return err;
- if (plugin->client_frames)
- sd = plugin->client_frames(pcm, sd);
*delayp = sd;
return 0;
}
@@ -208,18 +206,13 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
if (frames == 0)
return 0;
- if (plugin->slave_frames)
- sframes = plugin->slave_frames(pcm, (snd_pcm_sframes_t) frames);
- else
- sframes = frames;
+ sframes = frames;
snd_atomic_write_begin(&plugin->watom);
sframes = snd_pcm_rewind(plugin->gen.slave, sframes);
if (sframes < 0) {
snd_atomic_write_end(&plugin->watom);
return sframes;
}
- if (plugin->client_frames)
- frames = plugin->client_frames(pcm, sframes);
snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) frames);
snd_atomic_write_end(&plugin->watom);
return (snd_pcm_sframes_t) frames;
@@ -241,18 +234,13 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
if (frames == 0)
return 0;
- if (plugin->slave_frames)
- sframes = plugin->slave_frames(pcm, (snd_pcm_sframes_t) frames);
- else
- sframes = frames;
+ sframes = frames;
snd_atomic_write_begin(&plugin->watom);
sframes = INTERNAL(snd_pcm_forward)(plugin->gen.slave, sframes);
if (sframes < 0) {
snd_atomic_write_end(&plugin->watom);
return sframes;
}
- if (plugin->client_frames)
- frames = plugin->client_frames(pcm, sframes);
snd_pcm_mmap_appl_forward(pcm, (snd_pcm_uframes_t) frames);
snd_atomic_write_end(&plugin->watom);
return (snd_pcm_sframes_t) frames;
@@ -469,15 +457,8 @@ static snd_pcm_sframes_t snd_pcm_plugin_avail_update(snd_pcm_t *pcm)
pcm->access != SND_PCM_ACCESS_RW_INTERLEAVED &&
pcm->access != SND_PCM_ACCESS_RW_NONINTERLEAVED)
goto _capture;
- if (plugin->client_frames) {
- *pcm->hw.ptr = plugin->client_frames(pcm, *slave->hw.ptr);
- if (slave_size <= 0)
- return slave_size;
- return plugin->client_frames(pcm, slave_size);
- } else {
- *pcm->hw.ptr = *slave->hw.ptr;
- return slave_size;
- }
+ *pcm->hw.ptr = *slave->hw.ptr;
+ return slave_size;
_capture:
{
const snd_pcm_channel_area_t *areas;
@@ -547,16 +528,10 @@ static int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
}
status->appl_ptr = *pcm->appl.ptr;
status->hw_ptr = *pcm->hw.ptr;
- if (plugin->client_frames) {
- status->delay = plugin->client_frames(pcm, status->delay);
- status->avail = plugin->client_frames(pcm, status->avail);
- }
if (!snd_atomic_read_ok(&ratom)) {
snd_atomic_read_wait(&ratom);
goto _again;
}
- if (plugin->client_frames)
- status->avail_max = plugin->client_frames(pcm, (snd_pcm_sframes_t) status->avail_max);
return 0;
}
diff --git a/src/pcm/pcm_plugin.h b/src/pcm/pcm_plugin.h
index dfcf6de..7ee7c7f 100644
--- a/src/pcm/pcm_plugin.h
+++ b/src/pcm/pcm_plugin.h
@@ -44,8 +44,6 @@ typedef struct {
snd_pcm_slave_xfer_areas_func_t write;
snd_pcm_slave_xfer_areas_undo_func_t undo_read;
snd_pcm_slave_xfer_areas_undo_func_t undo_write;
- snd_pcm_sframes_t (*client_frames)(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
- snd_pcm_sframes_t (*slave_frames)(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
int (*init)(snd_pcm_t *pcm);
snd_pcm_uframes_t appl_ptr, hw_ptr;
snd_atomic_write_t watom;
--
1.7.3.1
++++++ 0035-pcm-add-MMAP_EMUL-to-type-names.patch ++++++
>From a4f71b19407fde8d5fd4f35850543173636b3ee0 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex(a)perex.cz>
Date: Tue, 23 Nov 2010 13:40:25 +0100
Subject: [PATCH 09/10] pcm: add MMAP_EMUL to type names
If we try to print this then it causes a read past the end of the array
in snd_pcm_type_name().
From: Dan Carpenter <error27(a)gmail.com>
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
src/pcm/pcm.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 7409943..906b502 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -1633,6 +1633,7 @@ static const char *const snd_pcm_type_names[] = {
PCMTYPE(SOFTVOL),
PCMTYPE(IOPLUG),
PCMTYPE(EXTPLUG),
+ PCMTYPE(MMAP_EMUL),
};
static const char *const snd_pcm_subformat_names[] = {
--
1.7.3.1
++++++ 0036-pcm_plugin-fix-delay.patch ++++++
>From aba87e509898ec9ddb3e319267d7c267409ff100 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart(a)intel.com>
Date: Tue, 23 Nov 2010 08:47:08 -0600
Subject: [PATCH 10/10] pcm_plugin: fix delay
PulseAudio ALSA modules report errors after calling
snd_pcm_avail_delay(), with a delay lower than the number of samples
available.
Correct delay using Jaroslav's recommendation:
"the result should be 'delay(slave) + mmap_capture_avail(pcm)"
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart(a)intel.com>
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
---
src/pcm/pcm_plugin.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
index 19d0dee..d88e117 100644
--- a/src/pcm/pcm_plugin.c
+++ b/src/pcm/pcm_plugin.c
@@ -144,6 +144,12 @@ static int snd_pcm_plugin_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
int err = snd_pcm_delay(plugin->gen.slave, &sd);
if (err < 0)
return err;
+ if (pcm->stream == SND_PCM_STREAM_CAPTURE &&
+ pcm->access != SND_PCM_ACCESS_RW_INTERLEAVED &&
+ pcm->access != SND_PCM_ACCESS_RW_NONINTERLEAVED) {
+ sd += snd_pcm_mmap_capture_avail(pcm);
+ }
+
*delayp = sd;
return 0;
}
--
1.7.3.1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package perl-Email-Date-Format for openSUSE:Factory
checked in at Fri Nov 26 17:52:14 CET 2010.
--------
--- perl-Email-Date-Format/perl-Email-Date-Format.changes 2010-10-19 10:45:56.000000000 +0200
+++ perl-Email-Date-Format/perl-Email-Date-Format.changes 2010-11-24 18:24:14.000000000 +0100
@@ -1,0 +2,8 @@
+Wed Nov 24 17:23:34 UTC 2010 - chris(a)computersalat.de
+
+- recreated by cpanspec 1.78
+ o fix deps
+- noarch pkg
+- added bcond_with pod
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Email-Date-Format.spec ++++++
--- /var/tmp/diff_new_pack.AYQMr2/_old 2010-11-26 17:47:37.000000000 +0100
+++ /var/tmp/diff_new_pack.AYQMr2/_new 2010-11-26 17:47:37.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package perl-Email-Date-Format (Version 1.002 )
+# spec file for package perl-Email-Date-Format (Version 1.002)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -17,60 +17,73 @@
# norootforbuild
-Url: http://cpan.org/modules/by-module/Email/
+%bcond_with pod
Name: perl-Email-Date-Format
+%define cpan_name Email-Date-Format
+Summary: Produce RFC 2822 date strings
Version: 1.002
-Release: 10
-Requires: perl = %{perl_version}
-AutoReqProv: on
+Release: 11
+License: GPL+ or Artistic
Group: Development/Libraries/Perl
-License: Artistic
-Summary: Email::Date::Format - produce RFC 2822 date strings
-Source: Email-Date-Format-%{version}.tar.bz2
+Url: http://search.cpan.org/dist/Email-Date-Format/
+#Source: http://www.cpan.org/authors/id/R/RJ/RJBS/Email-Date-Format-1.002.tar.gz
+Source: %{cpan_name}-%{version}.tar.bz2
+BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
+%if 0%{?suse_version} < 1120
+BuildRequires: perl-macros
+%endif
+%if %{with pod}
+BuildRequires: perl(Test::Pod) >= 1.14
+BuildRequires: perl(Test::Pod::Coverage) >= 1.08
+%endif
+BuildRequires: perl(Test::More) >= 0.47
+BuildRequires: perl(Time::Local)
+Requires: perl = %{perl_version}
+Requires: perl(Time::Local)
%description
-This module provides a simple means for generating an RFC 2822
-compliant datetime string. (In case you care, they're not RFC 822
-dates, because they use a four digit year, which is not allowed in RFC
-822.)
-
-
+This module provides a simple means for generating an RFC 2822 compliant
+datetime string. (In case you care, they're not RFC 822 dates, because they
+use a four digit year, which is not allowed in RFC 822.)
Authors:
--------
- Ricardo SIGNES, <rjbs(a)cpan.org>
+ Ricardo SIGNES, <_rjbs(a)cpan.org_>.
+ Adapted from Email::Date, by Casey West.
%prep
-%setup -q -n Email-Date-Format-%{version}
+%setup -q -n %{cpan_name}-%{version}
%build
-perl Makefile.PL
-make %{?_smp_mflags}
+%{__perl} Makefile.PL INSTALLDIRS=vendor
+%{__make} %{?_smp_mflags}
%check
-make test
+%{__make} test
%install
-make DESTDIR=$RPM_BUILD_ROOT install_vendor
+%perl_make_install
+### since 11.4 perl_process_packlist
+### removes .packlist, perllocal.pod files
+%if 0%{?suse_version} > 1130
%perl_process_packlist
+%else
+# do not perl_process_packlist
+# remove .packlist file
+%{__rm} -rf $RPM_BUILD_ROOT%perl_vendorarch
+# remove perllocal.pod file
+%{__rm} -f $RPM_BUILD_ROOT%perl_archlib/perllocal.pod
+%endif
+%perl_gen_filelist
%clean
-rm -rf $RPM_BUILD_ROOT
+%{__rm} -rf $RPM_BUILD_ROOT
-%files
-%defattr(-,root,root)
-%doc Changes LICENSE Makefile.PL MANIFEST META.yml README
-%doc %{_mandir}/man?/*
-%dir %{perl_vendorarch}/auto/Email/Date/Format/
-%dir %{perl_vendorarch}/auto/Email/Date/
-%dir %{perl_vendorarch}/auto/Email/
-%{perl_vendorarch}/auto/Email/Date/Format/
-%dir %{perl_vendorlib}/Email/
-%dir %{perl_vendorlib}/Email/Date/
-%{perl_vendorlib}/Email/Date/Format.pm
-/var/adm/perl-modules/perl-Email-Date-Format
+%files -f %{name}.files
+%defattr(-,root,root,-)
+%doc Changes LICENSE README
%changelog
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package rpmlint for openSUSE:Factory
checked in at Fri Nov 26 17:47:21 CET 2010.
--------
--- rpmlint/rpmlint.changes 2010-11-19 13:24:07.000000000 +0100
+++ rpmlint/rpmlint.changes 2010-11-24 16:01:49.000000000 +0100
@@ -1,0 +2,7 @@
+Wed Nov 24 11:43:53 CET 2010 - dmueller(a)suse.de
+
+- remove filter for no-url-tag (bnc#642588)
+- clarify wording for run_ldconfig check (bnc#637187)
+- skip desktop files in /etc (bnc#604283)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
extend-suse-conffiles-check.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rpmlint.spec ++++++
--- /var/tmp/diff_new_pack.8Wmp49/_old 2010-11-26 17:44:48.000000000 +0100
+++ /var/tmp/diff_new_pack.8Wmp49/_new 2010-11-26 17:44:48.000000000 +0100
@@ -23,7 +23,7 @@
BuildRequires: rpm-python
Summary: Rpm correctness checker
Version: 1.0
-Release: 5
+Release: 6
Source0: %{name}-%{version}.tar.bz2
Source1: config
Source1001: config.in
@@ -122,6 +122,7 @@
Patch81: suse-whitelist-opensuse.diff
Patch82: rpmlint-badness-info.diff
Patch83: incoherent-warning-fix.diff
+Patch84: extend-suse-conffiles-check.diff
%py_requires
%description
@@ -200,6 +201,7 @@
%patch81
%patch82 -p1
%patch83
+%patch84
cp -p %{SOURCE1} .
cp -p %{SOURCE2} .
cp -p %{SOURCE3} .
++++++ config ++++++
--- /var/tmp/diff_new_pack.8Wmp49/_old 2010-11-26 17:44:48.000000000 +0100
+++ /var/tmp/diff_new_pack.8Wmp49/_new 2010-11-26 17:44:48.000000000 +0100
@@ -209,7 +209,6 @@
addFilter(" dangerous-command.*")
addFilter(" setuid-binary.*")
addFilter(".*FSSTND-dir-in-var /var/adm/.*")
-addFilter("no-url-tag")
addFilter("subdir-in-bin /sbin/conf.d/")
addFilter(" invalid-license")
addFilter(".* nss_db non-standard-dir-in-var db")
++++++ extend-suse-conffiles-check.diff ++++++
--- FilesCheck.py
+++ FilesCheck.py
@@ -1200,7 +1200,7 @@
if nonexec_file and not docdir_examples_regex.search(f):
printWarning(pkg, 'spurious-executable-perm', f)
elif f.startswith('/etc/') and f not in config_files and \
- f not in ghost_files:
+ f not in ghost_files and not f.endswith(".desktop"):
printWarning(pkg, 'non-conffile-in-etc', f)
if pkg.arch == 'noarch' and f.startswith('/usr/lib64/python'):
++++++ suse-no-run-ldconfig.diff ++++++
--- /var/tmp/diff_new_pack.8Wmp49/_old 2010-11-26 17:44:48.000000000 +0100
+++ /var/tmp/diff_new_pack.8Wmp49/_new 2010-11-26 17:44:49.000000000 +0100
@@ -1,8 +1,6 @@
-Index: SpecCheck.py
-===================================================================
---- SpecCheck.py.orig
+--- SpecCheck.py
+++ SpecCheck.py
-@@ -403,6 +403,10 @@ class SpecCheck(AbstractCheck.AbstractCh
+@@ -394,6 +394,10 @@
printWarning(pkg, 'comparison-operator-in-deptoken',
conf)
@@ -13,17 +11,17 @@
if current_section == 'changelog':
for match in AbstractCheck.macro_regex.findall(line):
res = re.match('%+', match)
-@@ -690,6 +694,14 @@ may break short circuit builds.''',
+@@ -681,6 +685,14 @@
'''Make check or other automated regression test should be run in %check, as
they can be disabled with a rpm macro for short circuiting purposes.''',
+'deprecated-use-of-%run_ldconfig',
+'''According to the new SUSE Packaging Conventions, the use of %run_ldconfig
-+is deprecated. use
++is deprecated. Please use /sbin/ldconfig instead, or
+
+%post(un) -p /sbin/ldconfig
+
-+instead.''',
++in the case where ldconfig is the only command to be executed.''',
+
'macro-in-%changelog',
'''Macros are expanded in %changelog too, which can in unfortunate cases lead
++++++ suse-pkg-config-check.diff ++++++
--- /var/tmp/diff_new_pack.8Wmp49/_old 2010-11-26 17:44:49.000000000 +0100
+++ /var/tmp/diff_new_pack.8Wmp49/_new 2010-11-26 17:44:49.000000000 +0100
@@ -1,6 +1,8 @@
---- TagsCheck.py
+Index: TagsCheck.py
+===================================================================
+--- TagsCheck.py.orig
+++ TagsCheck.py
-@@ -414,6 +414,7 @@
+@@ -414,6 +414,7 @@ lib_devel_number_regex = re.compile('^li
invalid_url_regex = re.compile(Config.getOption('InvalidURL'), re.IGNORECASE)
lib_package_regex = re.compile('(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', re.IGNORECASE)
leading_space_regex = re.compile('^\s+')
@@ -8,7 +10,7 @@
license_regex = re.compile('\(([^)]+)\)|\s(?:and|or)\s')
invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE)
# () are here for grouping purpose in the regexp
-@@ -623,10 +624,12 @@
+@@ -623,10 +624,12 @@ class TagsCheck(AbstractCheck.AbstractCh
base = is_devel.group(1)
dep = None
has_so = False
@@ -22,7 +24,7 @@
if has_so:
base_or_libs = base + '/' + base + '-libs/lib' + base
# try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)")
-@@ -663,6 +666,15 @@
+@@ -663,6 +666,15 @@ class TagsCheck(AbstractCheck.AbstractCh
if prov not in (x[0] for x in pkg.provides()):
printWarning(pkg, 'no-provides', prov)
@@ -38,9 +40,9 @@
# List of words to ignore in spell check
ignored_words = set()
for pf in pkg.files():
-@@ -1082,6 +1094,11 @@
+@@ -1082,6 +1094,11 @@ instead or require a file in bin or /etc
'no-url-tag',
- '''The URL tag is missing.''',
+ '''The URL tag is missing. Please add a http or ftp link to the project location.''',
+'no-pkg-config-provides',
+'''The package installes a .pc file but does not provide pkgconfig(..) provides.
++++++ suse-url-check.diff ++++++
--- /var/tmp/diff_new_pack.8Wmp49/_old 2010-11-26 17:44:49.000000000 +0100
+++ /var/tmp/diff_new_pack.8Wmp49/_new 2010-11-26 17:44:49.000000000 +0100
@@ -1,8 +1,6 @@
-Index: TagsCheck.py
-===================================================================
---- TagsCheck.py.orig
+--- TagsCheck.py
+++ TagsCheck.py
-@@ -762,14 +762,14 @@ class TagsCheck(AbstractCheck.AbstractCh
+@@ -762,7 +762,7 @@
if not valid_license:
self._unexpanded_macros(pkg, 'License', rpm_license)
@@ -11,11 +9,12 @@
if hasattr(rpm, 'RPMTAG_%s' % tag.upper()):
url = pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())]
self._unexpanded_macros(pkg, tag, url, is_url = True)
- if url:
- (scheme, netloc) = urlparse(url)[0:2]
- if not scheme or not netloc or "." not in netloc or \
-- scheme not in ('http', 'https', 'ftp') or \
-+ scheme not in ('obs', 'http', 'https', 'ftp') or \
- (Config.getOption('InvalidURL') and \
- invalid_url_regex.search(url)):
- printWarning(pkg, 'invalid-url', tag, url)
+@@ -1070,7 +1070,7 @@
+ '''This rpm requires a specific release of another package.''',
+
+ 'no-url-tag',
+-'''The URL tag is missing.''',
++'''The URL tag is missing. Please add a http or ftp link to the project location.''',
+
+ 'name-repeated-in-summary',
+ '''The name of the package is repeated in its summary. This is often redundant
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package perl-AppConfig for openSUSE:Factory
checked in at Fri Nov 26 17:42:27 CET 2010.
--------
--- perl-AppConfig/perl-AppConfig.changes 2010-01-10 15:53:47.000000000 +0100
+++ perl-AppConfig/perl-AppConfig.changes 2010-11-24 20:00:32.000000000 +0100
@@ -1,0 +2,7 @@
+Wed Nov 24 18:58:17 UTC 2010 - chris(a)computersalat.de
+
+- recreated by cpanspec 1.78
+ o fix deps
+- noarch pkg
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-AppConfig.spec ++++++
--- /var/tmp/diff_new_pack.a7KSAI/_old 2010-11-26 17:40:10.000000000 +0100
+++ /var/tmp/diff_new_pack.a7KSAI/_new 2010-11-26 17:40:10.000000000 +0100
@@ -19,17 +19,23 @@
Name: perl-AppConfig
+%define cpan_name AppConfig
+Summary: Reading configuration files and parsing command line arguments
Version: 1.66
-Release: 80
-Requires: perl = %{perl_version} perl-File-HomeDir
-BuildRequires: perl-File-HomeDir
-AutoReqProv: on
+Release: 88
+License: Distributable, see LICENSE
Group: Development/Libraries/Perl
-License: Artistic
-Url: http://cpan.org/modules/by-module/AppConfig/
-Summary: Perl module for reading configuration files and parsing command line arguments
-Source: AppConfig-%{version}.tar.bz2
+Url: http://search.cpan.org/dist/AppConfig/
+#Source: http://www.cpan.org/authors/id/A/AB/ABW/AppConfig-1.66.tar.gz
+Source: %{cpan_name}-%{version}.tar.bz2
+BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: perl
+%if 0%{?suse_version} < 1120
+BuildRequires: perl-macros
+%endif
+BuildRequires: perl(Test::More)
+Requires: perl = %{perl_version}
%description
AppConfig is a Perl module for managing application configuration
@@ -37,35 +43,42 @@
provides methods for parsing configuration files and command line
arguments.
-
-
Authors:
--------
- Andy Wardley <abw(a)cre.canon.co.uk
+ Andy Wardley, <abw(a)wardley.org>
+ With contributions from Dave Viner, Ijon Tichy, Axel Gerstmair and many
+ others whose names have been lost to the sands of time (reminders welcome).
%prep
-%setup -q -n AppConfig-%{version}
-# ---------------------------------------------------------------------------
+%setup -q -n %{cpan_name}-%{version}
%build
-perl Makefile.PL
-make %{?_smp_mflags}
+%{__perl} Makefile.PL INSTALLDIRS=vendor
+%{__make} %{?_smp_mflags}
%check
-make test
-# ---------------------------------------------------------------------------
+%{__make} test
%install
- rm -rf $RPM_BUILD_ROOT
- make DESTDIR=$RPM_BUILD_ROOT install_vendor
- %perl_process_packlist
+%perl_make_install
+### since 11.4 perl_process_packlist
+### removes .packlist, perllocal.pod files
+%if 0%{?suse_version} > 1130
+%perl_process_packlist
+%else
+# do not perl_process_packlist
+# remove .packlist file
+%{__rm} -rf $RPM_BUILD_ROOT%perl_vendorarch
+# remove perllocal.pod file
+%{__rm} -f $RPM_BUILD_ROOT%perl_archlib/perllocal.pod
+%endif
+%perl_gen_filelist
+
+%clean
+%{__rm} -rf $RPM_BUILD_ROOT
-%files
+%files -f %{name}.files
%defattr(-,root,root,-)
-%doc Changes MANIFEST README TODO
-%doc %{_mandir}/man?/*
-%{perl_vendorlib}/AppConfig*
-%{perl_vendorarch}/auto/AppConfig
-/var/adm/perl-modules/perl-AppConfig
+%doc Changes LICENSE README TODO
%changelog
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package perl-Convert-ASN1 for openSUSE:Factory
checked in at Fri Nov 26 17:36:21 CET 2010.
--------
--- perl-Convert-ASN1/perl-Convert-ASN1.changes 2010-10-19 10:45:37.000000000 +0200
+++ perl-Convert-ASN1/perl-Convert-ASN1.changes 2010-11-24 20:50:32.000000000 +0100
@@ -1,0 +2,7 @@
+Wed Nov 24 19:47:12 UTC 2010 - chris(a)computersalat.de
+
+- recreated by cpanspec 1.78
+- noarch pkg
+- removed Obsoletes/Provides p_casn1
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Convert-ASN1.spec ++++++
--- /var/tmp/diff_new_pack.s19omM/_old 2010-11-26 17:35:32.000000000 +0100
+++ /var/tmp/diff_new_pack.s19omM/_new 2010-11-26 17:35:32.000000000 +0100
@@ -19,51 +19,66 @@
Name: perl-Convert-ASN1
+%define cpan_name Convert-ASN1
+Summary: ASN.1 Encode/Decode library
Version: 0.22
-Release: 9
-Provides: p_casn1
-Obsoletes: p_casn1
-Requires: perl = %{perl_version}
-AutoReqProv: on
+Release: 10
+License: GPL+ or Artistic
Group: Development/Libraries/Perl
-License: Artistic
-Url: http://cpan.org/modules/by-module/Convert/
-Summary: Convert::ASN1
-Source: Convert-ASN1-%{version}.tar.bz2
-Patch0: Convert-ASN1-%{version}-path.diff
-Patch1: Convert-ASN1-%{version}-test.diff
+Url: http://search.cpan.org/dist/Convert-ASN1/
+#Source: http://www.cpan.org/authors/id/G/GB/GBARR/Convert-ASN1-0.22.tar.gz
+Source: %{cpan_name}-%{version}.tar.bz2
+Patch0: %{cpan_name}-0.22-path.diff
+Patch1: %{cpan_name}-0.22-test.diff
+BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
+%if 0%{?suse_version} < 1120
+BuildRequires: perl-macros
+%endif
+Requires: perl = %{perl_version}
%description
-Convert::ASN1 converts between Perl data structures and ASN.1 encoded
-packets.
-
+Convert::ASN1 encodes and decodes ASN.1 data structures using BER/DER
+rules.
+Authors:
+--------
+ Graham Barr <gbarr(a)pobox.com>, Report bugs via
+ <bug-Convert-ASN1(a)rt.cpan.org>
%prep
-%setup -q -n Convert-ASN1-%{version}
+%setup -q -n %{cpan_name}-%{version}
%patch0
%patch1
%build
-perl Makefile.PL
-make %{?_smp_mflags}
-make test
+%{__perl} Makefile.PL INSTALLDIRS=vendor
+%{__make} %{?_smp_mflags}
+
+%check
+%{__make} test
%install
%perl_make_install
+### since 11.4 perl_process_packlist
+### removes .packlist, perllocal.pod files
+%if 0%{?suse_version} > 1130
%perl_process_packlist
+%else
+# do not perl_process_packlist
+# remove .packlist file
+%{__rm} -rf $RPM_BUILD_ROOT%perl_vendorarch
+# remove perllocal.pod file
+%{__rm} -f $RPM_BUILD_ROOT%perl_archlib/perllocal.pod
+%endif
+%perl_gen_filelist
%clean
-rm -rf $RPM_BUILD_ROOT
+%{__rm} -rf $RPM_BUILD_ROOT
-%files
-%defattr(-,root,root)
+%files -f %{name}.files
+%defattr(-,root,root,-)
%doc ChangeLog OldChanges README
-%doc %{_mandir}/man?/*
-%{perl_vendorlib}/Convert
-%{perl_vendorarch}/auto/Convert
-/var/adm/perl-modules/%{name}
%changelog
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package xorg-x11-driver-video for openSUSE:Factory
checked in at Fri Nov 26 17:35:20 CET 2010.
--------
--- xorg-x11-driver-video/xorg-x11-driver-video.changes 2010-11-12 19:21:11.000000000 +0100
+++ xorg-x11-driver-video/xorg-x11-driver-video.changes 2010-11-24 15:20:09.000000000 +0100
@@ -1,0 +2,11 @@
+Wed Nov 24 13:35:15 UTC 2010 - sndirsch(a)novell.com
+
+- xf86-video-intel 2.13.901-20101117-33c0888
+ * uxa: Fix crash after allocation failure
+ * i915: Disable maximum state addresses
+ * uxa: Relax fencing some more for gen3
+ * Mark outputs as DPMSModeOn and restore backlight at mode set
+- xf86-video-intel-Disable-BLT-for-i830-and-845G.patch
+ * Disable BLT for i830 and 845G
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
xf86-video-intel-2.13.901.tar.bz2
New:
----
xf86-video-intel-2.13.901-20101117-33c0888.tar.bz2
xf86-video-intel-Disable-BLT-for-i830-and-845G.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xorg-x11-driver-video.spec ++++++
--- /var/tmp/diff_new_pack.tvhPOZ/_old 2010-11-26 17:33:51.000000000 +0100
+++ /var/tmp/diff_new_pack.tvhPOZ/_new 2010-11-26 17:33:51.000000000 +0100
@@ -23,7 +23,7 @@
BuildRequires: Mesa-devel libdrm-devel pkgconfig xorg-x11-proto-devel xorg-x11-server-sdk
Url: http://xorg.freedesktop.org/
Version: 7.5
-Release: 31
+Release: 32
License: MIT License (or similar)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Group: System/X11/Servers/XF86_4
@@ -66,7 +66,7 @@
Source41: xf86-video-vmware-11.0.3.tar.bz2
Source42: xf86-video-voodoo-1.2.4.tar.bz2
Source44: HALlib-4.1.tar.gz
-Source45: xf86-video-intel-2.13.901.tar.bz2
+Source45: xf86-video-intel-2.13.901-20101117-33c0888.tar.bz2
Source46: xf86-video-ati-6.13.2.tar.bz2
Source51: xf86-video-geode-2.11.10.tar.bz2
Source54: xf86-video-mach64-6.8.2.tar.bz2
@@ -101,6 +101,7 @@
Patch141: xf86-video-ati-theatre.patch
Patch142: xf86-video-ati-theatre-pciaccess.patch
Patch143: xf86-video-xgi-buildfix.diff
+Patch144: xf86-video-intel-Disable-BLT-for-i830-and-845G.patch
%description
This package contains X.Org video drivers.
@@ -154,6 +155,7 @@
pushd xf86-video-intel-*
#%patch112 -p1
%patch130 -p0
+%patch144 -p1
popd
pushd xf86-video-nv-*
%patch132 -p1
++++++ xf86-video-intel-Disable-BLT-for-i830-and-845G.patch ++++++
>From 0bb135c40e5ac1bf7593ec1d68d2815cbf47aa25 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris(a)chris-wilson.co.uk>
Date: Tue, 23 Nov 2010 22:27:38 +0000
Subject: [PATCH] Disable BLT for i830 and 845G
This pair of chipsets seem broken beyond repair, specifically the
erratum that causes the wrong PTE entry to be invalidated, so disable
our incorrect attempts to use the BLT on those devices.
Signed-off-by: Chris Wilson <chris(a)chris-wilson.co.uk>
---
src/intel.h | 1 +
src/intel_driver.c | 22 +++++++++++++++++-----
src/intel_shadow.c | 4 ++--
3 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/intel.h b/src/intel.h
index fa79a2f..ed21b1e 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -443,6 +443,7 @@ typedef struct intel_screen_private {
Bool use_pageflipping;
Bool force_fallback;
+ Bool can_blt;
Bool use_shadow;
/* Broken-out options. */
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 926c7e3..e4aecfc 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -468,8 +468,21 @@ static void I830XvInit(ScrnInfoPtr scrn)
intel->colorKey);
}
-static Bool can_accelerate_2d(struct intel_screen_private *intel)
+static Bool can_accelerate_blt(struct intel_screen_private *intel)
{
+ if (IS_I830(intel) || IS_845G(intel)) {
+ /* These pair of i8xx chipsets have a crippling erratum
+ * that prevents the use of a PTE entry by the BLT
+ * engine immediately following updating that
+ * entry in the GATT.
+ *
+ * As the BLT is fundamental to our 2D acceleration,
+ * and the workaround is lost in the midst of time,
+ * fallback.
+ */
+ return FALSE;
+ }
+
if (INTEL_INFO(intel)->gen >= 60) {
drm_i915_getparam_t gp;
int value;
@@ -592,9 +605,8 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
intel->tiling = FALSE;
}
- intel->use_shadow = FALSE;
- if (!can_accelerate_2d(intel))
- intel->use_shadow = TRUE;
+ intel->can_blt = can_accelerate_blt(intel);
+ intel->use_shadow = !intel->can_blt;
if (xf86IsOptionSet(intel->Options, OPTION_SHADOW)) {
intel->use_shadow =
@@ -606,7 +618,7 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
if (intel->use_shadow) {
xf86DrvMsg(scrn->scrnIndex, X_CONFIG,
"Shadow buffer enabled,"
- " GPU acceleration disabled.\n");
+ " 2D GPU acceleration disabled.\n");
}
/* SwapBuffers delays to avoid tearing */
diff --git a/src/intel_shadow.c b/src/intel_shadow.c
index c12febc..b86530a 100644
--- a/src/intel_shadow.c
+++ b/src/intel_shadow.c
@@ -108,7 +108,7 @@ void intel_shadow_blt(intel_screen_private *intel)
int n;
/* Can we trust the BLT? Otherwise do an uncached mmecy. */
- if (IS_GEN2(intel) || IS_GEN6(intel)) {
+ if (!intel->can_blt || IS_GEN2(intel)) {
intel_shadow_memcpy(intel);
return;
}
@@ -149,7 +149,7 @@ void intel_shadow_blt(intel_screen_private *intel)
if (bo == NULL)
return;
- BEGIN_BATCH(8);
+ BEGIN_BATCH_BLT(8);
OUT_BATCH(blt);
OUT_BATCH(br13);
OUT_BATCH(box->y1 << 16 | box->x1);
--
1.7.3.1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package yast2-mail for openSUSE:Factory
checked in at Fri Nov 26 17:33:39 CET 2010.
--------
--- yast2-mail/yast2-mail.changes 2010-08-12 17:10:56.000000000 +0200
+++ yast2-mail/yast2-mail.changes 2010-11-25 12:47:55.000000000 +0100
@@ -1 +1,6 @@
--------------------------------------------------------------------
+------------------------------------------------------------------
+Thu Nov 25 13:42:17 CET 2010 - varkoly(a)suse.de
+
+- bnc#649549 - yast2-mail doesn't enable and start cyrus-imapd
+
+------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-mail-2.18.5.tar.bz2
New:
----
yast2-mail-2.18.6.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-mail.spec ++++++
--- /var/tmp/diff_new_pack.avxiP7/_old 2010-11-26 17:32:49.000000000 +0100
+++ /var/tmp/diff_new_pack.avxiP7/_new 2010-11-26 17:32:49.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-mail (Version 2.18.5)
+# spec file for package yast2-mail (Version 2.18.6)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,11 +19,11 @@
Name: yast2-mail
-Version: 2.18.5
-Release: 4
+Version: 2.18.6
+Release: 1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-mail-2.18.5.tar.bz2
+Source0: yast2-mail-2.18.6.tar.bz2
Prefix: /usr
@@ -70,7 +70,7 @@
configuration.
%prep
-%setup -n yast2-mail-2.18.5
+%setup -n yast2-mail-2.18.6
%build
%{prefix}/bin/y2tool y2autoconf
++++++ yast2-mail-2.18.5.tar.bz2 -> yast2-mail-2.18.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-mail-2.18.5/VERSION new/yast2-mail-2.18.6/VERSION
--- old/yast2-mail-2.18.5/VERSION 2010-04-07 14:55:50.000000000 +0200
+++ new/yast2-mail-2.18.6/VERSION 2010-11-25 13:44:22.000000000 +0100
@@ -1 +1 @@
-2.18.5
+2.18.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-mail-2.18.5/src/Mail.ycp new/yast2-mail-2.18.6/src/Mail.ycp
--- old/yast2-mail-2.18.5/src/Mail.ycp 2010-08-12 14:05:03.000000000 +0200
+++ new/yast2-mail-2.18.6/src/Mail.ycp 2010-11-25 13:33:31.000000000 +0100
@@ -11,7 +11,7 @@
* Authors:
* Martin Vidner <mvidner(a)suse.cz>
*
- * $Id: Mail.ycp 61601 2010-04-07 12:52:02Z varkoly $
+ * $Id: Mail.ycp 62891 2010-11-25 11:33:23Z varkoly $
*
* Representation of the configuration of mail.
* Input and output routines.
@@ -253,6 +253,7 @@
*/
global define string ProbePackages () ``{
string message = "";
+ boolean newcyrus = false;
install_packages = [];
remove_packages = [];
@@ -302,11 +303,17 @@
install_packages = add(install_packages,"cyrus-imapd");
// Translators: popup message part, ends with a newline
message = message + _("Cyrus-imapd, an IMAP server, will be installed.\n");
+ newcyrus = true;
}
if( install_packages != [] )
{
Package::DoInstall(install_packages);
}
+ if( newcyrus )
+ {
+ Service::Enable("cyrus")
+ Service::Start("cyrus")
+ }
return message;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-mail-2.18.5/src/YaPI/MailServer.pm new/yast2-mail-2.18.6/src/YaPI/MailServer.pm
--- old/yast2-mail-2.18.5/src/YaPI/MailServer.pm 2010-06-21 11:20:39.000000000 +0200
+++ new/yast2-mail-2.18.6/src/YaPI/MailServer.pm 2010-11-25 13:31:39.000000000 +0100
@@ -42,7 +42,8 @@
textdomain("mail");
our %TYPEINFO;
our @CAPABILITIES = (
- 'SLES10'
+ 'SLES10',
+ 'SLES11'
);
our $VERSION="2.2.0";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-mail-2.18.5/src/mail.ycp new/yast2-mail-2.18.6/src/mail.ycp
--- old/yast2-mail-2.18.5/src/mail.ycp 2010-07-31 09:36:31.000000000 +0200
+++ new/yast2-mail-2.18.6/src/mail.ycp 2010-11-25 13:33:31.000000000 +0100
@@ -12,7 +12,7 @@
* Peter Varkoly <varkoly(a)novell.com>
* Martin Vidner <mvidner(a)suse.cz>
*
- * $Id: mail.ycp 61601 2010-04-07 12:52:02Z varkoly $
+ * $Id: mail.ycp 62891 2010-11-25 11:33:23Z varkoly $
*
* Main file for mail configuration. Uses all other files.
*
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package perl-Cairo for openSUSE:Factory
checked in at Fri Nov 26 17:32:35 CET 2010.
--------
--- perl-Cairo/perl-Cairo.changes 2010-10-13 12:24:32.000000000 +0200
+++ perl-Cairo/perl-Cairo.changes 2010-11-24 17:30:04.000000000 +0100
@@ -1,0 +2,6 @@
+Wed Nov 24 16:24:31 UTC 2010 - chris(a)computersalat.de
+
+- recreated by cpanspec 1.78
+ o fix deps
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Cairo.spec ++++++
--- /var/tmp/diff_new_pack.pp9TkF/_old 2010-11-26 17:28:19.000000000 +0100
+++ /var/tmp/diff_new_pack.pp9TkF/_new 2010-11-26 17:28:19.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package perl-Cairo (Version 1.061 )
+# spec file for package perl-Cairo (Version 1.061)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,61 +19,74 @@
Name: perl-Cairo
+%define cpan_name Cairo
+Summary: Perl interface to the cairo library
Version: 1.061
-Release: 9
-Requires: perl = %{perl_version} perl-ExtUtils-Depends perl-ExtUtils-PkgConfig
-BuildRequires: cairo-devel perl-ExtUtils-Depends perl-ExtUtils-PkgConfig pkgconfig
-AutoReqProv: on
-Group: Development/Libraries/Perl
+Release: 10
License: LGPLv2.1+
-Url: http://cpan.org//authors/id/T/TS/TSCH/
-Summary: Perl bindings to the cairo graphics library.
-Source: Cairo-%{version}.tar.bz2
-# FIX-UPSTREAM coolo(a)novell.com - take patch from launchpad to fix build with current cairo
+Group: Development/Libraries/Perl
+Url: http://search.cpan.org/dist/Cairo/
+#Source: http://www.cpan.org/authors/id/T/TS/TSCH/Cairo-1.061.tar.gz
+Source: %{cpan_name}-%{version}.tar.bz2
Patch0: disable_failing_tests.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: cairo-devel pkgconfig
+BuildRequires: perl
+%if 0%{?suse_version} < 1120
+BuildRequires: perl-macros
+%endif
+BuildRequires: perl(ExtUtils::Depends) >= 0.2
+BuildRequires: perl(ExtUtils::PkgConfig) >= 1
+BuildRequires: perl(Test::Number::Delta) >= 1
+#
+Requires: perl = %{perl_version}
+Requires: perl(ExtUtils::Depends) >= 0.2
+Requires: perl(ExtUtils::PkgConfig) >= 1
%description
-Perl bindings to the cairo graphics library
-(http://www.cairographics.org).
-
-
+Cairo provides Perl bindings for the vector graphics library cairo.
+It supports multiple output targets, including PNG, PDF and SVG.
+Cairo produces identical output on all those targets.
Authors:
--------
- Ross McFarland <rwmcfa1(a)neces.com>
- Torsten Schoenfeld <kaffeetisch(a)gmx.de>
+ Ross McFarland <rwmcfa1 at neces dot com>
+ Torsten Schoenfeld <kaffeetisch at gmx dot de>
%prep
-%setup -q -n Cairo-%{version}
+%setup -q -n %{cpan_name}-%{version}
%patch0 -p1
%build
#disable some randomly failing tests
-mv t/Cairo.t t/Cairo.tt
-mv t/CairoFont.t t/CairoFont.tt
-perl Makefile.PL
-make %{?_smp_mflags}
+%{__mv} t/Cairo.t t/Cairo.tt
+%{__mv} t/CairoFont.t t/CairoFont.tt
+%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
+%{__make} %{?_smp_mflags}
%check
-make test
+%{__make} test
%install
-rm -rf $RPM_BUILD_ROOT
%perl_make_install
+### since 11.4 perl_process_packlist
+### removes .packlist, perllocal.pod files
+%if 0%{?suse_version} > 1130
%perl_process_packlist
+%else
+# do not perl_process_packlist
+# remove .packlist file
+%{__rm} -f $RPM_BUILD_ROOT%perl_vendorarch/auto/Cairo/.packlist
+# remove perllocal.pod file
+%{__rm} -f $RPM_BUILD_ROOT%perl_archlib/perllocal.pod
+%endif
+%perl_gen_filelist
%clean
-rm -rf $RPM_BUILD_ROOT
+%{__rm} -rf $RPM_BUILD_ROOT
-%files
-%defattr(-,root,root)
-%doc LICENSE MANIFEST NEWS TODO MANIFEST.SKIP README examples
-%doc %{_mandir}/man?/*
-%{perl_vendorarch}/auto/Cairo
-%{perl_vendorarch}/Cairo.pm
-%{perl_vendorarch}/Cairo/*
-%dir %{perl_vendorarch}/Cairo
-/var/adm/perl-modules/%{name}
+%files -f %{name}.files
+%defattr(-,root,root,-)
+%doc ChangeLog LICENSE NEWS README TODO examples
%changelog
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0