Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts on support for sound, sound ports and devices, etc
#
# 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/sound.e>
#           or at <http://angg.twu.net/e/sound.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/>.
#
#######





# «.audio-group»	(to "audio-group")
# «.alsaconf»		(to "alsaconf")
# «.arecord»		(to "arecord")
# «.pulseaudio»		(to "pulseaudio")
# «.jackd»		(to "jackd")
# «.sox»		(to "sox")
# «.alias-brownnoise»	(to "alias-brownnoise")
# «.mpd»		(to "mpd")
# «.troubleshooting»	(to "troubleshooting")

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





#####
#
# "a" is not in the audio group
# 2008nov08
#
#####

# «audio-group»  (to ".audio-group")
# (find-man "1 groups")
# (find-node "(coreutils)groups invocation")
# (find-man "5 group")
# (find-man "mpg123")
# (find-man "sudo")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
groups
sudo -u edrx ~/run-zsh
groups
cd ~/NICOTINE/FEELIES/Crazy_rhythms/
laf
p 01._the_boy_with_the_perpetual_nervou.mp3

w p
w p1
w myplay1
mpg321           01._the_boy_with_the_perpetual_nervou.mp3

mpg321 -o oss    01._the_boy_with_the_perpetual_nervou.mp3

mpg321 -o alsa   01._the_boy_with_the_perpetual_nervou.mp3

mpg321 -o alsa09 01._the_boy_with_the_perpetual_nervou.mp3

mpg321 -o esd    01._the_boy_with_the_perpetual_nervou.mp3

mpg321 -o arts   01._the_boy_with_the_perpetual_nervou.mp3





#####
#
# alsaconf
# 2008nov08
#
#####

# «alsaconf»  (to ".alsaconf")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# R
sudo alsaconf
sudo alsactl store

# (find-man "1 alsactl")
# (find-status   "linux-sound-base")
# (find-vldifile "linux-sound-base.list")
# (find-udfile   "linux-sound-base/")
# (find-udfile   "linux-sound-base/README.Debian")
# (find-status   "alsa-utils")
# (find-vldifile "alsa-utils.list")
# (find-udfile   "alsa-utils/")
# (find-status   "alsa-base")
# (find-vldifile "alsa-base.list")
# (find-udfile   "alsa-base/")

Playing MPEG stream from 01._the_boy_with_the_perpetual_nervou.mp3 ...
MPEG 1.0 layer III, 160 kbit/s, 44100 Hz stereo
Can't find a suitable libao driver. (Is device in use?)

# (find-sh "dmesg")

/home/edrx(root:de)# alsaconf
Unloading ALSA sound driver modules: snd-intel8x0 snd-intel8x0m snd-ac97-codec snd-ac97-bus snd-pcm snd-timer snd-page-alloc.
Building card database.

# (find-sh "locate alsaconf")
# (find-man "8 alsaconf")
# (find-fline "/usr/sbin/alsaconf")
# (find-fline "/usr/sbin/alsaconf" "cfgfile=\"/etc/modutils/sound\"")
# (find-fline "/usr/sbin/alsaconf" "Soundcard Selection")
# (find-fline "/usr/sbin/alsaconf" "devs_found[@]")
# (find-fline "/usr/sbin/alsaconf" "Configuring %s")
# (find-fline "/usr/sbin/alsaconf" "Building card database...")
# (find-fline "/usr/sbin/alsaconf" "OK, sound driver is configured.")
# (find-fline "/usr/sbin/alsaconf" "/etc/init.d/alsa")
# (find-fline "/etc/modutils/")
# (find-fline "/etc/modutils/sound")
# (find-fline "/etc/init.d/alsa")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo /etc/init.d/alsa reload

# (find-man "1 grep-available")
# (find-zsh "grep-available -F Section sound")
# (find-zsh "grep-available -F Section sound -s Package")
# (find-zsh "grep-available -F Section sound -s Package | cut -b10- | sort")
# (find-zsh "grep-status    -F Section sound -s Package | cut -b10- | sort")

# Building card database...
# Running update-modules...
# Loading driver...
# Setting default volumes...
#  Now ALSA is ready to use.
#  For adjustment of volumes, use your favorite mixer.

# (find-available "alsa-base")
# (find-available "alsa-firmware-loaders")
# (find-available "alsa-oss")
# (find-available "alsa-source")
# (find-available "alsa-tools")
# (find-available "alsa-tools-gui")
# (find-available "alsa-utils")
# (find-available "alsamixergui")
# (find-available "alsaplayer-alsa")
# (find-available "alsaplayer-common")
# (find-available "alsaplayer-daemon")
# (find-available "alsaplayer-esd")
# (find-available "alsaplayer-gtk")
# (find-available "alsaplayer-jack")
# (find-available "alsaplayer-nas")
# (find-available "alsaplayer-oss")
# (find-available "alsaplayer-text")
# (find-available "alsaplayer-xosd")


