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.
I do not think the existing implementation of FIFO output in MPD is suitable for high-end playback. The output module uses an internal timer (Timer) completely unrelated to downstream applications. If the FIFO is full and no bytes get written (errno == EAGAIN), it immediately flushes all the 64kB of unprocessed audio data from the pipe. If the downstream line runs at slightly slower pace (e.g. properly clocked by the sound card clock), eventually the pipe overflow will happen and 64kB of data (quite a lot) will be flushed.

There are many options for the output module:

1) open the pipe in blocking mode (potentially locking the whole application if downstream stops consuming data - the writer is a part of the main application thread),

2) sleep for a while (half the buffer playback time?), try to write again, flush the data only after several unsuccessfull write attempts

3) implement an independent writer thread opening the pipe in blocking mode

4) many others for sure.

Clearly the FIFO output is not aimed at quality playback, the timer is used only in fifo, null and shoutcast output modules.
 
Well, I have read through a lot of this thread a couple of times now, and decided (being reasonably encouraged by Foobar and SRC under XP giving good results into my Buffalo dac) that if there were good results to be had in the Linux route, then I should bite the bullet and give it a shot. I have never touched Linux before, so I expect a steep learning curve.

Having downloaded Ubuntu Studio as a starting point, I am now committed to pursue this. In attempting to install on a fresh 500gb drive alongside my existing XP build (all my synths and stuff loaded there) Grub has seemingly put my XP beyond reach (Error 17) and won't load into Linux.

I am sure that by removing the XP drives I can reload the UbStudio package and get a Linux machine working. Then I may be faced with a fresh install of XP and the prospect of a lengthy reload of my windows music environment. This is not critical but I have some great software that I would like to access.

I am probably too software illiterate to advance my Linux machine to the undoutbed state of the art, you guys are working at, but I hope (with maybe a little assistance from here) to get a stonking two channel replay set up to compete with my CDPro2 homebrew player.

Not an encouraging start though.

Mark
 
Goto said:
Well, I have read through a lot of this thread a couple of times now, and decided (being reasonably encouraged by Foobar and SRC under XP giving good results into my Buffalo dac) that if there were good results to be had in the Linux route, then I should bite the bullet and give it a shot. I have never touched Linux before, so I expect a steep learning curve.

Having downloaded Ubuntu Studio as a starting point, I am now committed to pursue this. In attempting to install on a fresh 500gb drive alongside my existing XP build (all my synths and stuff loaded there) Grub has seemingly put my XP beyond reach (Error 17) and won't load into Linux.

I am sure that by removing the XP drives I can reload the UbStudio package and get a Linux machine working. Then I may be faced with a fresh install of XP and the prospect of a lengthy reload of my windows music environment. This is not critical but I have some great software that I would like to access.

I am probably too software illiterate to advance my Linux machine to the undoutbed state of the art, you guys are working at, but I hope (with maybe a little assistance from here) to get a stonking two channel replay set up to compete with my CDPro2 homebrew player.

Not an encouraging start though.

Mark

Hi there.

You've taken the right decision to move from XP to Linux. Bad luck that it didn't really work out so far.

You need to be careful during the partitioning phase! - the only tricky thing during the installation.

You most probably ran into that trap and messed up your partitions.

Have a look at the numerous how-tos around.

Gotta run.

Good luck.
 
Mark,

you should not give up, the cure may be very simple.

Error 17 means grub cannot find the partition at the location defined by the configuration file. Mostly the reason is that BIOS sees the drives in a different order than linux did when grub was being configured/installed during ubuntu installation.

What happens if you swap the drives booting order in BIOS?

See http://users.bigpond.net.au/hermanzone/p15.htm#Common_Booting_Errors_and_Some_Possible

Playing with drives can affect mental health, I have gone crazy with grub many times :)
 
Goto said:


While the increased security, robustness, and performance of Linux are good to have, I find the most interesting thing Linux gives you is that you are in control and can do whatever you want. Of course, the other side of that coin is that you gotta know what you're doing and how to fix stuff when the installer screws up.

Anyway, back to your HDD problems : your Windows installation is fine, do not reformat yet. It is unreachable, but fine.

Perhais you have BIOS set to make SATA drives appear as IDE drives ; in this case the order of the drives can change, or perhaps some drives won't even be seen, or grub will have a different idea of what your drives are than Linux ! So, please configure everything as SATA AHCI if you use Linux on an Intel mobo. Besides, SATA AHCI is faster (I get 200 MB/s on my RAID lol).

I don't know which version of Ubuntu you used ; it it is 8.10 be aware that it is a beta and it has bugs, for instance the installer can barf up. 8.04 works perfectly fine on my rig though.

Most likely your problem is the installer misconfiguring Grub. This can be fixed without reinstalling.

Please boot on a Linux Live CD and open a console. Type :

sudo su

(You are now root)

So you have 2 harddisks. First question is, which harddisk is windows and which is Linux ?

