Linux Audio the way to go!?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi folks.

I'd like to start up a discussion about Linux as the operating system of choice for audio playback.

Again, I'd like to focus on audio quality delivered by lossless formats only.

Within other threads, such as "PC - The perfect Source thread"
we touched upon the issue.

Some folks around here refered me to UNIX.
I took that challenge. And came to great results.

A decent Linux Audio setup outperforms any MS setup and player I came across.

Linux is not the easy to manage though. It needs some DIY spirit
to get it up'n running.


I tried several audio distributions such as dyne:bolic, X64studio
asf. And was not very happy with them. They are really stripped
down and can give you a lot of trouble. A decent well maintained
distribution is IMO the way to go. Support and information base
are overwhelming.


I decided to start-up with Ubuntu 6.10. based on 2.6.17-10 Kernel.

That worked quite well already.

However, from the beginning I had a realtime system in mind.
Because standard latencies on Linux are not much better than
MS, if better at all.

The new kernels support realtime-preemption better than the older versions. Many people are asking for it. I think realtime-preemption is one of the key differentiators, when it comes to future Vista/Linux comparisons.

I just managed to get a 2.6.19.1-rt15 Kernel configured, compiled and running.

It was definately worth the effort. The already good performing
Linux base-setup improved even further. I never had a better
PC Audio setup. :D


What I'd like to discuss further are a couple of subjects to tweak the system even further.

At the moment I do have a lack of knowledge in below areas to get the best setup:

1. Alsa configuration (buffer, etc.)
2. Best player suppling alsa interface management
3. Software based volume control dsp (e.g. 32bit float dsp)
4. Best realtime setup

Perhaps some folks con contribute some hints to above.

Cheers
KLS
 
Hi Soundcheck,

Glad you're getting into this and sharing. Ive no real experience with linux, but have messed about with a few distros. Ubuntu is nice and easy and replaced xp for me for a while. You seem to have covered a lot of ground already so Id imagine I cant really add to what youve done already.

I had found this thread on hydrogen audio a while ago, cabbagerat's postings on Linux/alsa setup are particularly interesting and should give a few things to try. the dmix component of alsa seems to resample and Ive read complaints about it causing distortion, but the thread linked suggests ways to get round this. Not sure what effect on sound the low latency patches provide, but as you say, I think the latest kernels make it easy to get good low latency performance. the ubuntu studio project is focused on making ubuntu more usable for multimedia, but theyve yet to release anything. Demudi are working on an embedded system which could be interesting.

I myself like the idea of the os being small enough to fit on a usb key or a flash card to eliminate hard drive noise - these systems boot and run a lot quicker as well. Dynebolic seemed promising on this front, would be interested to hear what problems you had with it. Ardour is the linux protools/samplitude, so given your preference for pro audio engines, might be worth your while checking it out - uses 32bit floating point which it claims has an effect on fidelity. Whilst again I do not like loading individual tracks, the open source nature of the project may mean that the project team could advise how we can implement the audio engine with a more useable interface, bu tperhaps this fidelity is only really for recording.

Please report your further findings.

Happy new year.

Ross
 
I guess it depends on what you are doing. Are you wanting to use this for critical recording or just single feed stereo playback? Stereo playback with one feed eats up such little processing that I can't see the need to use a RT-enabled Linux kernel. Typically RT-OS's are used in high CPU mission critical feeback loop based apps such as controlling a CNC machine, flying a helicopter, etc. It really isn't worth the trouble for open loop systems such as single feed stereo playback.

I'm not sure what it is you'd like to do while playing back audio that would cause the CPU not to be able to handle the load and starve the buffer. You could always just run the audio server(alsa) and clients (amarok) with a high priority "nice" setting with a large alsa buffer. This is much easier than RT-Linux.

The real power of Linux is it is much easier to hack and is far more powerful, configurable, and accessible for the average hacker than MS. You can also easily monitor every aspect of the audio stream with simple shell commands. The command line alone dwarfs anything you can do in MS Windows. I use Ubuntu. The best thing to do w/Linux would be to make your appliance IR-controllable using LIRC or roll your own IR controller. Thats what my current stereo is, a Linux box. Its fun to do and works great. Use a cheap monitor as a display.

