Simple ALSA Audio Recorder - "Record what you hear" via the snd_aloop module...
Evening, gang.
I'd always had "issues" with recording audio through the internal sound card on this HP Pavilion rig, right from the day I bought it. The necessary 'loopback' control has never shown in either Retrovol OR alsamixer, without which you're on a hiding to nothing. The control is, apparently present & correct under Windows, but various threads in the ArchLinux forum showed that the Linux kernel has problems with the interface on this thing. Windows compatibility, it seems, was boosted by HP writing a custom patch for the thing to function as it should with the Redmond behemoth.
number77 started a thread about a very similar problem a while back:-
.....in which I posted myself, hoping, vaguely, that this time a solution just might be found:-
As it turned out, a solution was indeed found, although not in quite the way I expected.....
----------------------------------------------------
I still don't know quite who it was "discovered" it first - Bill (rcrsn51), Fred (fredx181) or jamesbond of the FatDog team - but the kernel, it seems, possesses the ability to create 'virtual' loopback devices by means of the snd_aloop module. Anyway, during the course of the thread various things were tried out, then Bill came up with a script which not only let you record what you were hearing, but also permitted monitoring it while recording.......under normal usage of the virtual device, recording will cut-off the sound from the source, so recording, while possible, becomes something of a matter of guesswork. Bill's script restored the ability to monitor, so.....problem solved.
I took to this like a duck to water. It fixed my "issue", and allowed me to once again record audio. I built a wee GUI for the thing, and was quite satisfied with it.....for a while!
---------------------------------------------------
Over the course of the next couple of months, I built a more elaborate GUI, added a few things, and really tarted it up for my own personal use. And that's where it remained, until the other day when I was idly scanning the forum, and a post from a new member had brought a thread by jamesbond in the FatDog forum "back to the top". I had a read through it, recognised a lot of what we'd discussed in number77's thread a year previously, and took a long hard look at my 'personal' build. I decided it could do with a re-vamp, so started re-building the GUI to tidy it up and make it look more presentable, added a few more functions in light of stuff I've learnt over the last 12-15 months with the construction of both MultiCam and CamRecord, made it simpler to use, added a help-file and turned it into a full-fledged 'portable' along with Menu entry scripts.
It now records both .mp3 and .wav, about the two most common audio formats out there. It uses arecord for recording - with mp3 piped via lame - and ffplay for playback (necessary because although aplay will recognise .wav, upon playback of .mp3 all you get is 'white noise'. Ffplay solves this, along with the fact it's present in nearly all Puppies, as is arecord.....plus you get a nice wee graphical display with it during playback. Neat!)
Bill's original script recorded in mono, which I modified to stereo a long while back. The 'portable' also stores your recordings within its directory. IF you add a menu entry via the script, this 'Saved_Files' directory is sym-linked into /root, for quick access to those recordings. You can also access your saved recordings direct from the GUI, too.
Fred's long since produced the ffmpeg-based ALSA-Cap GUI, but since I've re-vamped this one, I thought it would be nice to share, so.....
It's no-arch, so should work in pretty much most Puppies. I'm attaching it to this post, since it's basically a bunch of scripts, therefore pretty small.....
Huge thanks must go to Bill & Fred, without whom this wouldn't have been possible...
Have fun.
Mike.