In Linux harddisks are called
- /dev/sda, dev/sdb, etc... if SATA,
- /dev/hda, /dev/hdb, etc... if PATA.

So, are you SATA or PATA ? I'll suppose you have SATA and your two harddisks are /dev/sda and /dev/sdb

Now type :

cfdisk /dev/sda

You will see the partitions of drive sda. Hit Q to quit and do the same for sdb.

You will then know which drive has your Linux and which one has your Windows, by noticing that one drive has a partition of type NTFS and another has partitions of type linux, swap, etc.

I have this on the Linux system :

sda1 Bootable Primary Linux ext3 509,97 MB
sda2 Linux swap 1020 MB
sda3 Linux ext3 202391 MB

Now you know that this hdd has a Linux on it. The question you need to answer is, where is the /boot ? In this case sda1 is the /boot partition with grub installed. You can see that because it's a small (500MB) bootable partition with ext3 filesystem. In your case perhaps you dont' have this and only have a large ext3 bootable partition ; this is the default config. In this case it will probably be /dev/sdb2 or something.

You'll probably write something like this on your paper :

windows -> /dev/sda1
linux boot -> /dev/sdb2

Now you know what Grub needs to know. Grab a Grub tutorial on the 'net, install grub on your first harddisk, and quit grub.

Now you need to mount your linux partition and check the grub config :

mkdir /mnt/linux
mount /dev/sdb2 /mnt/linux
(note : use the right partition instead of sdb2)
cd /mnt/linux
cd boot/grub/
ls

you should see a file named menu.lst ; edit this file with vim or nano, ath the bottom of the file you'll see something like this :

title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd1,1)
kernel /boot/vmlinuz-2.6.24-19-generic root=/dev/sdb2 ro
initrd /boot/initrd.img-2.6.24-19-generic
quiet

you'll need to correct the "root" line and the "root=", putting the references to your harddisks. The values above are correct if your linux is on /dev/sdb2.

note that sdb2 is the second partition (2) of second harddisk (sdb). grub starts from 0 so it calls this (hd1,1). The root= parameter is passed to Linux kernel so it uses standard linux notations.

also uncomment the "hiddenmenu" line (remove the #) cause you want the menu !

you can remove the "quiet" parameter so you get lots of log on the screen, much more useful than a frozen progress bar if something goes wrong !

If Grub barfs BEFORE displaying the menu, then it was not correctly installed. Use a grub tutorial.

If Grub barfs AFTER displaying the menu, then the "root hd(whatever)" line in your config is not correct.

If linux kernel boots (displaying lots of stuff) and then barfs saying it can't mount root filesystem, then the parameter root=/dev/sdwhatever is incorrect.

Remember your windoze is not screwed, all it need to run is that you tell the Grub where to find it. The windows part in the file is the one with "chainloader +1", you will need to correct the "root" statements for it to run.


Good luck ;)
 
peufeu said:


Remember your windoze is not screwed, all it need to run is that you tell the Grub where to find it. The windows part in the file is the one with "chainloader +1", you will need to correct the "root" statements for it to run.


Right.

You forgot to mention that GRUB call disks and partitions as (hdX,Y) where X and Y are 0-based integers. X is the disk number and Y the partition number (on disk X).

Thus for GRUB the 1st partition on the 1st HDD is (hd0,0) while for Linux that would be /dev/hda1 or /dev/sda1 (Linux use letters for disks and 1-based integers for partitions). Unfortunately, this may be rather confusing... :cannotbe:
 
Mark,

good to hear you are heading forward.

First about your card:
-----------------------
Ice1712 in your audiophile 2496 has 5 stereo channels, PCM Out 1 - PCM Out 10. Four stereochannels are used for DACs (other chips on the sound card board), the fifth is connected to ice1712's internal SPDIF transmitter.

Ice1712 has an internal digital mixer. All input/output channels enter the mixer, each channel has a digital volume control - see tab Monitor Mixer of envy24control.

As a source of each physical output (HW Out 1-8, SPDIF Out L/R) you can choose either its corresponding PCM Out channel or any of input channels. In addition to that, for the first stereo output (HW Out 1/2) and the SPDIF output you can select also output of the digital mixer. Now the tab Patchbay / Router of envy24control should make sense.

Volume control functions of the DAC chips are available on the tab Analog Volume.

Now about the SW side:
-------------------------
The command "aplay -l" will show you there are several stereo analog output devices and one IEC958 (i.e. SPDIF) stereo output. The first device corresponds to PCM Out 1/2, second to 2/3, ..., SPDIF to 9/10. These are raw devices. Configuration files in alsa define more convenient devices which take the raw devices and add new features (mixing, automatic rates conversion, proper setting of certains controls, etc).

The device "default" is configured to support SW mixing (more applications can play audio at the same time), automatic rates/formats conversion to fit ice1712 requirements. It is hooked to the first stereo analog output of the card. By default, applications output to this device.

