OBS User unknown 2009-04-23 19:51:04 +00:00 committed by Git OBS Bridge
parent 8ca5658e51
commit 55594b088c
4 changed files with 147 additions and 22 deletions

View File

@ -241,6 +241,40 @@ withsysfs() {
fi
}
get_alsa_library_version() {
ALSA_LIB_VERSION=`grep VERSION_STR /usr/include/alsa/version.h 2>/dev/null|awk {'print $3'}|sed 's/"//g'`
if [ -z "$ALSA_LIB_VERSION" ]; then
if [ -f /etc/lsb-release ]; then
. /etc/lsb-release
case "$DISTRIB_ID" in
Ubuntu)
if which dpkg > /dev/null ; then
ALSA_LIB_VERSION=`dpkg -l libasound2 | tail -1 | awk '{print $3}' | cut -f 1 -d -`
fi
if [ "$ALSA_LIB_VERSION" = "<none>" ]; then
ALSA_LIB_VERSION=""
fi
return
;;
*)
return
;;
esac
elif [ -f /etc/debian_version ]; then
if which dpkg > /dev/null ; then
ALSA_LIB_VERSION=`dpkg -l libasound2 | tail -1 | awk '{print $3}' | cut -f 1 -d -`
fi
if [ "$ALSA_LIB_VERSION" = "<none>" ]; then
ALSA_LIB_VERSION=""
fi
return
fi
fi
}
#Run checks to make sure the programs we need are installed.
LSPCI=$(which lspci 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null);
@ -277,6 +311,12 @@ case "$1" in
REPEAT=""
shift
;;
--stdout)
DIALOG=""
NOUPLOAD="yes"
QUESTION="no"
TOSTDOUT="yes"
;;
esac
done
@ -350,7 +390,7 @@ KERNEL_MACHINE=`uname -m`
KERNEL_OS=`uname -o`
[[ `uname -v |grep SMP` ]] && KERNEL_SMP="Yes" || KERNEL_SMP="No"
ALSA_DRIVER_VERSION=`cat /proc/asound/version |head -n1|awk {'print $7'} |sed 's/\.$//'`
ALSA_LIB_VERSION=`grep VERSION_STR /usr/include/alsa/version.h 2>/dev/null|awk {'print $3'}|sed 's/"//g'`
get_alsa_library_version
ALSA_UTILS_VERSION=`amixer -v |awk {'print $3'}`
VENDOR_ID=`lspci -vn |grep 040[1-3] | awk -F':' '{print $3}'|awk {'print substr($0, 2);}' >$TEMPDIR/vendor_id.tmp`
DEVICE_ID=`lspci -vn |grep 040[1-3] | awk -F':' '{print $4}'|awk {'print $1'} >$TEMPDIR/device_id.tmp`
@ -627,6 +667,17 @@ then
fi
fi
;;
--stdout)
NOUPLOAD="yes"
withdevices
withconfigs
withaplay
withamixer
withalsactl
withlsmod
cat $FILE
rm $FILE
;;
--about)
echo "Written/Tested by the following users of #alsa on irc.freenode.net:"
echo ""
@ -635,6 +686,7 @@ then
echo " gnubien - Various script ideas / Testing"
echo " GrueMaster - HDA Intel specific items / Testing"
echo " olegfink - Script update function"
echo " TheMuso - display to stdout functionality"
exit 0
;;
*)
@ -652,6 +704,8 @@ then
echo " --no-upload (do not upload contents to remote server)"
echo " --pastebin (use http://pastebin.ca) as remote server"
echo " instead www.alsa-project.org"
echo " --stdout (print alsa information to standard output"
echo " instead of a file)"
echo " --about (show some information about the script)"
echo " --debug (will run the script as normal, but will not"
echo " delete $FILE)"
@ -668,7 +722,9 @@ fi
if [ -n "$NOUPLOAD" ]; then
mv $FILE $NFILE || exit 1
if [ -z "$TOSTDOUT" ]; then
mv $FILE $NFILE || exit 1
fi
if [[ -n $DIALOG ]]
then
@ -686,10 +742,12 @@ if [ -n "$NOUPLOAD" ]; then
echo "Your ALSA information can be seen by looking in $NFILE"
echo ""
else
echo "You requested that your information was NOT automatically uploaded to the $WWWSERVICE"
echo ""
echo "Your ALSA information can be seen by looking in $NFILE"
echo ""
if [ -z "$TOSTDOUT" ]; then
echo "You requested that your information was NOT automatically uploaded to the $WWWSERVICE"
echo ""
echo "Your ALSA information can be seen by looking in $NFILE"
echo ""
fi
fi
fi

View File