alsa-driver

http://ftp.debian.org/debian/pool/main/a/alsa-driver/alsa-driver_1.0.17.dfsg-4.dsc




#####
#
# arecord
# 2009nov03
#
#####

# «arecord»  (to ".arecord")
# (find-man "1 arecord" "arecord -d 10")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
arecord -d 10 -f cd -t wav -D copy foobar.wav
arecord -d 10 -f cd -t wav foobar.wav
arecord -d 4 -f cd -t wav /tmp/foobar.wav
p /tmp/foobar.wav

# (find-man "xterm")
xterm alsamixer


* (eexterm "mix")
alsamixer




#####
#
# pulseaudio
# 2020nov04
#
#####

# «pulseaudio»  (to ".pulseaudio")
# (find-es "pulseaudio")



#####
#
# jackd
# 2011may04
#
#####

# «jackd»  (to ".jackd")
# (find-zsh "installeddebs | sort | grep jackd")
# (find-zsh "availabledebs | sort | grep jackd")
# http://jackaudio.org/
# http://jackaudio.org/files/docs/html/index.html
# http://jackaudio.org/applications
# http://jackaudio.org/documentation
# http://jackaudio.org/device_naming
# http://jackaudio.org/pulseaudio_and_jack
# (find-fline "/proc/asound/cards")
# (find-man "1 qjackctl")
# (find-sh "ps ax" "jackd")
# (find-sh "ps ax" "/usr/bin/jackd -dalsa -dhw:0 -r44100 -p1024 -n2")
# (find-fline "~/.jackdrc")
# (find-man "1 jackd")
# (find-man "1 jackd" "-d, --driver" "alsa")
# (find-man "1 jackd" "-d, --device" "hw:0")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
killall jackd

jackd2-firewire_1.9.6~dfsg.1-2.deb
jackd2_1.9.6~dfsg.1-2.deb
jackd_5.deb
libjack-jackd2-0_1.9.6~dfsg.1-2.deb
libjack-jackd2-dev_1.9.6~dfsg.1-2.deb

# (find-status   "jackd")
# (find-status   "jackd2")
# (find-vldifile "jackd2.list")
# (find-udfile   "jackd2/")
# (find-status   "jack-tools")
# (find-vldifile "jack-tools.list")
# (find-udfile   "jack-tools/")
# (find-man "1 jack.clock")
# (find-man "1 jack.ctl")
# (find-man "1 jack.play")
# (find-man "1 jack.plumbing")
# (find-man "1 jack.scope")
# (find-man "1 jack.udp")





#####
#
# pulseaudio and sox
# 2011may12
#
#####

# «sox»  (to ".sox")
# (find-man "1 paplay")
# (find-man "1 pasuspender")
# (find-man "1 pabrowse")
# (find-man "1 pacmd")
# (find-man "1 pacat")
# (find-man "1 pax11publish")
# (find-man "1 pactl")
# (find-man "1 padsp")

