Advanced audio issues

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

Advanced audio issues

#1 Post by tempestuous »

The audio player application, Aqualung, is currently being discussed on the Developer Blog, especially relating to its advanced audio features. So I thought I would open a forum thread on this subject.

1. Why?
Some users come to this subject with a desire to output audio from one application to another, for advanced audio production or audio manipulation during playback.

Other users (like me) are just interested in high quality audio output to either an advanced sound card, or external D/A converter.
In these cases, audio quality is generally related to the audio player application being able to process the audio file in its native sample rate, then pass it to the ALSA audio driver in the same state.
It's even possible to configure ALSA, via the optional /etc/asound.conf file, to bypass all additional processing (such as mixing, and gain control) so that the digital audio signal is bit-perfect from start to end.

2. High resolution audio
The current industry standard digital audio standard for which you can obtain music digitally remains, generally, the same CD-audio specification that was set 26 years ago: 16bit/44.1kHz.
Audiophiles are eagerly awaiting the music industry's shift to commercially available file downloads, which will be available in higher specifications such as 96kHz and 192kHz. These are already available now, but only from a limited range of sources (and music choices).
So in these cases audiophiles want an audio player application which will handle the higher sample rates and bit depths, and pass the signal to ALSA without any sample rate conversion.
Obviously, you must have an audio card which can deal with higher sample rates.

3. Upsampling
It's possible to upsample CD-spec audio files to, say, 192kHz before doing the D-to-A conversion, which can achieve (arguably) a superior sound.
As with many things in the hifi world, the result is more likely due to the technical level of implementation involved, rather than a cut-and-dry fact.
ie. a high quality oversampling D/A converter will certainly outperform an average quality non-oversampling D/A converter ... but will it outperform a top quality non-oversampling unit? This is a contentious subject, and there's some fancy mathematics and theory involved. I steer away from offering an opinion.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#2 Post by tempestuous »

So to Aqualung.
Thanks to forum member happypuppy for raising the subject of compiling Aqualung with LADSPA and JACK enabled.

LADSPA from http://www.ladspa.org/
is for audio filters at the input stage. It probably deserves its own forum thread.

JACK from http://jackaudio.org/
is for passing audio data between different applications (and drivers?). JACK also probably deserves its own forum thread, but after some testing I can definitely say that JACK is not needed for Aqualung to play 192kHz audio files.
I can play a 24bit/192kHz wav file by launching Aqualung like this -

Code: Select all

aqualung -o alsa -r 192000 -d plughw:0,0
Note the "plughw" parameter at the end. This specifies the sound card hardware ... but "hw:0,0" won't work. I think that "plughw" is an ALSA configuration option which bypasses certain processing functions of the ALSA driver. If any ALSA experts want to explain that further, please do so.

Obviously my sound card (Envy24HT-S based) is capable of 24bit/192kHz. I know there's no samplerate conversion involved, because for this test I compiled Aqualung with libsamplerate disabled.
To double-check, I can play the same audio file with aplay, like this -

Code: Select all

aplay MYHIRESTEST.wav
and this is reported at the commandline

Code: Select all

Playing WAVE 'MYHIRESTEST.wav' : Signed 24 bit Little Endian in 3bytes, Rate 192000 Hz, Stereo
thus confirming that a 192kHz audio signal is being presented to the ALSA driver, and since I can hear it, my sound card can obviously handle this signal.

Upsampling/downsampling with Aqualung.
If you compile Aqualung with libsamplerate enabled,
from http://www.mega-nerd.com/SRC/
Aqualung will upsample or downsample your audio files to match its output samplerate, which is fixed.
Aqualung's default output samplerate seems to be 44.1kHz. To set it to anything different you need to launch Aqualung as I explained above.

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#3 Post by ttuuxxx »

Hi

The way I see it, the average user has no use for any of this by default, but if the size is contained to a min, then why the heck not :)
Like I somewhat mentioned on Barry's blog, that dougal compiled it really small in 2006, and well if all you need to save people from recompiling to add support is a 26kbpet or 52kb extracted, then why not have jack as a option and maybe the full server in the repo?
dougals jacks spec's for his package was this
JACK-0.101.1-lib.pup (libJACK) dotpup size: 26k extracted: 52k
plus the other 2 would be
liblrdf-0.4.0-base.pup dotpup size: 17k extracted: 30k
raptor-1.4.9-base.pup dotpup size: 103k extracted: 248k
about about 146kb extra to have professional sound support. Why not.
ttuuxxx