As far as a 32-bit DSP software controlled volume control is concerned, I would think you would be limiting the resolution of your soundcards' DAC, which is really where Volume control is most flexible and least degraded, being that it likely does it using a VCA? but maybe someone else knows this for sure?

Technically it is "better" to use the Soundcards DAC to control the volume. If you are a real stickler, maybe add some "warmth" at lower levels to compensate for the human ears sensitivity to the corresponding frequencies. Some pro-audio gear has this feature added in.

just my $0.02
 
Administrator
Joined 2004
Paid Member
I'm using ubuntu 64 bit (Dapper Drake) with an Athlon XP64 and have been experimenting a little with Mozilla Songbird which just happens to have version for ubuntu 64 bit.. Works well and has features somewhat reminiscent of J River Media Center.

Have not really experimented much with Alsa, so far this exists only on my desktop and Ubuntu is os #2 on a dual boot machine. Unfortunately this desktop has integrated mediocre audio, my media server is exclusively windows..

There are couple of issues I'd mention after running a media server for a year.

Getting DeCSS to work so that dvd playback is possible is a pain and quite illegal here apparently..

The only way to play HDCD format material in native 20 bit mode in linux is with an external dac supporting HDCD, in WMP you can play back HDCD in 20 bit with a good 24 bit internal or external dac if you don't have an HDCD compatible dac. (If you have any HDCD disks which are often not marked, you'll want HDCD support - the difference in sound quality sometimes is not that subtle.)

I think the latency issue is relatively irrelevant for audio only playback, this becomes an issue with multi-channel audio with video and guess what - the audio usually needs to be delayed to keep in synch with the slower (higher latency) video codec. In recording latency is an issue if you are doing multitrack recording and/or monitoring feeds in real time.
 
