Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts about ALSA.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/alsa.e>
#           or at <http://angg.twu.net/e/alsa.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######






# «.multiple-cards»	(to "multiple-cards")
# «.snd-hda-intel»	(to "snd-hda-intel")
# «.snd-usb-audio»	(to "snd-usb-audio")
# «.multiple-cards-old»	(to "multiple-cards-old")
# «.alsamodules»	(to "alsamodules")
# «.unload-modules»	(to "unload-modules")
# «.alsaconf-cli»	(to "alsaconf-cli")
# «.pulseaudio»		(to "pulseaudio")
# «.alsaplayer»		(to "alsaplayer")
# «.alsa-utils»		(to "alsa-utils")
# «.default-device»	(to "default-device")
# «.asoundrc»		(to "asoundrc")
# «.aplay»		(to "aplay")
# «.mailing-lists»	(to "mailing-lists")
# «.email-2020feb29»	(to "email-2020feb29")
# «.midialsa»		(to "midialsa")
# «.libasound2»		(to "libasound2")
# «.asound.state»	(to "asound.state")
# «.alsactl»		(to "alsactl")
# «.alsa-utils.sh»	(to "alsa-utils.sh")
# «.proc-asound»	(to "proc-asound")
# «.alsa-info.sh»	(to "alsa-info.sh")

See:
  (find-es "music")
  (find-es "sound")



# http://www.alsa-project.org/main/index.php/Matrix:Module-usb-audio




# (find-zsh "installeddebs | sort | grep alsa")
# (find-zsh "availabledebs | sort | grep alsa")
# (find-sh "pstree")
# (find-sh "ps ax")




#####
#
# Multiple cards (for using the HeadRoom BitHead as default)
# 2012jun13
#
#####

# «multiple-cards»  (to ".multiple-cards")
# http://www.google.com/search?q=alsa+multiple+cards
#             http://www.alsa-project.org/main/index.php/Asoundrc
# (find-w3m "$S/http/www.alsa-project.org/main/index.php/Asoundrc")

# (find-fline "/usr/share/alsa/alsa.conf")
# (find-angg ".asoundrc")
# (find-sh "aplay -l")

# http://wiki.debian.org/ALSA





#####
#
# snd-hda-intel
# 2009jun27
#
#####

# «snd-hda-intel»  (to ".snd-hda-intel")
# http://www.alsa-project.org/main/index.php/Matrix:Main
# http://www.alsa-project.org/main/index.php/Matrix:Vendor-Intel
# http://www.alsa-project.org/main/index.php/Matrix:Module-hda-intel
# alsaconf reports this:
#   hda-intel Intel Corporation 82801G (ICH7 Family) High Definition Audio Con

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo modinfo soundcore
sudo modprobe snd-hda-intel
sudo modprobe snd-pcm-oss
sudo modprobe snd-mixer-oss
sudo modprobe snd-seq-oss




#####
#
# snd-usb-audio
# 2009jun27
#
#####

# «snd-usb-audio»  (to ".snd-usb-audio")
# http://www.alsa-project.org/main/index.php/Matrix:Main
# http://www.alsa-project.org/main/index.php/Matrix:Module-usb-audio

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo modinfo soundcore
sudo modprobe snd-usb-audio
sudo modprobe snd-pcm-oss
sudo modprobe snd-mixer-oss
sudo modprobe snd-seq-oss
# (find-sh "cat /proc/modules | sort")
cat /proc/modules | sort | grep ^s
cat /proc/modules | sort

R
w alsaconf
exit




#####
#
# Multiple cards
# 2009jun27
#
#####

# «multiple-cards-old»  (to ".multiple-cards-old")
# http://alsa.opensrc.org/index.php/Main_Page
# http://alsa.opensrc.org/index.php/MultipleCards
# soundcard selection

aplay -l
asoundconf list
alsaplayer -o alsa -d UA25    some_k00!.ogg
alsaplayer -o alsa -d hw:0,0  some_k00!.ogg

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: UA25 [EDIROL UA-25], device 0: USB Audio [USB Audio]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: Audio [USB Audio], device 0: USB Audio [USB Audio]
 Subdevices: 1/1
 Subdevice #0: subdevice #0

In this example the audio devices are named "UA25" and "Audio".

[edit] Example commands and options for selecting sound cards:

