LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   capture/record all 'stuff' from ALSA driver to file (https://www.linuxquestions.org/questions/linux-software-2/capture-record-all-stuff-from-alsa-driver-to-file-308401/)

fwelland 03-31-2005 07:52 PM

capture/record all 'stuff' from ALSA driver to file
 
environment
---
Dell Latitude D600 running FC3 (2.6.9-Fred - stock kernel patched with alps touch pad driver)
Upgraded my ALSA drivers/lib/oss/utils to latest - 1.0.8
Card: Intel 82801DB-ICH4
Chip: SigmaTel STAC9750/51
---

Before the alsa upgrade (using stock alsa that came with FC3) I used to route pretty much everyting (xmms, gaim sounds, gnome event sounds etc) thru ESD. I also would 'capture/record' some stuff via "esdmon | lame -x -m s - output.mp3" - basically that took whatever was sent to ESD and lamed it and stored it to a file.

Now I have ditched ESD and just routed most/all sound stuff thru alsa/dmix directly. But how do I capture the mixed stream like I did with esdmon? Is there something like esdmon for alsa?

And no I'd like to avoid running esd, or jack or any other sound server.

tsphan 03-31-2005 08:32 PM

i suppose you can just use the regular recording options with the alsamixer. I don't know how to set it up with alsamixer, but with aumix, you just press the green button next to the Master Volume and use any sound recording program to record it. Pressing it selects the input source.

the alsamixer manual said to use the spacebar, I didn't find it to work.

fwelland 04-01-2005 08:38 AM

well I don't reall want to record anything from one of the 'normal' alsa input sources such as 'Mic' or line - in. Reallly what I want to do is have a several programs that produce sound - do so...and then I capture this combined/mixed output. So the 'record' stuff in alsamixer (and arecord) doesn't really do this - or I don't know how to make it do that.

oh and I don't know too much about aumix - but it looks like a oss mixer and I am really not 'running' any oss stuff any more. I tried it - and get aumix: error opening mixer - maybe it is t wants to open /dev/dsp which doesn't exist when you are not using OSS. ...

still looking...


If anyone is really curious as to why I want to do this....

Here is the script if you are interested (this is the one using esd - note I commented out some stuff from an earlier rev of this script that just used OSS stuff & SOX - that had some problem that I don't recall - that caused me to switch to ESD).
--------------
#!/bin/sh
fname=`date +"interval-music-RP-%m-%d-%Y-%I_%m%p.mp3"`
begindate=`date +"%s"`
#sox -t ossdsp -w -s -r 44100 -c 2 /dev/dsp -t raw - | lame -x -m s - $fname &
esdmon | lame -x -m s - $fname &
#soxpid=`ps |grep sox | awk '{print $1}'`
soxpid=`ps |grep esdmon | awk '{print $1}'`
sleep 3
fsize=`ls -l $fname |awk '{print $5}'`
while [ $fsize -lt 384000000 ] ; do
sleep 297
sox /home/fwelland/Sounds/UtopiaExclamation.wav -c 1 -t ub - |esdcat -b -m
sleep 2
sox /home/fwelland/Sounds/UtopiaExclamation.wav -c 1 -t ub - |esdcat -b -m
sleep 57
sox /home/fwelland/Sounds/Musica/MusicaError.wav -c 1 -t ub - | esdcat -b -m
sleep 2
sox /home/fwelland/Sounds/Musica/MusicaError.wav -c 1 -t ub - | esdcat -b -m
fsize=`ls -l $fname |awk '{print $5}'`
done
kill $soxpid
enddate=`date +"%s"`
timediff=`expr $enddate - $begindate`
mins=`expr $timediff / 60`
secs=`expr $timediff % 60`
echo recording duration was $mins minutes and $secs seconds
newfname=`echo ${fname%.mp3}-${mins}m-${secs}s.mp3`
echo $newfname
mv $fname $newfname
----
If you read this far - maybe you are curious why I am doing this. I listen to an internet radio station via xmms and fire off this script. It inserts an 'alarm' after about 5 mins and then another one a minute later. I am an interval runner - run for 5 mins walk for 1.......copy to my iRiver....and away I go...


All times are GMT -5. The time now is 03:21 AM.