My experiences with Linux (I've been working in the Linux environment for the past 3 years):

The latest versions of ALSA which are included with Ubuntu Edgy, and I think Dapper Drake as well, will resample all audio to 48kHz if your soundcard does not support hardware mixing. This is also true if the driver doesn't support hardware mixing. As far as I can tell, there is absolutely no support for hardware mixing with any of the Envy24 chips in Linux. The problem with this resampling is that by default ALSA uses a poor resampling algorithm to save CPU usage, and destroys the quality of everything played back. ALSA uses this software mixing and resampling in order to let more than one application play audio at the same time.

I have found a solution to the audio quality issue however. In recent versions of ALSA there was a plugin developed that can use better resampling algorithms at the expense of a little extra CPU usage when playing audio. However this plugin is not included in Ubuntu yet. I have compiled a package from source code in order to use this plugin. See my thread here. All you should have to do for best results is install the package and create a file in your home directory called .asoundrc (note the dot) and place this line in it:

defaults.pcm.rate_converter "samplerate"

Good luck with your Linux adventures.
 
kevinkr: Getting DeCSS to work so that dvd playback is possible is a pain and quite illegal here apparently..

Seriously, Its really not that hard if you just follow the instructions from the Ubuntu forums (download the script and run it).

The wonderful world of "Digital Rights Management" You think this is bad? Wait until Windows Vista's "content protection" and HDCP poison our media:
http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt

This issue brings up some of the sillier aspects of US/Canada/Brit law. It however directly affects all of us, Linux or no Linux.

Think about the ridiculousness of this, playing back a DVD which you own, on hardware that you own is illegal if the key is deduced using DeCSS as opposed to using a key supplied by the MPAA (i.e. a hardware DVD player) or whomever it is we are supposed to get keys from. It might be so, but I don't know anyone who obeys it, or is seriously intimidated by it. If it is illegal, then send me to prison and fine me and the other million or so Americans who do this everyday. Remeber anyone using DVD Shrink under windows to backup DVD's or other DVD copying software is guilty of breaking this silly law as well.

In other Linux/media related issues, it is also technically illegal to play back MP3, WMA, M4A, etc using Linux since the patented playback algorithms are reverse-engineered. This has nothing to do with the DMCA but overstretched Patent Law and a Lawyer saturated legislative system.

This is about our freedom to use our media, this stuff directly affects us audio geeks as well as Linux users and we should not be intimidated by it, rather we must fight to fix the broken laws and educate others on these laws. Our governments are restricting engineering and fair use because of a few ill-advised lawyers who don't comprehend the reprocussions of their actions. I don't think they intended to make criminals out of people who back up their DVD's or use Linux to play DVD's, but technically they did! They were just trying to keep people from ripping off content from the content distributors (not necessarily the artist) and look what they did!

Write your Congressmen or whatever the equivalent is in Canada and the UK. Do it on paper, not electronically:

http://www.house.gov/house/MemberWWW.shtml

People in other countries, one day you'll have to put up with this crap too, because you do business with Apple, Sony (remember the rootkits? WTF were they thinking?), Microsoft, BMI, ASCAAP, etc, and they will force this garbage down your throats too. They aren't totally evil companies, but companies have bad traits as well as good, just like people. Reward the good and punish the bad or the bad traits will get worse. Avoid buying/supporting DRM protected content and tell the companies you dislike it and the DMCA. Tell them why.
 
Administrator
Joined 2004
Paid Member
I guess it is all in what we regard trivial. It took me several hours to install deCSS which required me to install a C compiler and compile this code for Ubuntu. I had to download several additional libraries and a media player that works ok with deCSS. (64 bit issues??) I seem to recollect that recompiling the kernel was also necessary in the process. It was not a clean, simple install as so many things are in Ubuntu. For someone familiar with Windoz and new to linux it is actually sufficiently daunting as to be discouraging. Incidentally I was successful - more than I can say for running 32 bit wine under 64 bit dapper drake. (It should be possible, but balks at installing the required 32 bit libraries)

Scripts don't always work!

I totally agree with you on the drm issues, very frustrating and seemingly in conflict with fair use doctrine which is why I did it anyway.. :D
 
Ex-Moderator
Joined 2002
Not until idiots like me can use it. I keep banging on about this because I consider it important, Linux will never become commonly accepted until it gets over its geeky way of doing things. Unfortunately, I think the coders want to keep it that way, a sort of intellectual snobbery if you like.
 
Administrator
Joined 2004
Paid Member
I love Linux and will eventually make the transition, Ubuntu is pretty friendly, easy to use, and for the most part a breeze to configure. In my case running the 64 bit version makes things a lot harder, most of the scripts available for installing programs that are not part of the Ubuntu distribution don't always(/often) work in the 64 bit version.

In general scripts written for 32 bit Ubuntu don't work at all, and have to be modified. To install a 32 bit library to support a 32 bit application requires a forced install, and sometimes that still doesn't work.

I think Ubuntu is pretty good for general desktop use as delivered. I wish the deCSS and drm media file issue was not there, and for media use a little more work is still required. I mostly use flac, but cannot play wma or aac.. There are work arounds for aac, but it requires several steps to make files playable, no further details (sorry) but it would be great if Apple actually supported linux with versions of iTunes for RH/Suse/Ubuntu distros. (Perhaps there is a way to get the OSX version of iTunes to run under linux? Any thoughts??)

From an installation/configuration perspective I don't believe Linux is entirely ready yet for prime time. Oddly in Ubuntu anyway I think end user ease of use is about right where it needs to be. It's very good, just need ITE support for the occasional issue.. (job security?)
Once set it is extremely stable in my admittedly limited experience.
 
Re: Re: Linux Audio the way to go!?

pinkmouse said:
Not until idiots like me can use it. I keep banging on about this because I consider it important, Linux will never become commonly accepted until it gets over its geeky way of doing things. Unfortunately, I think the coders want to keep it that way, a sort of intellectual snobbery if you like.


I don't think you're right here!

These Linux folks are as much DIYer as we are in this forum, perhaps even more DIY than many people around here, by looking at the stuff they produce.

Did you ever have a look at e.g. Openoffice? This looks as good as MS stuff developed as
Opensource and beside that its fully compatible to MS, developed by a DIY community.

Get yourself a DVD with Ububntu 6.10 , or download the iso.image. It'll take you not more than an hour to get it all up and running incl. Internet - Openoffice and
most probably even audio. You don't need Unix knowledge to get it started.
It is mainly autoinstall. It just needs max. 4 gig space on your HD.

The audio quality delivered by the basic setup will be already better than any Microsoft setup.


When it comes to special configurations, it is getting tricky. I agree.
It takes some knowledge to get it done. My intention with this thread, was
to share this knowledge.
It took me a while to get the realtime-setup up'n running. Now it works.
You'll learn a lot by doing it!
The great side effect though, Unix specialists are rare in the IT world.
I think it's great to build up knowledge, gaining it while running your hobby.

However, just to put my Linux efforts into perspective, it took me ten times more to get my DAC and AMP ready and 20 times longer to get my speakers done.
So what's the issue by spending two, three days to get your source done!

It delivers audiphile sound quality and it is BTW all free of charge!

Cheers
 
GeWa said:
The last few days I'm experimenting with Pardus. The issues I had with Ubuntu, which I tried before, are non existing in this distro. It's a non well know Linux distribution, at least I never heard of it, but I can recommend it.

http://www.pardus.org.tr/eng/

Regards

Hi.

I tried quite some smaller audio distros before.
You won't get very much support on these.
That's a real problem. If you don't have to touch them they are OK. As soon as you
run into issues, you most probably won't be able to get the issues solved, which ends up dropping your project.
If you go for RedHat, Ubuntu, Suse you'll always have up2date stuff and lots of forums to discuss the issues.

For now, as a Linux beginner, I stay with the big ones.

I think that is actually the issue with Linux. Instead of focussing their limited powers on a few well done distributions, they widely spread their taskforce, which lowers quality and slows down the evolution in the end.

Cheers
 
You do not have to recompile a kernel to get DeCSS to work. Use: http://www.dtek.chalmers.se/groups/dvd/deb/
to download the package for your architecture (AMD64/i386, etc)

You probably did have to recompile to get fast disk access to play back DVD's since the motheroard manufacturers rarely release Linux drivers, the default IDE is slow, although I have seen more and more recently supported by manufacturers. No coding knowledge necessary, just the ability to follow diretions.

Pinkmouse, Please don' spread the false rumor that Linux is for coders. This statement is ignorant and may incite riots. I am no coder, ABSOLUTELY NO coding/hacking knowledge is needed to run any distro, especially Ubuntu, just a little DIY spirit, and the ability to follow directions. Some are easier than others, but no coding man! If it were hard no one would do it but coders, which is clearly not the case, considering who uses it.
 
Administrator
Joined 2004
Paid Member
Mainly we were talking about audio from pc's using linux. I added the dvd issue as sort of a red herring in regards to the differences in ease of configuration and media types supported in Windoz as opposed to Linux. (Devil's advocate) Incidentally I am a big fan of Ubuntu, so I wasn't saying it wasn't worth the effort.. :D
 