Note options: -d device | device_alias -- Please see man aplay and man alsaplayer for an explanation
of the options.

  " These two commands play the ogg on card 0 -- the ens1371 card:

alsaplayer -o alsa -d UA25  some_k00!.ogg
alsaplayer -o alsa -d hw:0,0  some_k00!.ogg

# (find-fline "~/NICOTINE/panda/MEDICINE/")
cd ~/NICOTINE/panda/MEDICINE/
alsaplayer -o alsa -d hw:0,0  heads.mp3

# (find-status   "alsaplayer-text")
# (find-vldifile "alsaplayer-text.list")
# (find-udfile   "alsaplayer-text/")
# (find-status   "alsaplayer-common")
# (find-vldifile "alsaplayer-common.list")
# (find-udfile   "alsaplayer-common/")
# (find-man "1 alsamixer")






#####
#
# alsamodules
# 2009jun27
#
#####

# «alsamodules»  (to ".alsamodules")
# http://alsa.opensrc.org/index.php/AlsaModules
# Doesn't work

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/proc/")
# (find-fline "/proc/asound/version")

if [ -f /proc/asound/version ]; then
    cat /proc/asound/version
    echo
    cat /proc/asound/cards
    echo
else
    CNT=0
    VER=`uname -r`
    SND=`find /lib/modules/$VER/kernel/sound -type f -name "snd-*" | \
        sed s/\.o$// | sed 's/^\/.*\///' | sort`

    for i in $SND; do
        CNT=$((CNT+1))
        [ $CNT -eq 1 ] && A=$i ; [ $CNT -eq 2 ] && B=$i
        [ $CNT -eq 3 ] && C=$i ; [ $CNT -eq 4 ] && D=$i
        [ $CNT -eq 4 ] && printf "%-18s %-18s %-18s %-18s\n" \
            $A $B $C $D && CNT=0
    done
    echo
    cat /proc/pci | grep "Multimedia audio controller"
    echo
fi



#####
#
# Unloading all sound modules
# 2009jun27
#
#####

# «unload-modules»  (to ".unload-modules")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/usr/sbin/alsaconf" "# Try to unload all sound modules")
# (find-fline "/usr/share/linux-sound-base/")
# (find-fline "/usr/share/linux-sound-base/ALSA-module-list")
# (find-fline "/usr/share/linux-sound-base/OSS-module-list")
# (find-man "8 modprobe" "-r --remove")
# Try to unload all sound modules
for S in OSS ALSA ; do
	L="/usr/share/linux-sound-base/${S}-module-list"
	if [ -r "$L" ] ; then
		for M in $(sed -e 's/#.*//' -e '/^[[:space:]]*$/d' "$L") ; do
			[ "$M" ] && /sbin/modprobe -r "$M" >/dev/null 2>&1 || :
		done
	fi
done

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/usr/sbin/alsaconf" "# Try to unload all sound modules")
# (find-fline "/usr/share/linux-sound-base/")
# (find-fline "/usr/share/linux-sound-base/ALSA-module-list")
# (find-fline "/usr/share/linux-sound-base/OSS-module-list")
# (find-man "8 modprobe" "-r --remove")
# (find-man "8 modprobe" "-q --quiet")
sudo /sbin/modprobe -v -q -r $(cat /usr/share/linux-sound-base/{ALSA,OSS}-module-list)

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo modinfo soundcore
sudo modprobe snd-usb-audio
# sudo modprobe snd-hda-intel
sudo modprobe snd-pcm-oss
sudo modprobe snd-mixer-oss
sudo modprobe snd-seq-oss

p /home/music/horses/04._free_money.wav

# FATAL: Module snd_seq is in use.







#####
#
# Running parts of alsaconf interactively
# 2009jun27
#
#####

# «alsaconf-cli»  (to ".alsaconf-cli")
# (find-fline "/usr/sbin/alsaconf")
# (find-fline "/usr/sbin/alsaconf" "# Try to unload all sound modules")
# (find-fline "/usr/sbin/alsaconf" "Soundcard Selection")
# (find-fline "/usr/sbin/alsaconf" "probe_cards ()")
# (find-fline "/usr/sbin/alsaconf" "build_card_db ()")
# (find-fline "/sys/bus/pnp/")
# (find-fline "/proc/bus/pci/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo bash
rm -Rv /tmp/alsa/
mkdir  /tmp/alsa/
cd     /tmp/alsa/
cp -v  /usr/sbin/alsaconf .
# (find-fline "/usr/sbin/alsaconf" "# main part continued..")
head -n 1414 < alsaconf > alsaconf-functions