dougals link
http://www.murga-linux.com/puppy/viewtopic.php?t=12870
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#4 Post by tempestuous »

Mmm, well my compilation of JACK ver 0.116.2 is noticeably larger -
200KB compressed, 600KB uncompressed.
That's with all executables and libs stripped.

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#5 Post by ttuuxxx »

tempestuous wrote:Mmm, well my compilation of JACK ver 0.116.2 is noticeably larger -
200KB compressed, 600KB uncompressed.
That's with all executables and libs stripped.
I just did the same, with the version that dougal used and the pet was 114kb pet and 328 extracted, That's with all executables and libs stripped. Almost 1/2 the size, lucky I found the sources :) I can't see why we couldn't use that one, I don't think the bins are actually need for playing with audio player, probably just the libs like Dougal had, and its still compiles the lib as /usr/lib/libjack.so.0.0.23 56kb
Here's the sources :)
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#6 Post by tempestuous »

ttuuxxx wrote:I just did the same, with the version that dougal used
...
I can't see why we couldn't use that one
Well, that question should be answered by proper testing, preferably by forum members who have a good understanding of JACK, such as happypuppy.

And as Barry said on the Developer Blog, any supplementary packages such as JACK and LADSPA should be compiled in a Puppy416 development environment.
ttuuxxx wrote:I don't think the bins are actually need for playing with audio player
The jackd executable is certainly needed. JACK won't work without it, and Aqualung will report -

Code: Select all

JACK server not found

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#7 Post by ttuuxxx »

yes I knew about compiling and how it should be in 416, thats just a given, and the reason why I didn't post my packages here, Also from past experience I did think the main jack bin was needed, but when you look at the old package you wouldn't think it was there.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#8 Post by ttuuxxx »

Hey tempestuous
Ever hear about somaplayer when you compile it, its only 300kb pet and has some really unique features like streaming audio to shoutcast and others, I found the sources and write up at debian.
It only needed one tiny extra lib to work,call confuse.
Here's a link. http://packages.debian.org/sid/somaplayer
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

panzerpuppy
Posts: 632
Joined: Tue 02 Oct 2007, 07:39

#9 Post by panzerpuppy »

@tempestuous: There's a new post by happypuppy with some really interesting information about JACK:
http://www.puppylinux.com/blog/?viewDetailed=00882

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#10 Post by tempestuous »

Yes, happypuppy's explantion of JACK is worth repeating here.
happypuppy wrote:JACK is not another sound server like aRTs,esd or PulseAudio.
It's a specialised audio connection kit for professional audio recordists ,musicians and advanced users.

Some of the things you can do with JACK:
- Connect the output of one app to another for recording or further processing, connect multiple ins/outs between multiple apps, record from anything,...
- Connect the output of any app to any output of your soundcard, clone the sound and send it to multiple outputs (i.e. play the same thing from all 8 speakers),send different streams to different soundcard outputs and play them all at once.
- Ultra low latency operation (totally opposite from the other servers out there which add massive latency)
Reduces the audio latency of ALSA even further with advanced scheduling.
- Minimal overhead (very low CPU usage,unlike all other servers)
- On-demand operation (start it only when you need it.No need to run the server all the time)

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#11 Post by tempestuous »

I just provided an Aqualung package with JACK and LADSPA support here
http://www.murga-linux.com/puppy/viewtopic.php?t=44537

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#12 Post by tempestuous »

I have received several messages from hifi types who are decidedly disinterested in JACK. It's certainly a powerful tool, but apparently more relevant to things like multitrack audio/midi recording than to end-product playback. And the people who are using it seem to be running high end host computers with RealTime enabled Linux kernels. In fact the JACK daemon's preferred mode seems to be RealTime.

Applicable to hifi is more likely something like Brutfir
http://www.duffroomcorrection.com/wiki/Brutefir
for things like digital speaker crossover filtering, or digital room correction.

If you want to get serious about computer audio quality with Linux, go to this thread on the diyaudio.com forum:
"Linux Audio the way to go!?"
http://www.diyaudio.com/forums/showthre ... adid=93315
Caution: you will frequently hear the term "digital jitter"!

Post Reply