This commit is contained in:
parent
4da4c4e3fe
commit
4cb01c174b
105
alsa-info.sh
105
alsa-info.sh
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT_VERSION=0.4.48
|
||||
SCRIPT_VERSION=0.4.51
|
||||
CHANGELOG="http://www.alsa-project.org/alsa-info.sh.changelog"
|
||||
|
||||
#################################################################################
|
||||
@ -33,7 +33,11 @@ PASTEBINKEY="C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc"
|
||||
#Define some simple functions
|
||||
|
||||
pbcheck(){
|
||||
[[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" NOUPLOAD="yes" PBERROR="yes"
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
[[ $(ping -c1 www.alsa-project.org) ]] || KEEP_FILES="yes" NOUPLOAD="yes" PBERROR="yes"
|
||||
else
|
||||
[[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" NOUPLOAD="yes" PBERROR="yes"
|
||||
fi
|
||||
}
|
||||
|
||||
update() {
|
||||
@ -69,12 +73,6 @@ cleanup() {
|
||||
}
|
||||
|
||||
|
||||
#### FIX ME
|
||||
withsecure() {
|
||||
POST_URL="http://alsa-info.pastebin.ca"
|
||||
}
|
||||
###########
|
||||
|
||||
withaplay() {
|
||||
echo "!!Aplay/Arecord output" >> $FILE
|
||||
echo "!!------------" >> $FILE
|
||||
@ -106,6 +104,7 @@ withamixer() {
|
||||
CARD_NAME=`grep "^ *$i " /tmp/alsainfo/alsacards.tmp|awk {'print $2'}`
|
||||
echo "!!-------Mixer controls for card $i $CARD_NAME]" >> $FILE
|
||||
echo "" >>$FILE
|
||||
amixer -c$i info>> $FILE 2>&1
|
||||
amixer -c$i>> $FILE 2>&1
|
||||
echo "" >> $FILE
|
||||
done
|
||||
@ -192,6 +191,8 @@ SYSFS=$(mount |grep sysfs|awk {'print $3'});
|
||||
#Check modprobe config files for sound related options
|
||||
SNDOPTIONS=$(modprobe -c|sed -n 's/^options \(snd[-_][^ ]*\)/\1:/p')
|
||||
|
||||
PASTEBIN=""
|
||||
WWWSERVICE="www.alsa-project.org"
|
||||
QUESTION="yes"
|
||||
PROCEED="yes"
|
||||
REPEAT=""
|
||||
@ -205,6 +206,10 @@ case "$1" in
|
||||
--no-upload)
|
||||
NOUPLOAD="yes"
|
||||
;;
|
||||
--pastebin)
|
||||
PASTEBIN="yes"
|
||||
WWWSERVICE="pastebin"
|
||||
;;
|
||||
--no-dialog)
|
||||
DIALOG=""
|
||||
REPEAT=""
|
||||
@ -219,7 +224,7 @@ if [ "$QUESTION" = "yes" ]; then
|
||||
if [[ -n "$DIALOG" ]]
|
||||
then
|
||||
if [ -z "$NOUPLOAD" ]; then
|
||||
dialog --backtitle "$BGTITLE" --title "ALSA-Info script v $SCRIPT_VERSION" --yesno "\nThis script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem\n\nBy default, this script will AUTOMATICALLY UPLOAD your information to a pastebin site.\n\nSee $0 --help for options\n\nDo you want to run this script?" 0 0
|
||||
dialog --backtitle "$BGTITLE" --title "ALSA-Info script v $SCRIPT_VERSION" --yesno "\nThis script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem\n\nBy default, this script will AUTOMATICALLY UPLOAD your information to a $WWWSERVICE site.\n\nSee $0 --help for options\n\nDo you want to run this script?" 0 0
|
||||
else
|
||||
dialog --backtitle "$BGTITLE" --title "ALSA-Info script v $SCRIPT_VERSION" --yesno "\nThis script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem\n\nSee $0 --help for options\n\nDo you want to run this script?" 0 0
|
||||
fi
|
||||
@ -238,11 +243,11 @@ echo ""
|
||||
if [ -z "$NOUPLOAD" ]; then
|
||||
if [[ -n "$TPUT" ]]; then
|
||||
tput bold
|
||||
echo "By default, the collected information will be AUTOMATICALLY uploaded to a pastebin site."
|
||||
echo "By default, the collected information will be AUTOMATICALLY uploaded to a $WWWSERVICE site."
|
||||
echo "If you do not wish for this to occur, run the script with the --no-upload argument"
|
||||
tput sgr0
|
||||
else
|
||||
echo "By default, the collected information will be AUTOMATICALLY uploaded to a pastebin site."
|
||||
echo "By default, the collected information will be AUTOMATICALLY uploaded to a $WWWSERVICE site."
|
||||
echo "If you do not wish for this to occur, run the script with the --no-upload argument"
|
||||
fi
|
||||
echo ""
|
||||
@ -297,7 +302,11 @@ cat /proc/asound/card*/codec97\#0/ac97\#0-0 > /tmp/alsainfo/alsa-ac97.tmp 2> /de
|
||||
cat /proc/asound/card*/codec97\#0/ac97\#0-0+regs > /tmp/alsainfo/alsa-ac97-regs.tmp 2> /dev/null
|
||||
|
||||
#Fetch the info, and put it in $FILE in a nice readable format.
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
echo "upload=true&script=true&cardinfo=" > $FILE
|
||||
else
|
||||
echo "name=$USER&type=33&description=/tmp/alsa-info.txt&expiry=&s=Submit+Post&content=" > $FILE
|
||||
fi
|
||||
echo "!!################################" >> $FILE
|
||||
echo "!!ALSA Information Script v $SCRIPT_VERSION" >> $FILE
|
||||
echo "!!################################" >> $FILE
|
||||
@ -364,7 +373,7 @@ echo "" >> $FILE
|
||||
echo "" >> $FILE
|
||||
fi
|
||||
|
||||
if [ -d $SYSFS ]
|
||||
if [ -d "$SYSFS" ]
|
||||
then
|
||||
echo "!!Loaded sound module options" >> $FILE
|
||||
echo "!!--------------------------" >> $FILE
|
||||
@ -425,6 +434,16 @@ then
|
||||
until [ -z "$1" ]
|
||||
do
|
||||
case "$1" in
|
||||
--pastebin)
|
||||
update
|
||||
withdevices
|
||||
withconfigs
|
||||
withaplay
|
||||
withamixer
|
||||
withalsactl
|
||||
withlsmod
|
||||
pbcheck
|
||||
;;
|
||||
--update)
|
||||
update
|
||||
exit
|
||||
@ -510,18 +529,23 @@ then
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "alsa-info.sh version $SCRIPT_VERSION"
|
||||
echo ""
|
||||
echo "Available options:"
|
||||
echo " --with-aplay (includes the output of aplay -l)"
|
||||
echo " --with-amixer (includes the output of amixer)"
|
||||
echo " --with-alsactl (includes the output of alsactl)"
|
||||
echo " --with-configs (includes the output of ~/.asoundrc and /etc/asound.conf if they exist)"
|
||||
echo " --with-configs (includes the output of ~/.asoundrc and"
|
||||
echo " /etc/asound.conf if they exist)"
|
||||
echo " --with-devices (shows the device nodes in /dev/snd/)"
|
||||
echo ""
|
||||
echo " --update (check server for script updates)"
|
||||
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 " --about (show some information about the script)"
|
||||
echo " --debug (will run the script as normal, but will not delete $FILE)"
|
||||
echo " --debug (will run the script as normal, but will not"
|
||||
echo " delete $FILE)"
|
||||
cleanup
|
||||
exit 0
|
||||
;;
|
||||
@ -539,6 +563,14 @@ then
|
||||
if [[ -n "$DIALOG" ]]
|
||||
then
|
||||
if [[ -z $NOUPLOAD ]]; then
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt "http://www.alsa-project.org/cardinfo-db/" &>/tmp/alsainfo/wget.tmp || echo "Upload failed; exit"
|
||||
{ for i in 10 20 30 40 50 60 70 80 90; do
|
||||
echo $i
|
||||
sleep 0.2
|
||||
done
|
||||
echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to www.alsa-project.org ..." 6 70 0
|
||||
else
|
||||
wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt "http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY&encrypt=t&encryptpw=blahblah" &>/tmp/alsainfo/wget.tmp || echo "Upload failed; exit"
|
||||
{ for i in 10 20 30 40 50 60 70 80 90; do
|
||||
echo $i
|
||||
@ -546,12 +578,18 @@ then
|
||||
done
|
||||
echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to www.pastebin.ca ..." 6 70 0
|
||||
fi
|
||||
fi
|
||||
else
|
||||
|
||||
if [[ -z $NOUPLOAD ]]; then
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
echo -n "Uploading information to www.alsa-project.org ... "
|
||||
wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt http://www.alsa-project.org/cardinfo-db/ &>/tmp/alsainfo/wget.tmp &
|
||||
else
|
||||
echo -n "Uploading information to www.pastebin.ca ... "
|
||||
wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY &>/tmp/alsainfo/wget.tmp &
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
#Progess spinner for wget transfer.
|
||||
if [[ -z "$DIALOG" ]]
|
||||
@ -569,9 +607,17 @@ fi
|
||||
if [[ -z $NOUPLOAD ]]; then
|
||||
if [[ -n "$TPUT" ]]
|
||||
then
|
||||
FINAL_URL=`tput setaf 1; grep "SUCCESS:" /tmp/alsainfo/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p';tput sgr0`
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
FINAL_URL=`tput setaf 1; grep "SUCCESS:" /tmp/alsainfo/wget.tmp | cut -d ' ' -f 2 ; tput sgr0`
|
||||
else
|
||||
FINAL_URL=`tput setaf 1; grep "SUCCESS:" /tmp/alsainfo/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p';tput sgr0`
|
||||
fi
|
||||
else
|
||||
FINAL_URL=`grep "SUCCESS:" /tmp/alsainfo/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p'`
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
FINAL_URL=`grep "SUCCESS:" /tmp/alsainfo/wget.tmp | cut -d ' ' -f 2`
|
||||
else
|
||||
FINAL_URL=`grep "SUCCESS:" /tmp/alsainfo/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p'`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
#Output the URL of the uploaded file.
|
||||
@ -589,9 +635,9 @@ if [[ -n $DIALOG ]]
|
||||
then
|
||||
if [[ -n $NOUPLOAD ]]; then
|
||||
if [[ -n $PBERROR ]]; then
|
||||
dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occured while contacting the pastebin. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $FILE" 10 100
|
||||
dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $FILE" 10 100
|
||||
else
|
||||
dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the pastebin\n\nYour ALSA information can be seen by looking in $FILE" 10 100
|
||||
dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the $WWWSERVICE\n\nYour ALSA information can be seen by looking in $FILE" 10 100
|
||||
fi
|
||||
else
|
||||
dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100
|
||||
@ -605,12 +651,12 @@ fi
|
||||
clear
|
||||
if [[ -n $NOUPLOAD ]]; then
|
||||
if [[ -n $PBERROR ]]; then
|
||||
echo "An error occured while contacting the pastebin. Your information was NOT automatically uploaded."
|
||||
echo "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded."
|
||||
echo ""
|
||||
echo "Your ALSA information can be seen by looking in $FILE"
|
||||
echo ""
|
||||
else
|
||||
echo "You requested that your information was NOT automatically uploaded to the pastebin"
|
||||
echo "You requested that your information was NOT automatically uploaded to the $WWWSERVICE"
|
||||
echo ""
|
||||
echo "Your ALSA information can be seen by looking in $FILE"
|
||||
echo ""
|
||||
@ -621,7 +667,7 @@ echo "Your ALSA information is located at $FINAL_URL"
|
||||
echo "Please inform the person helping you."
|
||||
echo ""
|
||||
fi
|
||||
#We posted the file to pastebin.ca , so we dont need it anymore. delete it.
|
||||
#We posted the file , so we dont need it anymore. delete it.
|
||||
if [ -z $KEEP_FILES ]
|
||||
then
|
||||
rm $FILE
|
||||
@ -631,6 +677,16 @@ fi
|
||||
else
|
||||
if [[ -z $DIALOG ]]
|
||||
then
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
echo ""
|
||||
echo "Could not automatically upload output to http://www.alsa-project.org"
|
||||
echo "Possible reasons are:"
|
||||
echo " 1. Couldnt find 'wget' in your PATH"
|
||||
echo " 2. Your version of wget is less than 1.8.2"
|
||||
echo ""
|
||||
echo "Please manually upload $FILE to http://www.alsa-project.org/cardinfo-db/ and submit your post."
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
echo "Could not automatically upload output to http://www.pastebin.ca"
|
||||
echo "Possible reasons are:"
|
||||
@ -639,10 +695,15 @@ else
|
||||
echo ""
|
||||
echo "Please manually upload $FILE to http://www.pastebin.ca/upload.php and submit your post."
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
if [[ -n $DIALOG ]]
|
||||
then
|
||||
dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.pastebin.ca.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $FILE to http://www.pastebin.ca/upload.php and submit your post." 25 100
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.alsa-project.org.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $FILE to http://www.alsa-project,org/cardinfo-db/ and submit your post." 25 100
|
||||
else
|
||||
dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.pastebin.ca.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $FILE to http://www.pastebin.ca/upload.php and submit your post." 25 100
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
#Clean up the temp files
|
||||
|
3
alsa-lib-1.0.18.tar.bz2
Normal file
3
alsa-lib-1.0.18.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c487645d32b8124b9ae224b8929e5aa45e581bd8d8c8da666add423cf927d1ea
|
||||
size 790052
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:74401a7aa2450bcd6a819d8fae852a4d228116e3743f7ccd1846edb67d940b32
|
||||
size 789596
|
@ -1,266 +0,0 @@
|
||||
diff --git a/include/pcm.h b/include/pcm.h
|
||||
index e655aa6..15e9cb2 100644
|
||||
--- a/include/pcm.h
|
||||
+++ b/include/pcm.h
|
||||
@@ -440,7 +440,9 @@ int snd_pcm_hwsync(snd_pcm_t *pcm);
|
||||
int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
|
||||
int snd_pcm_resume(snd_pcm_t *pcm);
|
||||
int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp);
|
||||
+snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t *pcm);
|
||||
snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
|
||||
+int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp);
|
||||
snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm);
|
||||
snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
|
||||
snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm);
|
||||
@@ -454,6 +456,8 @@ int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
|
||||
int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
|
||||
int snd_pcm_unlink(snd_pcm_t *pcm);
|
||||
|
||||
+//int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem);
|
||||
+
|
||||
/*
|
||||
* application helpers - these functions are implemented on top
|
||||
* of the basic API
|
||||
diff --git a/include/sound/asound.h b/include/sound/asound.h
|
||||
index e5fbea4..977b2d6 100644
|
||||
--- a/include/sound/asound.h
|
||||
+++ b/include/sound/asound.h
|
||||
@@ -725,7 +725,7 @@ struct sndrv_timer_tread {
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
-#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)
|
||||
+#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
|
||||
|
||||
struct sndrv_ctl_card_info {
|
||||
int card; /* card number */
|
||||
@@ -736,8 +736,7 @@ struct sndrv_ctl_card_info {
|
||||
unsigned char longname[80]; /* name + info text about soundcard */
|
||||
unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */
|
||||
unsigned char mixername[80]; /* visual mixer identification */
|
||||
- unsigned char components[80]; /* card components / fine identification, delimited with one space (AC97 etc..) */
|
||||
- unsigned char reserved[48]; /* reserved for future */
|
||||
+ unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */
|
||||
};
|
||||
|
||||
enum sndrv_ctl_elem_type {
|
||||
diff --git a/src/conf/cards/PS3.conf b/src/conf/cards/PS3.conf
|
||||
index b7e30ff..b642f0d 100644
|
||||
--- a/src/conf/cards/PS3.conf
|
||||
+++ b/src/conf/cards/PS3.conf
|
||||
@@ -44,3 +44,42 @@ PS3.pcm.default {
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+<confdir:pcm/iec958.conf>
|
||||
+
|
||||
+PS3.pcm.iec958.0 {
|
||||
+ @args [ CARD AES0 AES1 AES2 AES3 ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ @args.AES0 {
|
||||
+ type integer
|
||||
+ }
|
||||
+ @args.AES1 {
|
||||
+ type integer
|
||||
+ }
|
||||
+ @args.AES2 {
|
||||
+ type integer
|
||||
+ }
|
||||
+ @args.AES3 {
|
||||
+ type integer
|
||||
+ }
|
||||
+ type hooks
|
||||
+ slave.pcm {
|
||||
+ type hw
|
||||
+ card $CARD
|
||||
+ }
|
||||
+ hooks.0 {
|
||||
+ type ctl_elems
|
||||
+ hook_args [
|
||||
+ {
|
||||
+ interface PCM
|
||||
+ name "IEC958 Playback Default"
|
||||
+ lock true
|
||||
+ preserve true
|
||||
+ optional true
|
||||
+ value [ $AES0 $AES1 $AES2 $AES3 ]
|
||||
+ }
|
||||
+ ]
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/control/control_hw.c b/src/control/control_hw.c
|
||||
index 7180ead..aeb2c23 100644
|
||||
--- a/src/control/control_hw.c
|
||||
+++ b/src/control/control_hw.c
|
||||
@@ -116,7 +116,7 @@ static int snd_ctl_hw_subscribe_events(snd_ctl_t *handle, int subscribe)
|
||||
SYSERR("SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS failed");
|
||||
return -errno;
|
||||
}
|
||||
- return subscribe;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static int snd_ctl_hw_card_info(snd_ctl_t *handle, snd_ctl_card_info_t *info)
|
||||
@@ -324,7 +324,11 @@ static int snd_ctl_hw_read(snd_ctl_t *handle, snd_ctl_event_t *event)
|
||||
ssize_t res = read(hw->fd, event, sizeof(*event));
|
||||
if (res <= 0)
|
||||
return -errno;
|
||||
- assert(res == sizeof(*event));
|
||||
+ if (CHECK_SANITY(res != sizeof(*event))) {
|
||||
+ SNDMSG("snd_ctl_hw_read: read size error (req:%d, got:%d)\n",
|
||||
+ sizeof(*event), res);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -368,7 +372,10 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
|
||||
|
||||
*handle = NULL;
|
||||
|
||||
- assert(card >= 0 && card < 32);
|
||||
+ if (CHECK_SANITY(card < 0 || card >= 32)) {
|
||||
+ SNDMSG("Invalid card index %d", card);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
sprintf(filename, SNDRV_FILE_CONTROL, card);
|
||||
if (mode & SND_CTL_READONLY)
|
||||
fmode = O_RDONLY;
|
||||
diff --git a/src/control/namehint.c b/src/control/namehint.c
|
||||
index b526ad5..8bf739b 100644
|
||||
--- a/src/control/namehint.c
|
||||
+++ b/src/control/namehint.c
|
||||
@@ -84,10 +84,11 @@ static void zero_handler(const char *file ATTRIBUTE_UNUSED,
|
||||
{
|
||||
}
|
||||
|
||||
-static int get_dev_name1(struct hint_list *list, char **res)
|
||||
+static int get_dev_name1(struct hint_list *list, char **res, int device,
|
||||
+ int stream)
|
||||
{
|
||||
*res = NULL;
|
||||
- if (list->device < 0)
|
||||
+ if (device < 0)
|
||||
return 0;
|
||||
switch (list->iface) {
|
||||
#ifdef BUILD_HWDEP
|
||||
@@ -95,7 +96,7 @@ static int get_dev_name1(struct hint_list *list, char **res)
|
||||
{
|
||||
snd_hwdep_info_t *info;
|
||||
snd_hwdep_info_alloca(&info);
|
||||
- snd_hwdep_info_set_device(info, list->device);
|
||||
+ snd_hwdep_info_set_device(info, device);
|
||||
if (snd_ctl_hwdep_info(list->ctl, info) < 0)
|
||||
return 0;
|
||||
*res = strdup(snd_hwdep_info_get_name(info));
|
||||
@@ -107,8 +108,8 @@ static int get_dev_name1(struct hint_list *list, char **res)
|
||||
{
|
||||
snd_pcm_info_t *info;
|
||||
snd_pcm_info_alloca(&info);
|
||||
- snd_pcm_info_set_device(info, list->device);
|
||||
- snd_pcm_info_set_stream(info, list->stream ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK);
|
||||
+ snd_pcm_info_set_device(info, device);
|
||||
+ snd_pcm_info_set_stream(info, stream ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK);
|
||||
if (snd_ctl_pcm_info(list->ctl, info) < 0)
|
||||
return 0;
|
||||
switch (snd_pcm_info_get_class(info)) {
|
||||
@@ -127,8 +128,8 @@ static int get_dev_name1(struct hint_list *list, char **res)
|
||||
{
|
||||
snd_rawmidi_info_t *info;
|
||||
snd_rawmidi_info_alloca(&info);
|
||||
- snd_rawmidi_info_set_device(info, list->device);
|
||||
- snd_rawmidi_info_set_stream(info, list->stream ? SND_RAWMIDI_STREAM_INPUT : SND_RAWMIDI_STREAM_OUTPUT);
|
||||
+ snd_rawmidi_info_set_device(info, device);
|
||||
+ snd_rawmidi_info_set_stream(info, stream ? SND_RAWMIDI_STREAM_INPUT : SND_RAWMIDI_STREAM_OUTPUT);
|
||||
if (snd_ctl_rawmidi_info(list->ctl, info) < 0)
|
||||
return 0;
|
||||
*res = strdup(snd_rawmidi_info_get_name(info));
|
||||
@@ -143,14 +144,13 @@ static int get_dev_name1(struct hint_list *list, char **res)
|
||||
static char *get_dev_name(struct hint_list *list)
|
||||
{
|
||||
char *str1, *str2, *res;
|
||||
+ int device;
|
||||
|
||||
- list->device = list->device_input >= 0 ? list->device_input : list->device;
|
||||
- list->stream = 1;
|
||||
- if (get_dev_name1(list, &str1) < 0)
|
||||
+ device = list->device_input >= 0 ? list->device_input : list->device;
|
||||
+ if (get_dev_name1(list, &str1, device, 1) < 0)
|
||||
return NULL;
|
||||
- list->device = list->device_output >= 0 ? list->device_input : list->device;
|
||||
- list->stream = 0;
|
||||
- if (get_dev_name1(list, &str2) < 0) {
|
||||
+ device = list->device_output >= 0 ? list->device_output : list->device;
|
||||
+ if (get_dev_name1(list, &str2, device, 0) < 0) {
|
||||
if (str1)
|
||||
free(str1);
|
||||
return NULL;
|
||||
@@ -199,7 +199,7 @@ static char *get_dev_name(struct hint_list *list)
|
||||
}
|
||||
}
|
||||
/* if the specified device doesn't exist, skip this entry */
|
||||
- if (list->device_input >= 0 || list->device_output >= 0)
|
||||
+ if (list->device >= 0 || list->device_input >= 0 || list->device_output >= 0)
|
||||
return NULL;
|
||||
return strdup(list->cardname);
|
||||
}
|
||||
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
|
||||
index a0cc2e0..59e433f 100644
|
||||
--- a/src/pcm/pcm.c
|
||||
+++ b/src/pcm/pcm.c
|
||||
@@ -1279,7 +1279,7 @@ snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t
|
||||
* \brief Read interleaved frames from a PCM
|
||||
* \param pcm PCM handle
|
||||
* \param buffer frames containing buffer
|
||||
- * \param size frames to be written
|
||||
+ * \param size frames to be read
|
||||
* \return a positive number of frames actually read otherwise a
|
||||
* negative error code
|
||||
* \retval -EBADFD PCM is not in the right state (#SND_PCM_STATE_PREPARED or #SND_PCM_STATE_RUNNING)
|
||||
@@ -1311,7 +1311,7 @@ snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t
|
||||
* \brief Read non interleaved frames to a PCM
|
||||
* \param pcm PCM handle
|
||||
* \param bufs frames containing buffers (one for each channel)
|
||||
- * \param size frames to be written
|
||||
+ * \param size frames to be read
|
||||
* \return a positive number of frames actually read otherwise a
|
||||
* negative error code
|
||||
* \retval -EBADFD PCM is not in the right state (#SND_PCM_STATE_PREPARED or #SND_PCM_STATE_RUNNING)
|
||||
diff --git a/test/pcm.c b/test/pcm.c
|
||||
index ecd0afa..ee27422 100644
|
||||
--- a/test/pcm.c
|
||||
+++ b/test/pcm.c
|
||||
@@ -385,11 +385,11 @@ static void async_callback(snd_async_handler_t *ahandler)
|
||||
generate_sine(areas, 0, period_size, &data->phase);
|
||||
err = snd_pcm_writei(handle, samples, period_size);
|
||||
if (err < 0) {
|
||||
- printf("Initial write error: %s\n", snd_strerror(err));
|
||||
+ printf("Write error: %s\n", snd_strerror(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err != period_size) {
|
||||
- printf("Initial write error: written %i expected %li\n", err, period_size);
|
||||
+ printf("Write error: written %i expected %li\n", err, period_size);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
avail = snd_pcm_avail_update(handle);
|
||||
@@ -424,10 +424,12 @@ static int async_loop(snd_pcm_t *handle,
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
- err = snd_pcm_start(handle);
|
||||
- if (err < 0) {
|
||||
- printf("Start error: %s\n", snd_strerror(err));
|
||||
- exit(EXIT_FAILURE);
|
||||
+ if (snd_pcm_state(handle) == SND_PCM_STATE_PREPARED) {
|
||||
+ err = snd_pcm_start(handle);
|
||||
+ if (err < 0) {
|
||||
+ printf("Start error: %s\n", snd_strerror(err));
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ }
|
||||
}
|
||||
|
||||
/* because all other work is done in the signal handler,
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 29 14:26:06 CET 2008 - tiwai@suse.de
|
||||
|
||||
- updated to alsa-lib version 1.0.18-final
|
||||
just including all previous fixes
|
||||
- updated alsa-info.sh script taken from the upstream
|
||||
- use -g option to alsactl to shut off "no card" error messages
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 23 16:27:36 CEST 2008 - tiwai@suse.de
|
||||
|
||||
|
19
alsa.spec
19
alsa.spec
@ -20,7 +20,7 @@
|
||||
|
||||
Name: alsa
|
||||
BuildRequires: doxygen
|
||||
%define package_version 1.0.18rc3
|
||||
%define package_version 1.0.18
|
||||
License: GPL v2 or later
|
||||
Group: System/Libraries
|
||||
Requires: alsa-utils
|
||||
@ -29,7 +29,7 @@ PreReq: %insserv_prereq %fillup_prereq
|
||||
AutoReqProv: on
|
||||
Summary: Advanced Linux Sound Architecture
|
||||
Version: 1.0.18
|
||||
Release: 5
|
||||
Release: 6
|
||||
Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2
|
||||
Source8: 40-alsa.rules
|
||||
Source11: alsasound
|
||||
@ -45,7 +45,7 @@ Source31: all_notes_off.bin
|
||||
Source32: all_notes_off.mid
|
||||
Source33: alsa-info.sh
|
||||
Source34: alsa-init.sh
|
||||
Patch: alsa-lib-git-fixes.diff
|
||||
# Patch: alsa-lib-git-fixes.diff
|
||||
Url: http://www.alsa-project.org/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
@ -117,7 +117,7 @@ Authors:
|
||||
|
||||
%prep
|
||||
%setup -q -n alsa-lib-%{package_version}
|
||||
%patch -p1
|
||||
# %patch -p1
|
||||
|
||||
%build
|
||||
# build alsa-lib
|
||||
@ -239,6 +239,11 @@ exit 0
|
||||
%{_datadir}/alsa
|
||||
|
||||
%changelog
|
||||
* Wed Oct 29 2008 tiwai@suse.de
|
||||
- updated to alsa-lib version 1.0.18-final
|
||||
just including all previous fixes
|
||||
- updated alsa-info.sh script taken from the upstream
|
||||
- use -g option to alsactl to shut off "no card" error messages
|
||||
* Thu Oct 23 2008 tiwai@suse.de
|
||||
- add missing declarations of new API functions in pcm.h.
|
||||
- check /proc/modules instead of lsmod in alsasound script.
|
||||
@ -620,7 +625,7 @@ exit 0
|
||||
- fix the assert with float conversion (#149894).
|
||||
- fix full-duplex confliction with dmix/dsnoop plugin.
|
||||
- fix the default behavior of non-blocking open mode.
|
||||
* Thu Feb 09 2006 tiwai@suse.de
|
||||
* Wed Feb 08 2006 tiwai@suse.de
|
||||
- fixed small memory leaks in the alsa-lib parser.
|
||||
- fixed a typo in rawmidi_virt plugin.
|
||||
* Mon Jan 30 2006 tiwai@suse.de
|
||||
@ -2235,7 +2240,7 @@ exit 0
|
||||
- fixed up /usr/src/kernel-modules/alsa-driver source dir.
|
||||
* Thu Feb 24 2000 bk@suse.de
|
||||
- added alsa-driver source tree in /usr/src/kernel-modules/alsa-driver
|
||||
* Sat Feb 19 2000 bk@suse.de
|
||||
* Fri Feb 18 2000 bk@suse.de
|
||||
- ALSA 0.5 is back! Version 0.5.3 (cvsexport 2000-02-19)
|
||||
- alsa config will be done through the yast2 module, or thorugh
|
||||
a termplat in the default modules.conf, which will be simple
|
||||
@ -2264,7 +2269,7 @@ exit 0
|
||||
- fixed wavefront.c for PPC
|
||||
* Wed Jan 05 2000 pthomas@suse.de
|
||||
- fixed spec file to include the OSS emulation modules in file list
|
||||
* Wed Jan 05 2000 bk@suse.de
|
||||
* Tue Jan 04 2000 bk@suse.de
|
||||
- another fix related to the previous alsaconf fixes.
|
||||
* Tue Jan 04 2000 bk@suse.de
|
||||
- updated alsa-driver to alsa-driver-0.4.1i
|
||||
|
Loading…
x
Reference in New Issue
Block a user