@ -226,10 +226,38 @@ index 0f4dd3a..4802200 100644
return 0;
values = n;
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 74d1d1a..209c5bb 100644
index 74d1d1a..e63bbe9 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -1430,7 +1430,7 @@ int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int s
@@ -104,9 +104,13 @@ implementation can be found in the \ref alsa_pcm_rw section.
The poll or select functions (see 'man 2 poll' or 'man 2 select' for further
details) allows to receive requests/events from the device while
an application is waiting on events from other sources (like keyboard, screen,
-network etc.), too. \ref snd_pcm_poll_descriptors can be used to get a file
-descriptor to poll or select on. The implemented
-transfer routines can be found in the \ref alsa_transfers section.
+network etc.), too. \ref snd_pcm_poll_descriptors can be used to get file
+descriptors to poll or select on (note that wait direction might be diferent
+than expected - do not use only returned file descriptors, but handle
+events member as well - see \ref snd_pcm_poll_descriptors function
+description for more details and \ref snd_pcm_poll_descriptors_revents for
+events demangling). The implemented transfer routines can be found in
+the \ref alsa_transfers section.
\subsection pcm_transfer_async Asynchronous notification
@@ -1405,7 +1409,9 @@ int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm)
* does the right "demangling".
*
* You can use output from this function as arguments for the select()
- * syscall, too.
+ * syscall, too. Do not forget to translate POLLIN and POLLOUT events to
+ * corresponding FD_SET arrays and demangle events using
+ * \link ::snd_pcm_poll_descriptors_revents() \endlink .
*/
int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space)
{
@@ -1430,7 +1436,7 @@ int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int s
* \param pcm PCM handle
* \param pfds array of poll descriptors
* \param nfds count of poll descriptors
@ -238,7 +266,7 @@ index 74d1d1a..209c5bb 100644
* \return zero if success, otherwise a negative error code
*
* This function does "demangling" of the revents mask returned from
@@ -1440,6 +1440,9 @@ int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int s
@@ -1440,6 +1446,9 @@ int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int s
* syscall returned that some events are waiting, this function might
* return empty set of events. In this case, application should
* do next event waiting using poll() or select().
@ -248,7 +276,7 @@ index 74d1d1a..209c5bb 100644
*/
int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
{
@@ -2338,8 +2341,8 @@ int snd_pcm_wait(snd_pcm_t *pcm, int timeout)
@@ -2338,8 +2347,8 @@ int snd_pcm_wait(snd_pcm_t *pcm, int timeout)
int snd_pcm_wait_nocheck(snd_pcm_t *pcm, int timeout)
{
struct pollfd *pfd;
@ -259,7 +287,7 @@ index 74d1d1a..209c5bb 100644
npfds = snd_pcm_poll_descriptors_count(pcm);
if (npfds <= 0 || npfds >= 16) {
@@ -2347,7 +2350,6 @@ int snd_pcm_wait_nocheck(snd_pcm_t *pcm, int timeout)
@@ -2347,7 +2356,6 @@ int snd_pcm_wait_nocheck(snd_pcm_t *pcm, int timeout)
return -EIO;
}
pfd = alloca(sizeof(*pfd) * npfds);
@ -267,7 +295,7 @@ index 74d1d1a..209c5bb 100644
err = snd_pcm_poll_descriptors(pcm, pfd, npfds);
if (err < 0)
return err;
@@ -2356,7 +2358,6 @@ int snd_pcm_wait_nocheck(snd_pcm_t *pcm, int timeout)
@@ -2356,7 +2364,6 @@ int snd_pcm_wait_nocheck(snd_pcm_t *pcm, int timeout)
return -EIO;
}
do {
@ -275,7 +303,7 @@ index 74d1d1a..209c5bb 100644
err_poll = poll(pfd, npfds, timeout);
if (err_poll < 0) {
if (errno == EINTR)
@@ -2365,28 +2366,23 @@ int snd_pcm_wait_nocheck(snd_pcm_t *pcm, int timeout)
@@ -2365,28 +2372,23 @@ int snd_pcm_wait_nocheck(snd_pcm_t *pcm, int timeout)
}
if (! err_poll)
break;
@ -317,7 +345,7 @@ index 74d1d1a..209c5bb 100644
#if 0 /* very useful code to test poll related problems */
{
snd_pcm_sframes_t avail_update;
@@ -7261,7 +7257,7 @@ int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent)
@@ -7261,7 +7263,7 @@ int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent)
* \param channels required PCM channels
* \param rate required sample rate in Hz
* \param soft_resample 0 = disallow alsa-lib resample stream, 1 = allow resampling
@ -707,6 +735,28 @@ index 82823a0..bfa1cc8 100644
snd_config_delete(sconf);
SNDERR("file is not defined");
return -EINVAL;
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index e9ce092..c46d14f 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -326,6 +326,8 @@ static int snd_pcm_hw_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
SYSMSG("SNDRV_PCM_IOCTL_HW_PARAMS failed");
return err;
}
+ params->info &= ~0xf0000000;
+ params->info |= (pcm->monotonic ? SND_PCM_INFO_MONOTONIC : 0);
err = sync_ptr(hw, 0);
if (err < 0)
return err;
@@ -1037,6 +1039,8 @@ static void snd_pcm_hw_dump(snd_pcm_t *pcm, snd_output_t *out)
if (pcm->setup) {
snd_output_printf(out, "Its setup is:\n");
snd_pcm_dump_setup(pcm, out);
+ snd_output_printf(out, " appl_ptr : %li\n", hw->mmap_control->appl_ptr);
+ snd_output_printf(out, " hw_ptr : %li\n", hw->mmap_status->hw_ptr);
}
}
diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c
index abd3d43..967cf46 100644
--- a/src/pcm/pcm_plug.c

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Apr 23 15:01:43 CEST 2009 - tiwai@suse.de
- update alsa-lib as of 2009.04.23:
* pcm: more better documentation for snd_pcm_poll_descriptors
* pcm_hw plugin: show appl_ptr and hw_ptr in dump() callback
* pcm_hw plugin: preserve monotonic flag also after
snd_pcm_hw_params() call
- update alsa-info.sh
-------------------------------------------------------------------
Mon Mar 23 12:29:29 CET 2009 - tiwai@suse.de

