|
Sound
See Sigillo's Sound.html for Software and Guides links
See Networked sound
Guides
Software
- Sound software: ftp://metalab.unc.edu/pub/Linux/apps/sound/cdrom/
- Basics
- lspci -vs 01:03.0 (on trevi -- see the pci card)
- cat /proc/asound/version (show ALSA version installed)
- alsactl --version (ditto)
- aplay -l (get a list of all devices)
- amixer info
- amixer scontents
- alsa-base
- alsa-headers
- alsa-utils
- ld10k1 -- emu10k1/emu10k2 effect loader for alsa
- incapacitates the mixer by default (see 17 Feb 06 below)
- /etc/init.d/alsa {unload|reload|force-unload|force-reload|suspend|resume}
- sox your_file.wav -t ossdsp -w -s /dev/dsp
- sox filename -e stat" to find the length of the file
- sox --mix
- sox firstfile mixedfile lastfile newfile (concatenate)
- play -c 4 -n -c 2 synth sin %-12 sin %-9 sin %-5 sin %-2 vol 0.7 mixer fade q 0.1 5 0.5 (synthesize)
- http://sox.sourceforge.net/Docs/Scripts
- Editors
- audacity (version 1.2.2 allows group convertions)
- mxv -- wave file editor with signal processing operators and analysis
- wsola -- allows one to speed/slow audio without altering its pitch
- wavbreaker - a tool to split wave files into multiple chunks
- Converters and encoders
- abcde (convert to ogg and tag all tracks on a CD)
- dir2ogg (converts mp3, m4a, and wav files into ogg)
- distmp3 -- cluster conversion to mp3 (just reconfigure distmp3)
- mp32ogg (superceded by dir2ogg)
- mp3splt -- splits mp3 and ogg vorbis files without reencoding
- mp3wrap -- utility for mp3 wrapping (rolling multiple mp3s into one)
- oggz-tools
- soundconverter (gtk)
- vsound -- virtual loopback sound recorder and real audio converter
- vorbis-tools (contains oggenc)
- vorbisgain
- sox (sound exchange, a powerful command-line converter)
- usage tips
- sox tmp/19.gsm -t alsa -w -s default (or logical ALSA device name, such as dmix, in place of "default")
- studio (1999 frontend, not in Debian)
-
transcode (local)
- dvdrip (frontend)
- gtranscode (frontend)
- Players
- alsaplayer-alsa
- alsaplayer-common
- alsaplayer -i text (plays in CLI)
- orpheus (text/win)
- xmms
- xine
- gxine
- totem
- kaffeine
- quark, strange-quark, and charm-quark (plays in CLI)
- mplayer
- realplayer
- other
- wsola - speeds up or slows down audio, without pitch alteration
- splay -- play wav files
- Metadata
- oidua - audio file metadata lister
- Mixers
- amixer (in alsa-utils; command-line control)
- amixer info
- amixer controls
- amixer scontrols
- amixer scontents
- amixer set Master 2+ -q (increase volume by two steps)
- amixer -c 0 cget numid=18
- amixer -c 0 cset numid=18 100%,100% unmute cap
- alsactl store the default (or named, special-purpose) alsa settings
- alsactl restore them
- .asound -- see under Sigillo/Sound
- /usr/share/alsa/cards/EMU10K1.conf
- kmix
- kmixctrl is used to save or restore the settings of kmix
- aumix
- alsamixer
- alsamixergui
- gnome-alsamixer (quite nice)
- rexima (curses-based)
- Recording
- see TV-capture
- arecord -d 5 -N -vvv foobar.wav (see man arecord)
- arecord -d 5 -D hw:1 -f S16_LE -c2 -r32000 test.wav (record from a saa713x tv capture card)
- aplay foobar.wav
- audacity
- sweep
- Synthesizers
- ams - realtime modular synthesizer for alsa
- amsynth - two oscillator software synthesizer
- creox - real-time guitar effects
- shaketracker -- MIDI sequencer with tracker GUI
- Speech synthesis
- festival speech synthesis -- see separate file
- festvox
- festvox-rablpc16k (British male)
- festvox-ellpc16k (Spanish male)
- festvox-kallpc16k (US male)
- festvox-kdlpc16k (US male)
- more plugins
Mixer components
Master --- overall sound volume control
Tone --- switches on&off Bass and Treble controls
PCM --- Volume control for stereo streams.
PCM Center, PCM Front, PCM LFE, PCM Surround --- Volume control for
multichannel streams.
Front, Surrount, Center, LFE --- Volume controls for routing stereo
streams to all speakers.
Music --- MIDI volume
Line --- on-card Line-in volume
Line2 --- LiveDrive Line-in volume
CD --- Analog CD (3 or 4 wire cable)
Mic --- on-card Mic-in volume
Mic boost --- +20dB for Mic
Phone --- TAD connector
IEC958 == SPDIF
PC Speaker --- there's a pinout on the SBLive to connect your PC speaker to it
Aux --- On-card "AUX" volume
Aux2 --- For the extra pinout on the card for connecting other devices
Analog Mixer --- Analog inputs are all mixed together and this controls the level of that mix
Analog Analog/Digital Output Jack --- Switches the card to "Digital Output Only"
Audigy CD --- 2-wire CD input
Testing the sound
To test the sound, issue "cat flack.mp3 >/dev/dsp0" -- this
gives me lots of noise, so I know I've hit the sound card. For details,
see mplayer. cat /usr/share/sounds/KDE_Beep_Honk.wav > /dev/dsp
will tell you if the sound card is alive.
- less /proc/asound/version
- cat /proc/asound/*
- aplay -l (get a list of all devices)
- alsactl
Downsampling for the mobile phone
- Podcasts are typically mp3 mono (sometimes stereo) 44.1 kHz
- Phone wants ogg mono 16 kHz
- sox *mp3 -r 16000 -c 1 track01-new.ogg
Capturing an rtsp:// file and converting it to ogg
- mplayer -dumpstream rtsp://<address>
- mv stream.dump streamdump.rm
- trplayer streamdump.rm (test that the stream plays)
- Convert the realmedia audio file to wav:
- vsound trplayer streamdump.rm OR
- vsound realplayer streamdump.rm
- Convert all the way to ogg (goes via au and wav):
- vsound -t -s trplayer -q -n streamdump.rm | sox -t au - -t wav - | \
oggenc -q 0 -o streamdump.ogg -
Note that the converted files may be much larger and/or lose quality.
You can use trplayer or kaffeine to play the original captured file.
On 10 December 2005, I downloaded and customized for spello and clitunno a paired set of scripts for capturing NPR streams:
spello# npr-grabber.sh -m -o WESAT
to download the latest Weekend Edition on Saturday and convert to mp3
and ogg. The scripts don't work on clitunno -- there's a problem with
the download, and I haven't taken the time to debug.
For sound files in .ra, .ram, and .wmw, capture to wav (this is what npr-grabber does):
mplayer -nocache -vc null -vo null -ao pcm:waveheader
-ao pcm:file=<filename.wav> rtsp://<url.rm>
For video, use dumpstream:
mplayer <url> -dumpstream -dumpfile <name>
For instance:
mplayer32 rtsp://real.npr.na-central.speedera.net:80/real.npr.na-central/atc/20041124_atc_12.rm
-dumpstream -dumpfile bittorrent.wav
Trevi works if you use mplayer32.
For details, see http://gentoo-wiki.com/HOWTO_Rip_Streams_With_MPlayer
Timeshifting NPR's news programs: http://phiwumbda.org/~jesse/shell/NPR.html
The site has instructions for how to use the npr-grabber.sh script,
which I've modified to work with a recent mplayer (and with /ssa/) and
placed on spello.
Alsaplayer plugins
# alsaplayer --verbose -i text
AlsaPlayer 0.99.76
(C) 1999-2003 Andy Lo A Foe <andy@alsaplayer.org> and others.
Output plugin: ALSA output v1.9.0beta12
Loading reader plugin: File reader v1.1
Loading reader plugin: HTTP reader v1.3
Loading Input plugin: flac player v1.2
Loading Input plugin: CDDA player v1.2
Loading Input plugin: libsndfile plugin v0.1
Loading Input plugin: MAD MPEG audio plugin v1.01
Loading Input plugin: MikMod player v1.0
Loading Input plugin: Ogg Vorbis player v1.2
Loading Input plugin: WAV player v1.01
Interface plugin: TEXT interface v1.1
Note the various capabilities -- what does CDDA do? Play CDs, or look
up CD song titles? What is the file reader, or the http reader? For
playlists?
Installing a new ALSA version into the kernel
http://alsa.opensrc.org/index.php?page=AlsaBuild2.6
Here is the answer for getting the latest alsa-kernel into the kernel.
I tried to use the CVS version but it failed, so I just used latest
1.0.8 alsa-drivers. Within it is the alsa-kernel dir.
cd alsa-kernel
rm -rf oss
cp -a Documentation/* /usr/src/linux/Documentation
rm -rf Documentation
cp -a include/* /usr/src/linux/include/sound
rm -rf include
cp -a * /usr/src/linux/sound
Not tested.
Burning a CD from mp3 files (source)
- If any filenames contain spaces, first convert them to underscores:
- for i in *.mp3; do mv "$i" `echo $i | tr ' ' '_'`; done
-
If your MP3 files came from DOS/Windows, they may have
uppercase extensions -- you can convert whole names to lowercase or
just extensions
- For everything lowercase do:
- for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done
- to convert just extensions:
- for i in *.MP3; do mv "$i" "`basename "$i" .MP3`.mp3"; done
- Convert mp3 to wav (is this really necessary?) using lame or madplay:
- for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done
- for i in *.mp3; do madplay -o `basename $i .mp3`.wav $i; done
- Make sure the files are 16 bit, stereo 44100 Hz:
- To convert when necessary, use sox:
- sox track01.wav -r 44100 track01-new.wav resample
- or, if the above introduces static when converting mono files:
- sox track01.wav -r 44100 -c 2 track01-new.wav
- Normalize the sound:
- Optionally, convert WAV files with sox into CDR format before burning:
- Use k3b or xcdroast to make the iso image and burn
Sound troubleshooting guide
Andrey wrote and wanted help troubleshooting sound on his system (Nov 2003).
- Make sure you have these packages installed:
aumix-gtk (and/or xfce4-mixer)
kdemultimedia
mp3blaster
2. Find a tiny sound file and test whether the card is alive:
cat /usr/share/sounds/KDE_Beep_Honk.wav > /dev/dsp
Try /dev/dsp and /dev/dsp0 -- your /dev should look like this:
lrwxrwxrwx 1 root root 9 Jul 24 01:37 /dev/dsp -> /dev/dsp0
crw-rw---- 1 root audio 14, 3 Jul 24 01:37 /dev/dsp0
(/dev/dsp should symlink to /dev/dsp0, which should have major 14 and minor 3, and group audio.)
3. Run mp3blaster in console and press > to increase the settings
for PCM and Volume; try playing an mp3 file (in alsa, volume is set to
zero on first installation)
or
start aumix or run xfce4-mixer and do the same thing.
If zero volume settings was the problem, set them to an appropriate level and issue
alsactl store
When you reboot, if alsa is defined in sysv (see sysv-rc-conf or ksysv), the init.d script will run alsactl restore.
4. Check dmesg
I see from the lspci you sent earlier that you have a VIA audio controller
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235
AC97 Audio Controller (rev 50)
This has its own driver in the kernel -- "VIA 82C686 Audio Codec" and "VIA
82C686 MIDI" (if you want the MIDI synthesizer). The help note in the
kernel says "DO NOT select Sound Blaster or Adlib with this driver, unless
you have a Sound Blaster or Adlib card in addition to your VIA audio chip"
Your dmesg bootlog should show something like this:
Via 686a audio driver 1.9.1
ac97_codec: AC97 Audio codec, id: 0x5649:0x4161 (Unknown)
via82cxxx: board #1 at 0xE400, IRQ 10
If you don't see anything, go to 5.
5. Check if the modules have been built
To check if this module is built, go to this directory:
/lib/modules/<your kernel>/kernel/drivers/sound
and you'll see all the sound modules.
Issue lsmod to see which modules are actually loaded. If it's not loaded,
try using modconf to load the module cleanly, with any dependencies.
6. For later
People keep reporting that this driver is not the greatest and that ALSA is better but a hassle to set up, cf. http://www.mail-archive.com/alsa-user@lists.sourceforge.net/msg10201.html
The 2.6 kernel has ALSA built in and likely is better.
Installation history
29 September 2006
On Clitunno, I had to add snd-mixer-oss and snd-pcm-oss to /etc/modules
as they weren't loading, and then audacity runs fine (but doesn't
really record my voice), while skype did fine after setting mic sound
to max and boost too.
3 March 2005
On Spello, I had trouble (especially in avidemux) with the sound
cutting out and delaying. I went in as user root into kcontrol and
turned off autosuspend, increased the buffer size, and selected ALSA.
In the konsole I got this interesting feedback:
unable to connect to sound server
>> running as realtime process now (priority 50)
unable to connect to sound server
server status: running, autosuspend disabled
real-time status: real-time
server buffer time: 92.8798 ms
buffer size multiplier: 1
minimum stream buffer time: 92.8798 ms
auto suspend time: 0 s
audio method: alsa
sampling rate: 44100
channels: 2
sample size: 16 bits
duplex: half
device: default
fragments: 4
fragment size: 4096
Results not tested.
2 January 2005
The Audigy2 Value card IN channels may be broken -- if so, try
/etc/modprobe.conf: "options snd-emu10k1 extin="0x3fff"
19 December 2004
To free up the only 32-bit slot on trevi, I purchased SoundBlaster Audigy2 Value 24-bit for $75 and
discovered it's not supported in the ALSA that's in the 2.6.9 kernel --
see details -- only in ALSA CVS at
http://www.alsa-project.org/download.php
See diff
from 21 November 2004 -- the chip is emu10k2, the card SB0400, PCI
IDs:1102:0008. Creative donated a card, so the driver should be decent.
Built the driver from ALSA CVS as follows:
mkdir alsa && cd alsa
cvs -d ':pserver:anonymous@cvs.alsa-project.org:/cvsroot/alsa' login
cvs -z3 -d ':pserver:anonymous@cvs.alsa-project.org:/cvsroot/alsa' co -P .
./build prep
cd alsa-driver
./configure --disable-verbose-printk
--with-cards=emu10k1,emu10k1x,ca0106,bt87x --with-oss=yes --with-debug=none
make && make install
The new (beta) ca0106 driver is for the new $25 SoundBlaster Live!
24-bit card, and a couple of other cards with this new chip.
Alsamixergui need these components on and up for television and normal playback:
- Master
- PCM is not needed
- Line (the first of the three Line components)
- Analog Mix (the first of two)
- Audigy Analog Output Jack (unmute)
- EMU10K1 PCM (both)
- Front
IEC958 Optical Raw must be off (muted). For TV recording, you also need the second Analog Mix turned on.
Since Master regulates the volume, you can leave the others on max. The
default settings are in the file /var/lib/alsa/asound.state, but you
can store and restore different profiles like this:
- alsactl store -f /var/lib/alsa/asound.state.bt87x
- alsactl restore -f /var/lib/alsa/asound.state.bt87x
It doesn't look like you need different sound profiles.
# amixer info
Card default 'Audigy2Value'/'Sound Blaster Audigy2_Value (rev.0, serial:0x10011102) at 0xac00, irq 28'
Mixer name : 'SigmaTel STAC9750/51'
Components : 'AC97a'
Controls : 156
Simple ctrls : 131
29 November 2004
The SoundBlaster Live! Value, Creative Labs model number
CT4670 that came with my mwave computer (Gubbio) is now in Clitunno,
doing great. It has umpteen channels and seems extremely well supported
under Linux:
less /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.6 (Sun Aug 15 07:17:53 2004 UTC).
Compiled on Nov 23 2004 for kernel 2.6.9-ac6 (SMP).
cat /proc/asound/cards
0 [Live ]: EMU10K1 - Sound Blaster Live!
Sound Blaster Live! (rev.5) at 0xb880, irq 16
22 October 2002
The problem was some static build up in the speaker itself. Fiddle with
the plug and it works.
less /proc/asound/version
Advanced Linux Sound Architecture Driver Version 0.5.12.
Compiled on Apr 15 2002 for kernel 2.4.16-4GB.
cat /proc/asound/sndstat
Sound Driver:3.8.2-980706 (ALSA v0.5.12 emulation code)
Kernel: Linux cyberspace 2.4.16-4GB #1 Mon Apr 15 09:35:46 GMT 2002
i686
Config options: 0
Installed drivers:
Type 10: ALSA emulation
Card config:
CS4236B at 0x534, irq 5, dma 1&3
Audio devices:
0: CS4236B (DUPLEX)
Synth devices: NOT ENABLED IN CONFIG
Midi devices: NOT ENABLED IN CONFIG
Timers:
7: system timer
Mixers:
0: CS4236B
|
|