cd     /tmp/alsa/
source alsaconf-functions

# (find-fline "/usr/sbin/alsaconf" "build_card_db $CARDID_DB")
CARDID_DB=/tmp/alsa/card_db
build_card_db $CARDID_DB
ncards=`grep '^snd-.*\.o$' $CARDID_DB | wc -w`
# (find-fline "/tmp/alsa/card_db")

echo $ncards


# (find-fline "/usr/sbin/alsaconf" "# Try to unload all sound modules")






#####
#
# pulseaudio
# 2009jun27
#
#####

# «pulseaudio»  (to ".pulseaudio")
# (find-angg ".emacs" "pulseaudio")
# (find-es "sound" "pulseaudio")
# (find-fline "/etc/init.d/aumix")

# (find-status   "pulseaudio-utils")
# (find-vldifile "pulseaudio-utils.list")
# (find-udfile   "pulseaudio-utils/")
# (find-status   "padevchooser")
# (find-vldifile "padevchooser.list")
# (find-udfile   "padevchooser/")
pulseaudio-native
pulseaudio-simple
pulseaudio-cli
pulseaudio-http
esound

# (find-zsh "dmissing pulseaudio")
# (find-man "pulseaudio")
# (find-sh "pulseaudio -h")
# (find-sh "pulseaudio --dump-conf")
# (find-sh "pulseaudio --dump-modules")

# (find-man "pulseaudio-simple")
# (find-man "pulseaudio-cli")

# (find-zsh "grep-available -i pulseaudio")
http://www.pulseaudio.org/wiki/Daemon
http://www.pulseaudio.org/wiki/FirstSteps

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
pulseaudio -C
help
list-modules
list-sinks
list-sources
list-clients

# (find-man "1 paplay")
# (find-zsh "dmissing libsndfile")
libsndfile

apti libsndfile1-dev
# (find-status   "libsndfile1-dev")
# (find-vldifile "libsndfile1-dev.list")
# (find-udfile   "libsndfile1-dev/")
# (find-fline "/usr/share/doc/libsndfile1-dev/html/")
# (find-fline "/usr/share/doc/libsndfile1-dev/examples/")

# (find-sh "pulseaudio --dump-modules")

http://www.pulseaudio.org/wiki/FAQ
http://www.pulseaudio.org/wiki/PerfectSetup

# (find-fline "/etc/pulse/")
# (find-fline "/etc/pulse/default.pa")
# (find-man "5 pulse-daemon.conf")

# (find-sh "dmesg")
# (find-sh "lsusb")

08bb:2900 Texas Instruments Japan PCM2900 Audio Codec
http://ubuntuforums.org/showthread.php?p=7482328
http://ubuntuforums.org/showthread.php?t=1130384

# (find-fline  "/proc/")
# (find-fline  "/proc/modules")
# (find-sh "cat /proc/modules | sort")

asoundconf set-default-card NameOfCard

http://alsa.opensrc.org/index.php/How_to_use_softvol_to_control_the_master_volume




# (find-fline "~/.asoundrc")

asoundconf
asoundconf list
aplay track02.cdda.wav
asoundconf set-default-card default
aplay track02.cdda.wav
asoundconf set-default-card usb
aplay track02.cdda.wav
asoundconf set-default-card hw:1,0
aplay track02.cdda.wav
asoundconf set-default-card Intel
aplay track02.cdda.wav
asoundconf list
asoundconf set-default-card default
aplay track02.cdda.wav

# (find-man "1 asoundconf")

# (find-efunction 'eepitch-shell)


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
asoundconf is-active
asoundconf get|delete PARAMETER
asoundconf set PARAMETER VALUE
asoundconf list
asoundconf set-default-card CARD
asoundconf reset-default-card

aplay
aplay -h
# (find-sh "aplay -h")
# (find-sh "aplay -l")
# (find-sh "aplay -L")
# (find-sh "aplay -L" "USB Audio CODEC")


# (find-man "asound")
# (find-fline "~/.asoundrc")
# (find-fline "~/.asoundrc.asoundconf")

# (find-zsh "dmissing asound")
# (find-fline "/usr/share/alsa/")
# (find-fline "/usr/share/alsa/cards/")
# (find-fline "/usr/share/alsa/cards/USB-Audio.conf")
# (find-man "alsa.conf")