Linux for Audio

I think Linux audio for DIYers is very hard to beat. I use:

Hardware:
Intel Core Duo (Smithfield)
RME multiface
Triamped 3-way hybrid horn system (horn mids and tweets)
6 channel stepped attenuator for volume control

Software:
alsaplayer or xmms (soon to try aqualung)
jackd
qjackctl
brutefir
octave
DRC
qloud

I use octave to create FIR crossover filters, which I then plug into brutefir. Then I use DRC to measure the impulse response and do room correction. The large number of channels supported by the RME multiface and the amazing flexibility provided by jack makes this an incredibly flexible setup. For even more flexibility, I use the SPDIF input on the RME to get audio from a separate Windows box.
 
Re: Linux for Audio

houstonian said:
I think Linux audio for DIYers is very hard to beat. I use:

6 channel stepped attenuator for volume control

Very interesting setup. That's what I am looking at for the furture.
However, I havn't heard any filter, which is 100% transparent.
That's why I run my my PCM stream, without any manipulation, straight
to the DAC. What's your experience here?

Ever tried digital volume control?
I mean - you're manipulating the response digitally anyhow! On 24bit is should work quite well! Why still doing it on the analog side?
Did you ever come across a 32 bit float dsp volume control or similar under Linux!
I'd like to have some kind of plugin for a certain player application.

Are you running realtime-preemption? Which distro?
 
digital volume control

I have tried various approaches to digital volume control, and it works fine. The downside is that you are giving up resolution by doing so. That's why I switched to a stepped attenuator with a remote control. However, I still do not have it scaled quite right (the RME output is too high), so I at the moment I have some attenuation also built into my brutefir config, defeating the purpose of the stepped attenuator.

I have used jackrack's attenuator and it is very simple to use and effective. I have also use brutefir, and it works fine, but is not easy to adjust on the fly. I have a griffin USB volume wheel, and considered using that to control brutefir for volume control (should not be too hard to do), but opted for the analog attenuator instead.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.