# (find-man "parecord")
# (find-sh "parecord --help")
# (find-sh "parecord --list-file-formats")
# (find-sh "paplay --help")
# (find-sh "parec --help")
# (find-sh "parec --list-file-formats")
# (find-sh "pacat --help")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
parecord --format=wav
parec -r --format=wav /tmp/o.wav
parec -d 0 -r --format=wav /tmp/o.wav
parec -d 0 > /tmp/o.wav
parec -d 0 --format wav > /tmp/o0.wav
parec -d 1 --format wav > /tmp/o0.wav
parec -d 1 --format=u8 > /tmp/o0.wav
# (find-sh0 "parec -d 0 > /tmp/o0.wav")
# (find-sh0 "parec -d 1 > /tmp/o1.wav")
# (find-sh0 "parec -d 0 > /tmp/o0.wav")
# (find-sh0 "parec -d 1 > /tmp/o1.wav")
laf /tmp/
file /tmp/*.wav


/usr/bin/parec
/usr/bin/parecord
/usr/bin/paplay
/usr/bin/pamon


http://www.pulseaudio.org/wiki/FAQ#HowdoIrecordstuff
parec -d 1 --format=s16le --rate=44100 --channels=2 | sox --type raw -s2L --rate 44100 --channels 2 - --type wav /tmp/o1.wav


parec -d 0 --format=s16le --rate=44100 --channels=2 | sox --type raw -s2L --rate 44100 --channels 2 - --type wav /tmp/o0.wav
parec -d 1 --format=s16le --rate=44100 --channels=2 | sox --type raw -s2L --rate 44100 --channels 2 - --type wav /tmp/o1.wav
p /tmp/o0.wav
p /tmp/o1.wav

# (find-man "1 sox")
# (find-man "1 sox" "-t, --type FILE-TYPE")
# (find-man "1 sox" "-s/-u/-f/-A/-U/-o/-i/-a/-g")
# (find-man "1 sox" "-e ENCODING, --encoding ENCODING")
# (find-man "1 sox" "-e ENCODING, --encoding ENCODING" "signed")
# (find-man "1 sox" "synth [-j KEY] [-n]")
# (find-man "1 sox" "-n, --null")
# (find-man "1 sox" "-c CHANNELS, --channels CHANNELS")
# (find-man "1 sox" "-r, --rate RATE[k]")
# (find-sh "sox --help")

# (find-status   "sox")
# (find-vldifile "sox.list")
# (find-udfile   "sox/")

# (find-man "7 soxformat")
# (find-man "1 soxi")
soxi



#####
#
# alias-brownnoise
# 2022sep30
#
#####

# «alias-brownnoise»  (to ".alias-brownnoise")

https://news.ycombinator.com/item?id=32998960 Can brown noise turn off your brain? (nytimes.com)
alias brownnoise='play -n synth brownnoise synth pinknoise mix synth sine amod 0.3 10'





#####
#
# mpd - Music Player Daemon
# 2019nov02
#
#####

# «mpd» (to ".mpd")
# (find-es "emacs" "mpdel")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo apt-get install mpd

# (find-status   "mpd")
# (find-vldifile "mpd.list")
# (find-udfile   "mpd/")





#####
#
# troubleshooting
# 2020jan27
#
#####

# «troubleshooting» (to ".troubleshooting")
# (find-es "alsa" "alsa-utils")
# (find-fline "/sda1/home/music/BROTHERS_OF_THE_BALADI/Hope/")
# (eev     "cd /sda1/home/music/BROTHERS_OF_THE_BALADI/Hope/ && laf")

# https://wiki.debian.org/Sound
# https://wiki.debian.org/SoundFAQ
# https://unix.stackexchange.com/questions/383633/sound-suddenly-not-working-on-debian-9
# https://www.youtube.com/watch?v=uzCTF66Od8U
# https://www.debianhelp.co.uk/sound.htm
# https://www.linuxquestions.org/questions/debian-26/debian-10-sound-not-working-4175659373/

From <https://wiki.debian.org/Sound>:

1. Check that the audio playback program is unmuted/volume is raised,
   from inside the application, and in the system audio mixer (eg.
   PulseAudio volume control or alsamixer.

2. Check that your soundcard is visible, enabled, and is selected as
   default in the Configuration tab of the audio mixer

   Applications -> Sound & Video -> Pulseaudio volume control
   -> pavucontrol -> what is "Dummy output"?

   https://askubuntu.com/questions/800262/persistent-dummy-output
   https://askubuntu.com/questions/491346/how-do-i-get-my-sound-working
   lspci -vvv | grep -A8 Audio

   # (find-man "1 grep")
   # (find-man "1 grep" "-A NUM, --after-context=NUM")

3. Disable any other output devices like HDMI, only enable the desired
   output

4. Check that your soundcard is detected by ALSA: aplay -l

   # (find-man "1 aplay")
   # (find-man "1 aplay" "-l, --list-devices")
   aplay -l

5. Check that a driver/module is loaded for your sound card using
   lspci -knn

   # (find-man "8 lspci")
   # (find-sh "lspci -knn")
   # (find-sh "lspci -knn | grep -A2 Audio")
   lspci -knn
   lspci -knn | grep -A2 Audio

6. If not, identify your soundcard's PCI ID ([XXXX:XXXX]) and paste
   the ID here to determine if a driver is available in Debian.

   # (find-sh "lspci -knn | grep -A2 Audio" "8086:293e")
   # (find-sh "lspci -knn | grep -A2 Audio" "17aa:20f2")

7. Check if your soundcard requires an additional Firmware.

8. Check whether you can play sound as Root/add your user to the audio
   group

   groups

9. Check proper connection of the output jack

10. Check that your amplifier/speakers are powered on and working

Wiki pages





* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
play -n -c1 synth sin %-12 sin %-9 sin %-5 sin %-2 fade h 0.1 1 0.1
sox play -n -c1 synth sin %-12 sin %-9 sin %-5 sin %-2 fade h 0.1 1 0.1
play -n synth 1 sine 440



play existing-file.wav    ;# equiv to "sox existing-file.wav -d"
rec  new-file.wav         ;# equiv to "sox -d new-file.wav"






/etc/security/limits.d/audio.conf

libjack-jackd2-0

   38  apti jackd2 jack-tools


Atari POKEY:
http://asma.atari.org/
http://asap.sourceforge.net/


http://en.wikipedia.org/wiki/Speech_recognition_in_Linux
http://en.wikipedia.org/wiki/CMU_Sphinx
http://en.wikipedia.org/wiki/Julius_(software)
http://en.wikipedia.org/wiki/List_of_speech_recognition_software
http://shout-toolkit.sourceforge.net/
http://en.wikipedia.org/wiki/RWTH_ASR

# (find-available "gstreamer0.10-plugins-good")
# (find-zsh "availabledebs | sort | grep sphinx")










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