libasound2-doc


http://alsa.opensrc.org/index.php/AlsaModules

#pulseaudio

<edrx> hello - I am a newbie to pulseaudio - and btw I'm mostly a
       CLI/Emacs person, and my knowledge (and use) of the sound
       devices is quite basic... and I have a newbie question, here
       it goes: I just got an external phone amplifier that was
       supposed to be automatically recognized as an external USB
       soundcard... lsusb lists it as "Bus 002 Device 003: ID
       08bb:2900 Texas Instruments Japan PCM2900 Audio Codec", but
       alsaconf do
<edrx> esn't list it as an option... any hints? also, is there a
       way to make pulseaudio ask alsa to use a specific soundcard?
       (I also have an on-board intel 82801G soundcard)...
<edrx> I'm learning to use the "pulseaudio -C" CLI, but it seems
       (?) to expect device names given as "/dev/..." for choosing
       sound sinks...
<edrx> so my question may be an alsa question 8-\
!!! irc.freenode.net: deleted (closed)


# (find-fline "/etc/init.d/alsa-utils")




#####
#
# alsaplayer
# 2009sep09
#
#####

# «alsaplayer»  (to ".alsaplayer")
# (find-man "1 alsaplayer")

# (find-status   "alsaplayer-common")
# (find-vldifile "alsaplayer-common.list")
# (find-udfile   "alsaplayer-common/")
# (find-status   "alsaplayer-text")
# (find-vldifile "alsaplayer-text.list")
# (find-udfile   "alsaplayer-text/")

http://alsa.opensrc.org/index.php/Alsaplayer
http://www.alsaplayer.org/
http://www.alsaplayer.org/features.php

# (find-zsh "availabledebs | sort | grep jack")

jack




#####
#
# alsa-utils
# 2020jan27
#
#####

# «alsa-utils» (to ".alsa-utils")
# (find-es "sound" "troubleshooting")
# (find-debpkg-links "alsa-utils")
# (find-status   "alsa-utils")
# (find-vldifile "alsa-utils.list")
# (find-udfile   "alsa-utils/")

# (find-apt-get-source-links "alsa-utils")
# (code-c-d "alsautils" "/tmp/d/alsa-utils-1.1.8/")
# (find-alsautilsfile "")
# (find-alsautilsfile "speaker-test/")
# (find-alsautilsfile "speaker-test/readme.txt")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-man "1 speaker-test")
speaker-test --help
speaker-test --test sine

# https://www.alsa-project.org/wiki/Main_Page
# https://www.alsa-project.org/wiki/SoundcardTesting
# https://www.alsa-project.org/wiki/Mailing-lists




#####
#
# Setting the default device
# 2020mar01
#
#####

# «default-device» (to ".default-device")
# https://www.alsa-project.org/wiki/SoundcardTesting ->
# https://www.alsa-project.org/wiki/Setting_the_default_device

cat /proc/asound/cards
cat /etc/asound.conf

and then create /etc/asound.conf with following:

   defaults.pcm.card 1
   defaults.ctl.card 1




#####
#
# asoundrc
# 2020feb23
#
#####

# «asoundrc» (to ".asoundrc")
# http://www.alsa-project.org/main/index.php/Asoundrc
# (find-fline "~/" ".asoundrc")
# (find-fline "~/.asoundrc")
# (find-fline "/usr/share/alsa/")
# (find-fline "/usr/share/alsa/alsa.conf" "~/.asoundrc")
# (find-fline "/usr/share/alsa/cards/")
# (find-fline "/usr/share/alsa/cards/USB-Audio.conf")




#####
#
# aplay
# 2020feb23
#
#####

# «aplay» (to ".aplay")
# (find-status   "alsa-utils")
# (find-vldifile "alsa-utils.list")
# (find-vldifile "alsa-utils.list" "bin/aplay")
# (find-udfile   "alsa-utils/")
# (find-man "1 aplay")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
aplay
aplay -h
# (find-sh "aplay -h")
# (find-sh "aplay -h" "-l, --list-devices")
# (find-sh "aplay -h" "-L, --list-pcms")
# (find-sh "aplay -l")
# (find-sh "aplay -L")





libasound2-doc





#####
#
# mailing-lists
# 2020feb23
#
#####