The device "spdif" is hooked to SPDIF output (PCM Out 9/10) plus sets appropriate SPDIF output flags (not important in this moment). Try playing some wav using

aplay -v -Dspdif some.wav

Now to your situation. On ubuntu config screens you changed the output device of gnome (ubuntu desktop environment) from the "default" to the "spdif" device. Therefore, you could hear the test sound produced by the new setup.

However, most applications have their own setup and are still set to default (the first stereo ouput, front).

You have several options.

Either change output of each required application to spdif.

Or you could use the internal digital mixer of ice1712 I talked about above and switch the SPDIF outputs to digital mixer outputs. The digital mixer would have to take only PCM Out 1/2, with its volume set at 100%. That way the "default" output would be available on the SPDIF output too.

BTW, all alsa controls available in alsamixer/envy24control can be set using the command line utility amixer which gives you endless options of scripting startup scripts for various applications. But it will probably take a while before you find usage for such "hacks" :)
 
soundcheck said:
phofman/peufeu:

All this is probably scaring off new Linux entrants! ;)
................
you'll love its and your flexibility.

Scaring off? Dead right!

I found this thread and got most enthused ... but soon cooled off. I would love to use Linux for DSP and multichannel sound with active crossovers. But when I installed the OS on my PC a couple of years ago and found I can't even install downloaded files without writing command lines full of /a, -p, etc, I realised I'll have to be patient. I know the OS's have come along since then, but I'm still waiting ...

If only Linux could be operated without writing script and command lines even for basic actions. I mean, I am sooo over DOS!
 
tnargs said:


Scaring off? Dead right!

I found this thread and got most enthused ... but soon cooled off. I would love to use Linux for DSP and multichannel sound with active crossovers. But when I installed the OS on my PC a couple of years ago and found I can't even install downloaded files without writing command lines full of /a, -p, etc, I realised I'll have to be patient. I know the OS's have come along since then, but I'm still waiting ...

If only Linux could be operated without writing script and command lines even for basic actions. I mean, I am sooo over DOS!

Of course you need to consider that this thread is mainly about "hacking" Linux.
The current Linux installations are extremely stabil and run on most of the PCs
without problems. Ubuntu Studio is always a bit more tricky than standard Ubuntus.
UStudio does not seem to have the manpower to get at the level of Ubuntu/Kubuntu.

I am currently playing a lot with the new Kubuntu 8.10 and its KDE4.1.2/Plasma (on a 5 year old Notebook!) . I like it very much. There is IMO no other OS around which can compete with this window-manager.
I am looking forward to KDE4.2. which brings finally the KDE4 ported Amarok and Digikam.
With Openoffice 3.0 Linux will be almost MS compatible for the average user.

Let see how things are developing. ;) In any case you might want to try a new Kubuntu - Intrepid Ibex.

Cheers
 
I thought Ubuntu studio has the whole OS tweaked to allow the best performance in audio playback and even if we do not need any of the programs that comes with the package, it this the OS to use?

Would there be any difference with Kubuntu with a patched Kernel Vs Ubuntu Studio with the same kernel?
 
tnargs said:


If only Linux could be operated without writing script and command lines even for basic actions. I mean, I am sooo over DOS!

Tnargs,

I understand your concern about the command line. On the other hand, when you learn the power, speed, and flexibility it gives you, I dare to say you will appreciate it.

E.g. running movies for my son: An icon for the fairy-tale series DVD on desktop runs a short script which makes sure the movie ALWAYS works:

* turns on SPDIF output
* switches SPDIF mode to "non-audio" to make sure AVR recognizes DD/DTS
* turns off analog output so that headphones stay quiet
* kills any SW using the SPDIF output device to make sure the DVD player has access to the device
* and for each chapter on DVD:
*** outputs large graphical "current story / total. nb. of stories" on the second Xinerama screen (TV out)
*** plays the current chapter in mplayer switched to fullscreen mode on TV-out, zoomed to 120% (4:3 TV vs. 16:9 DVD), spdif output passthrough mode, window on every desktop to make sure it is visible no matter what I am doing on the main LCD.

Such simple script makes playing pre-defined movies trivial even for my wife :) I have no idea how to make such functionality without the command line interface.
 
I still haven't persuaded Alsa, or Audacious to give me music at the SPDIF output of the soundcard. I have tried adjusting the output options in the app to match match the settings shown against the hardware test config, to no avail.

On the plus side, I now a have a robust dual boot setup, so I can go into XP and listen to music with Foobar upsampled to 96k via SRC. I have added a ramdisk to my (depleted/optimised) XP set up, so I can load a full EAC cd image and stream from Ram.

I now realise I need to learn much about Linux, get under the hood, and be patient. I have downloaded Dyne:bolic and may have a poke around with this, see if I can get the SPDIF output going on that environment.

Is it worth aiming for a usb output stream that I can then convert to feed my Buffalo?

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