Linux Audio the way to go!? - diyAudio
Go Back   Home > Forums > Source & Line > PC Based

PC Based Computer music servers, crossovers, and equalization

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 2nd January 2007, 03:56 PM   #1
diyAudio Member
 
soundcheck's Avatar
 
Join Date: Mar 2005
Location: D
Default Linux Audio the way to go!?

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.


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
  Reply With Quote
Old 2nd January 2007, 06:42 PM   #2
diyAudio Member
 
Join Date: Dec 2004
Location: Glasgow
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
  Reply With Quote
Old 2nd January 2007, 08:29 PM   #3
lm317t is offline lm317t  United States
diyAudio Member
 
Join Date: Dec 2006
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
  Reply With Quote
Old 3rd January 2007, 12:55 AM   #4
kevinkr is offline kevinkr  United States
diyAudio Moderator
 
kevinkr's Avatar
 
Join Date: Sep 2004
Location: Boston, Massachusetts
Blog Entries: 6
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.
__________________
"Extraordinary claims require extraordinary evidence." - Carl Sagan
  Reply With Quote
Old 3rd January 2007, 06:44 AM   #5
DcibeL is offline DcibeL  Canada
diyAudio Member
 
DcibeL's Avatar
 
Join Date: May 2003
Location: Saskatchewan
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.
  Reply With Quote
Old 3rd January 2007, 07:10 AM   #6
DcibeL is offline DcibeL  Canada
diyAudio Member
 
DcibeL's Avatar
 
Join Date: May 2003
Location: Saskatchewan
Wow, I just read the Hydrogenaudio thread linked above, and it turns out that telling xmms to play audio with plughw it bypasses dmix and does not resample my audio! This is amazing, I'm so happy I found out how to do this as I've been looking for information on howto bypass the resampling for about a while now.
  Reply With Quote
Old 3rd January 2007, 04:34 PM   #7
lm317t is offline lm317t  United States
diyAudio Member
 
Join Date: Dec 2006
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/~pgut00...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.
  Reply With Quote
Old 3rd January 2007, 04:50 PM   #8
kevinkr is offline kevinkr  United States
diyAudio Moderator
 
kevinkr's Avatar
 
Join Date: Sep 2004
Location: Boston, Massachusetts
Blog Entries: 6
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..
__________________
"Extraordinary claims require extraordinary evidence." - Carl Sagan
  Reply With Quote
Old 3rd January 2007, 05:05 PM   #9
diyAudio Moderator
 
pinkmouse's Avatar
 
Join Date: Apr 2002
Location: Chatham, England
Default Re: Linux Audio the way to go!?

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.
__________________
Rick: Oh Cliff / Sometimes it must be difficult not to feel as if / You really are a cliff / when fascists keep trying to push you over it! / Are they the lemmings / Or are you, Cliff? / Or are you Cliff?
  Reply With Quote
Old 3rd January 2007, 05:21 PM   #10
kevinkr is offline kevinkr  United States
diyAudio Moderator
 
kevinkr's Avatar
 
Join Date: Sep 2004
Location: Boston, Massachusetts
Blog Entries: 6
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.
__________________
"Extraordinary claims require extraordinary evidence." - Carl Sagan
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



New To Site? Need Help?

All times are GMT. The time now is 05:55 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2