# «mailing-lists» (to ".mailing-lists")
# https://www.alsa-project.org/wiki/Mailing-lists
# https://mail.google.com/mail/ca/u/0/#inbox/FMfcgxwGDWqWqZZKkNZMJRlBmhZVxgzr
# https://www.mail-archive.com/alsa-user@lists.sourceforge.net/




#####
#
# My e-mail to the list: "No sound in one Debian 10 partition"
# 2020mar01
#
#####

# «email-2020feb29» (to ".email-2020feb29")
# (find-es "pulseaudio" "email-2020mar03")
# https://mail.google.com/mail/ca/u/0/#search/in%3Aanywhere/KtbxLxGrSnCqnbkcJWSbTqZCSdMtkprVrg
# https://www.mail-archive.com/alsa-user@lists.sourceforge.net/msg32698.html Edrx
# https://www.mail-archive.com/alsa-user@lists.sourceforge.net/msg32699.html Kaj

Hi list,

I have two Debian 10 partitions on my laptop - a venerable ThinkPad
T400 with libreboot - and in one of these partitions (in /dev/sda5,
a.k.a. the "bad partition") sound doesn't work, and in the other one
(/dev/sda4, a.k.a. the "good partition" from here on) it does...

The "bad partition" had Debian 9, and after I upgraded it to 10 with
"apt-get dist-upgrade" sound stopped working on it (details soon). I
then installed Debian 10 from a installation pen drive on an empty
partition to be able to test things on both; sound works on it
perfectly, so let's call it the "good partition".

I've tried several sound debugging recipes that I found on the
internets and they didn't work, so I've decided to use this as an
excuse to learn more about sound on Linux.

"Sound doesn't work" here means that all applications that play
sound - including speaker-test, that seems to be very low-level -
behave normally, but I can't hear anything - even when I use alsamixer
to set "Master", "Headphon", "Speaker", "PCM", "Beep" and "Internal"
all to the maximum level.

I tried to follow the instructions here,

  https://wiki.debian.org/Sound

and I sort of converted them - except for the step with pavucontrol;
more on it at the end of the e-mail - into a script... this one:


  logthis () { echo $*:; eval $* 2>&1; echo; echo; }
  {
    # Debian version
    logthis cat /etc/issue
    logthis cat /etc/debian_version
    logthis cat /etc/os-release
    logthis lsb_release -da
    logthis hostnamectl

    # List devices and PCMs
    logthis aplay -l
    logthis aplay -L

    # Drivers and modules
    logthis "lspci -vvv | grep -A8 Audio"
    logthis "lspci -knn | grep -A2 Audio"

    # Permissions
    logthis groups
    logthis ls -lAF /proc/asound/

    # This partition
    logthis "mount | grep 'on / '"

    # ALSA state
    logthis "rm -f /tmp/o; /usr/sbin/alsactl -f /tmp/o store; cat /tmp/o"

  } | tee ~/oalsa