View File

@ -34,7 +34,7 @@ Obsoletes: alsa-64bit
#
Summary: Advanced Linux Sound Architecture
Version: 1.0.19
Release: 2
Release: 3
Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2
Source8: 40-alsa.rules
Source11: alsasound
@ -244,6 +244,13 @@ exit 0
%{_datadir}/alsa
%changelog
* Thu Apr 23 2009 tiwai@suse.de
- update alsa-lib as of 2009.04.23:
* pcm: more better documentation for snd_pcm_poll_descriptors
* pcm_hw plugin: show appl_ptr and hw_ptr in dump() callback
* pcm_hw plugin: preserve monotonic flag also after
snd_pcm_hw_params() call
- update alsa-info.sh
* Mon Mar 23 2009 tiwai@suse.de
- fix a typo in joystick init script (bnc#480714)
- add route_policy copy to mono capture hd-audio config
@ -1011,9 +1018,9 @@ exit 0
- updated to version 0.9.4.
- fixed the option of head command in alsa-scripts (bug #27413).
- updated alsaconf; -p shows the card name, too.
* Thu Jun 12 2003 ro@suse.de
* Fri Jun 13 2003 ro@suse.de
- added /etc/hotplug and /etc/hotplug/usb to filelist
* Mon May 26 2003 ro@suse.de
* Tue May 27 2003 ro@suse.de
- add static libaoss to filelist of devel subpackage
* Tue Apr 15 2003 tiwai@suse.de
- fixed the option of head command in the new POSIX way.
@ -2217,7 +2224,7 @@ exit 0
- linux/* header files installed under /usr/include/alsa/linux
- added SuSEconfig.alsa
- added triggers
* Thu Jun 08 2000 bk@suse.de
* Fri Jun 09 2000 bk@suse.de
- fixed kernel_version define -> %%(uname -r)
- changed linux_header_dir to /usr/src/linux/include/linux
(should fit with the pre-install then)
@ -2273,7 +2280,7 @@ exit 0
- updated to alsa-0.5.6, cvsexport 2000-03-17.tar.bz2
* Tue Mar 14 2000 bk@suse.de
- disabled kernel headers in the file list
* Sat Mar 11 2000 bk@suse.de
* Sun Mar 12 2000 bk@suse.de
- added isapnp to Requires:
* Thu Mar 09 2000 ro@suse.de
- removed k_deflt from neededforbuild (endless rebuild-loop)
@ -2283,7 +2290,7 @@ exit 0
- added gamix from http://www1.tcnet.ne.jp/fmurata/linux/down/
- alsa modules are no longer built here.
- wrote listcards.sh and added generated /usr/doc/packages/alsa/cards.txt
* Sun Mar 05 2000 ro@suse.de
* Mon Mar 06 2000 ro@suse.de
- added Makefile.module and subpackage km_alsa to build the
kernel-modules
* Sat Mar 04 2000 bk@suse.de
@ -2387,7 +2394,7 @@ exit 0
* Mon Oct 11 1999 ro@suse.de
- patched to compile wavefront.c on axp
- simplified specfile
* Mon Sep 20 1999 ro@suse.de
* Tue Sep 21 1999 ro@suse.de
- fixed filelist
* Sat Sep 18 1999 bk@suse.de
- major update to version 0.4.1b, many changes
@ -2397,7 +2404,7 @@ exit 0
- set kernel-version to 2.2.12
* Tue Jul 20 1999 bk@suse.de
- added libtoolize --force to use ltconfig and ltmain from libtool
* Fri Jul 16 1999 ro@suse.de
* Sat Jul 17 1999 ro@suse.de
- set kernel version to 2.2.10
* Fri Jul 16 1999 ro@suse.de
- fixed filelist