Recording digital audio with Linux impossible?
Dear Lazyweb, in late 2001, I bought a shiny new computer to replace my VHS VCR and to finally help me in getting my last 200 hours worth of music form analog audio tapes into the digital domain. I have to admit that I have failed to do this.
While the TV ambitions were originally spoiled with the rotten Windows TV software that came with the Hauppauge PVR PCI card, audio with windows used to work rather decently. Until I decided to ditch Windows and to use Linux. Which looks like a mistake. Not even the audio stuff works any more.
I have bought a new TV card and a new sound card, but all I currently get (with the old sound card, btw) are audio recordings that sound way too fast.
I would like to use my DAT deck as a A/D-converter and to feed the resulting 44.1 kHz 16 bit stereo data stream to the computer via optical S/PDIF. I couldn't get the emu10k card I bought to listen to its optical entry, so I swapped it back to the cm8738-based Nightingale Pro 6. Since toying around with the IEC switches in command-line ALSA mixer, I can hear what's being put in on optical S/PDIF correctly playing on the PCs analog output.
However, when I use arecord -Dhw:0,2 -f cd foo.wav to actually record from the optical S/PIDIF input, the Result sounds way too fast. Otoh, both aplay and file(1) say that this is a 44.1 kHz 16 bit stereo WAV file.
Up to now, neither Usenet nor the ALSA mailing list have been helpful in debugging this. Oh dear lazyweb, who can help?
In the current situation, I am really really tempted to shell out money - either for a new Windows license, or for a Mac. What should I do?
Display comments as Linear | Threaded
Adam on :
The general consensus google seems to give is that this is a rate-setting problem. The main suggestion is to specify (either in the .asoundrc or via arecord commandline option) a rate of 48000 (see links at bottom).
The evidence does point to a rate-mismatch. Downloaded your example and opened it with Audacity (http://audacity.sourceforge.net/ or apt-cache show audacity) and changed its rate (set rate->other) to 29000 and it sounds normal.
I don't have a great understanding of how these sample rates work in practice to advise what the setting should be for recording, but I'd start with the google consensus of 48000 and tweak from there if it's still off. Within 20 minutes you should be able to narrow it down to an acceptable setting that sounds good.
Hope it helps. The fact you get sound period is a promising sign. It's just a matter of smoothing out the wrinkles now.
http://alsa.opensrc.org/Via8233#Poorsoundquality (bottom of that section)
http://www.alsa-project.org/alsa-doc/doc-php/notes-full.php (from arne h.'s post : "-srate 48000 converts everthing to 48khz because the soundchip can't handle 44,1khz over spdif and the output would be too fast")
http://www.spinics.net/linux/fedora/alsa-user/msg01073.html (and subsequent messages in that thread)
Marc 'Zugschlus' Haber on :
The Input is definetely 44.1 kHz digital, I believe what the DAT recorder claims to output. Additionally, 48k/44.1k = 1,08, while 44100 / 29000 = 1,52, so the rate difference is too much to be a 44,1 / 48 mismatch issue.
Gernot Hassenpflug on :
Difficult, difficult. What you're interfacing (DAT tapes) is way over my head (I used them at work for data storage only). I have a soundcard that is unofficially supported by ALSA, and I spent about 1 year getting it to work. For the last 3-4 months, the ALSA mixer GTK no longer works, although command-line mixer and terminal graphical mixer are fine. I can record from CD and edit, mix, all to my satisfaction (done for ballroom dance exhibition music for the club I partake in).
So, my not so elegant solution: in short term, i.e. needs to be done within the next 2 months or so, borrow a Mac for a weekend, or even a Windows machine (laptop, built-in soundcards may be good enough I suspect, nowadays given your original quality on tapes). Not very geeky, I admit, but gets the job done I think.
In longer term, have to link up with other interested people when they get time - I find many problems are solved only when critical people finish some other long-term project, so sadly your problem simply cannot be solved while they are busy elsewhere.
Hope that is of some comfort. I would say, do not but either a Mac or Windows machine though. Think about it a little bit.... there, do you agree?
Best wishes, Gernot