I ran it in both partitions and compared the outputs with tkdiff.
Here are the relevant differences:

  1) In the bad partition the output of "aplay -l" is:

     **** List of PLAYBACK Hardware Devices ****
     card 0: Intel [HDA Intel], device 0: CX20561 Analog [CX20561 Analog]
       Subdevices: 0/1
       Subdevice #0: subdevice #0
     card 0: Intel [HDA Intel], device 1: CX20561 Digital [CX20561 Digital]
       Subdevices: 1/1
       Subdevice #0: subdevice #0

     and in the good partition it is:

     **** List of PLAYBACK Hardware Devices ****
     card 0: Intel [HDA Intel], device 0: CX20561 Analog [CX20561 Analog]
       Subdevices: 1/1
       Subdevice #0: subdevice #0
     card 0: Intel [HDA Intel], device 1: CX20561 Digital [CX20561 Digital]
       Subdevices: 1/1
       Subdevice #0: subdevice #0

     Note the "Subdevices: 0/1" in the bad partition.

  2) In the output of "/usr/sbin/alsactl -f /tmp/o store" some of
     fields "value.0", "value.1", "dbvalue.0", "dbvalue.1", are
     different between the two partitions, but they are all in the
     allowed ranges and they look reasonable to me (i.e., to my
     untrained eye).

  3) In the output of "/usr/sbin/alsactl -f /tmp/o store" the
     subsections of "state.Intel { ... }" appear in a different order.
     In the good partition the subsections 10-25 are numbered like
     this,

        control.10 : name 'Beep Playback Volume'
        control.11 : name 'Beep Playback Switch'
        control.12 : name 'IEC958 Playback Con Mask'
        control.13 : name 'IEC958 Playback Pro Mask'
        control.14 : name 'IEC958 Playback Default'
        control.15 : name 'IEC958 Playback Switch'
        control.16 : name 'IEC958 Default PCM Playback Switch'
        control.17 : name 'Master Playback Volume'
        control.18 : name 'Master Playback Switch'
        control.19 : name 'Mic Jack'
        control.20 : name 'Internal Mic Phantom Jack'
        control.21 : name 'Dock Mic Jack'
        control.22 : name 'Speaker Phantom Jack'
        control.23 : name 'Dock Headphone Jack'
        control.24 : name 'Headphone Jack'
        control.25 : name 'SPDIF Phantom Jack'

     and in the bad partition like this:

        control.10 : name 'IEC958 Playback Con Mask'
        control.11 : name 'IEC958 Playback Pro Mask'
        control.12 : name 'IEC958 Playback Default'
        control.13 : name 'IEC958 Playback Switch'
        control.14 : name 'IEC958 Default PCM Playback Switch'
        control.15 : name 'Master Playback Volume'
        control.16 : name 'Master Playback Switch'
        control.17 : name 'Mic Jack'
        control.18 : name 'Internal Mic Phantom Jack'
        control.19 : name 'Dock Mic Jack'
        control.20 : name 'Speaker Phantom Jack'
        control.21 : name 'Dock Headphone Jack'
        control.22 : name 'Headphone Jack'
        control.23 : name 'SPDIF Phantom Jack'
        control.24 : name 'Beep Playback Volume'
        control.25 : name 'Beep Playback Switch'

About pavucontrol: in the bad partition the only output device that
appears in the "Output Devices" tab is called "Dummy Output". This
looks like a red flag, but I got the impression - please confirm -
that PulseAudio runs on a level above ALSA, and problems with
PulseAudio should not affect the behavior of speaker-test.

So: any hints? What should I add to my script to compare the behavior
of ALSA in the two partitions? Am I wrong in thinking that
speaker-test ignores PulseAudio? How do I examine the status of
PulseAudio without using the GUI? Are there ways to mute and unmute
the sound using the functions in /usr/share/alsa/utils.sh? What
else?...

  Thanks in advance!
    Eduardo Ochs
    http://angg.twu.net/
    http://angg.twu.net/emacsconf2019.html
      (^ on "executable notes")





#####
#
# midialsa
# 2020feb23
#
#####

# «midialsa» (to ".midialsa")
# https://luarocks.org/modules/luarocks/midialsa
# https://pjb.com.au/comp/lua/midialsa.html
# https://alsa-project.org/alsa-doc/alsa-lib/seq.html




#####
#
# libasound2
# 2020feb23
#
#####

# «libasound2» (to ".libasound2")
# (find-fline "/usr/share/doc/libasound2/examples/asoundrc.txt.gz")
# (find-status   "libasound2")
# (find-vldifile "libasound2:amd64.list")
# (find-udfile   "libasound2/")
# (find-status   "libasound2-dev")
# (find-vldifile "libasound2-dev:amd64.list")
# (find-udfile   "libasound2-dev/")
# (find-status   "libasound2-doc")
# (find-vldifile "libasound2-doc.list")
# (find-udfile   "libasound2-doc/")
# (find-udfile   "libasound2-doc/")
# file:///usr/share/doc/libasound2/html/index.html

apti libasound2 libasound2-dev libasound2-doc





#####
#
# /var/lib/alsa/asound.state
# 2020feb23
#
#####

# «asound.state» (to ".asound.state")
# (find-sh "find      /etc/ | sort | grep -i alsa")
# (find-sh "find /sda4/etc/ | sort | grep -i alsa")
# (find-fline "/etc/rcS.d/" "S01alsa-utils")
# (find-fline "/etc/init.d/alsa-utils")
# (find-fline "/etc/init.d/alsa-utils" "restore_levels()")
# (find-fline "/etc/init.d/alsa-utils" "/var/lib/alsa/asound.state")
# (find-fline  "/var/lib/alsa/asound.state")
# (find-tkdiff "/var/lib/alsa/asound.state" "/sda4/var/lib/alsa/asound.state")

