In article ,
Richard
Robinson wrote:
Jim Lesurf said:
[snip]
And I think this becomes a matter of intellectual curiosity rather than
practicalities - [please correct me if I'm wrong, but ...] I can't see
that the byte-padding is any kind of issue, it makes no difference to
the meaning of the data and the processing overhead isn't to worry
about.
Yes. In itself, byte padding doesn't matter. So on that score using
'plughw:' or an equivalent is harmless. The snag is that 'plughw:' allows
"any necessary conversions" so there is a risk some other conversion
happens because the system decided it was "necessary". But you can check
this by catting the hw_params.
... one thing I realise I'm not clear on is, what's actually being sent
down the cable into the DAC. Talk of byte-padding suggests that the
compressions (flac/mp3) are unpacked in the alsa layer, or higher, and
the DAC receives raw samples ? But the DAC itself supports these
formats, so is there still some unnecessary conversion going on ?
Chances are that the DAC only understands plain LPCM (usuallly little-end
order as in a wave file.) Any other type of file you play will need to be
coverted into LPCM by the playing software or some other 'intermediary'
layer of software. This will depend on your choice of playing software.
But, yes, flac or mp3 will have to be being turned into LPCM before is goes
though ALSA to the hardware.
Yes. I'm not much of a hardware person, either. I now have
half-a-zillion different ways of playing the files, all of them faintly
cranky from some viewpoint or other; at least they're non-destructive.
I've also got involved in a recording project that's pushing me to learn
how to drive audacity, I might want to be sure that files I work on
there aren't losing any quality. *sigh* Inputs could be a whole other
mess, I'm not sure how far I want to take that ...
Well, you can use '-arecord'. This is the ALSA command that can be used to
capture audio from devices in the same way as '-aplay' lets you play audio.
If nothing else, that will let you check what is happening. It represents
the simplest and most basic way to record and just uses ALSA. So no other
software need get in the way. (You can also use 'sox' to play and record
and it will do format conversions as it does so.)
FWIW I've written a basic sound recording program for Linux which uses ALSA
and *only* pads with bytes where needed. It also gives a 'PPM' display so
you can monitor the levels. The program, with source code, is linked from
the software page on my Audiomisc website. I wrote this program
specifically to ensure that the program was one I knew would *not* fiddle
about with the values. Note that as it stands it assumes you will use a USB
audio device. But that could be changed if you require.
The above program is what I use to make audio recordings.
(There are also some other programs like a sig gen and scope/FFT analyser
so you can do tests.)
If you use Audacity it may convert. e.g. I think it tends to turn
everything into 32 bit floats internally. But you should be able to set it
to use 'hw:' or 'plughw', and in my own tests it seems to preserve 24 bit
recodings with bit-accuracy. So it should be OK if used with care.
Jim
--
Please use the address on the audiomisc page if you wish to email me.
Electronics
http://www.st-and.ac.uk/~www_pa/Scot...o/electron.htm
Armstrong Audio
http://www.audiomisc.co.uk/Armstrong/armstrong.html
Audio Misc
http://www.audiomisc.co.uk/index.html