# (find-man "1 alsactl")
# (find-man "1 alsactl" "restore loads driver state")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/etc/init.d/alsa-utils")
R
bash
/etc/init.d/alsa-utils help
/etc/init.d/alsa-utils card_OK
/etc/init.d/alsa-utils stop
/etc/init.d/alsa-utils reset
. /etc/init.d/alsa-utils
. /etc/init.d/alsa-utils reset
. /etc/init.d/alsa-utils reset all



#####
#
# alsactl (called from /etc/init.d/alsa-utils to save and restore sound settings)
# 2020feb26
#
#####

# «alsactl» (to ".alsactl")
# (find-fline "/etc/init.d/alsa-utils")
# (find-fline "/etc/init.d/alsa-utils" ". /usr/share/alsa/utils.sh")
# (find-fline "/etc/init.d/alsa-utils" "alsactl -F")

# (find-initdfile "alsa-utils" "alsactl -F")
# (find-initdfile "alsa-utils" "alsactl" " store $CARD")
# (find-man "1 alsactl")
# (find-man "7 alsactl_init")
# (find-man "1 alsactl" "-f, --file")
# (find-man "1 alsactl" "-E, --env")
# (find-sh "locate alsactl")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
/usr/sbin/alsactl store

rm -fv /tmp/oac
/usr/sbin/alsactl -f /tmp/oac store

rm -f /tmp/oac; /usr/sbin/alsactl -f /tmp/oac store; cat /tmp/oac

# (find-fline "/tmp/oac")




#####
#
# /usr/share/alsa/utils.sh
# 2020feb26
#
#####

# «alsa-utils.sh» (to ".alsa-utils.sh")
# (find-fline "/usr/share/alsa/utils.sh")
# (find-fline "/usr/share/alsa/utils.sh" "echo_card_indices()")
# (find-fline "/usr/share/alsa/utils.sh" "echo_card_indices()" "/proc/asound/cards")
# (find-fline "/usr/share/alsa/utils.sh" "unmute_and_set_level()")
# (find-fline "/usr/share/alsa/utils.sh" "sanify_levels_on_card()")
# (find-fline "/usr/share/alsa/utils.sh" "sanify_levels()")

* (eepitch-bash)
* (eepitch-kill)
* (eepitch-bash)
sudo bash
. /usr/share/alsa/utils.sh
sanify_levels all



#####
#
# /proc/asound/
# 2020feb26
#
#####

# «proc-asound» (to ".proc-asound")
# (find-fline "/usr/share/alsa/utils.sh")
# (find-fline "/usr/share/alsa/utils.sh" "echo_card_indices()")
# (find-fline "/usr/share/alsa/utils.sh" "echo_card_indices()" "/proc/asound/cards")
# (find-fline "/proc/asound/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
ls -lAF /proc/asound/




#####
#
# alsa-info.sh
# 2020mar04
#
#####

# «alsa-info.sh» (to ".alsa-info.sh")
# https://www.alsa-project.org/alsa-info.sh
# (find-fline "$S/https/www.alsa-project.org/alsa-info.sh")
# https://www.mail-archive.com/alsa-user@lists.sourceforge.net/msg32702.html paul menzel

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
$S/https/www.alsa-project.org/alsa-info.sh --help
$S/https/www.alsa-project.org/alsa-info.sh --about
sudo $S/https/www.alsa-project.org/alsa-info.sh
# (find-fline "~/olsainfo-bad-partition")
# (find-fline "~/olsainfo-good-partition")

sudo $S/https/www.alsa-project.org/alsa-info.sh \
        --with-aplay   \
        --with-amixer  \
        --with-alsactl \
        --with-configs \
        --with-devices \
        --with-dmesg   \
        --output /tmp/oalsainfo

cp -v /tmp/oalsainfo ~/olsainfo
cp -v /tmp/oalsainfo ~/olsainfo-good-partition

# (find-audio "/sda1/home/music/panda/MEDICINE/all_good_things.mp3")
# (find-tkdiff "~/olsainfo" "/sda4/home/edrx/olsainfo")
# (find-tkdiff "~/olsainfo" "/sda5/home/edrx/olsainfo")

mount | grep ' on / '
mount | grep ' on / ' | cut -d ' ' -f 1

# (find-man "mount")



# (find-fline "/etc/alsa/conf.d/")




#  Local Variables:
#  coding:               utf-8-unix
#  End: