Linux Audio the way to go!? - Page 91 - 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 16th January 2009, 02:45 PM   #901
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally posted by Onvinyl
Hi,
one question:
The DAC chip of my onboard sound system claims to have a 20 Bit PCM Resolution .

shouldn't that mean, if I set the parameters in ecasx to
bit=20
srcrate=48000
See, the ecasx is a script, you can easily read what it does. Please do not hesitate to consult man pages of the individual tools used, it will give you insight in what your computer actually does.

The soundcard consists of two parts:

1. communication part (PCI, USB, FW, etc.)

2. DAC receiving data from the communication part, usually via some standard format e.g. I2S, Intel HDA, AC97, etc.

Resolution of your DAC is only loosely linked to the resolutions accepted by your communication part (e.g. the soundcard itself), only to the point it is logically the same or larger. Most soundcards accept int32, some ancient int16 only. The STAC DAC of Prodigy 192 accepts 20bits, AKM DAC of Juli accepts 24 bits, they both are hooked to ice1724 (envy24) accepting int32 only.

If your alsa setup uses the plug plugin (mostly the case unless you use plain hw:0 alsa device), the plugin takes care of the format conversion automatically. Some applications provide the conversion too. Since your DAC is almost definitely not better than 24 bits, any final (!) conversion between int64, int32, int24, float64, float32 has no effect on the data entering your DAC.

Quote:
that the chip does not resample the pcm stream?
No, if the input data are not equal to the resampling fs of the chip, it will always resample. The DACs that resample to more than 192kHz will always do the resampling, only using fewer x2 stages correspondingly if fed with higher fs.
  Reply With Quote
Old 16th January 2009, 03:27 PM   #902
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Quote:
Originally posted by phofman




No, if the input data are not equal to the resampling fs of the chip, it will always resample. The DACs that resample to more than 192kHz will always do the resampling, only using fewer x2 stages correspondingly if fed with higher fs.
My intention was the other way round: is it asssured, that the stream isn't touched if the sample rate equals the samplerate of the dac?

Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 16th January 2009, 04:54 PM   #903
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Quote:
Originally posted by soundcheck


I'll send it over in a minute. Let me know what you think.

Cheers
Klaus
Hi, the scirpt worked smooth, very cool.
I will comment on the sound as soon I can get a decent soundcard.

I had problems with an unsanely big file (600MB wav), where playback stopped halfways through. I have 2GB RAM and highrammode=true.

great thing, keep it up!

Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 17th January 2009, 10:58 PM   #904
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Hi,
what is the correct implementation of the brutefir ouput in your mpd-brutefir chain, Klaus?

this doesn't seem to work:

output "ileft", "iright" {
device: "alsa" {hw:0,0}; # die soundkarte stimmt, aber ich hör nix
sample: "S16_LE"; # sample format
channels: 2/0,1; # number of open channels / which to use
delay: 0,0; # delay in samples for each channel
maxdelay: -1; # max delay for variable delays
mute: false,false; # mute active on startup for each channel
dither: false; # apply dither
};

Any hint would be appreciated,
Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 18th January 2009, 09:13 AM   #905
diyAudio Member
 
soundcheck's Avatar
 
Join Date: Mar 2005
Location: D
How about this?

Code:
input "ileft", "iright" {
      device: "file" {path: "/tmp/mpd.fifo"; };  # module and parameters to get audio
      sample: "S16_LE";   # sample format
      channels: 2/0,1;    # number of open channels / which to use
      delay: 0,0;         # delay in samples for each channel
      maxdelay: -1;       # max delay for variable delays
      mute: false,false;  # mute active on startup for each channel
};

output "oleft", "oright" {
      device: "alsa" {device: "hw:0,0"; ignore_xrun: true; };  # module and parameters to put audio
      sample: "S16_LE";   # sample format
      channels: 2/0,1;    # number of open channels / which to use
      delay: 0,0;         # delay in samples for each channel
      maxdelay: -1;       # max delay for variable delays
      mute: false,false;  # mute active on startup for each channel
      dither: true;       # apply dither
};

You might also try plughw instead of hw as alsa-device.

Cheers
  Reply With Quote
Old 18th January 2009, 10:03 AM   #906
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Hi,
there seems to be another issue. When starting brutefir, it quits saying no filters defined. Additionally, I cannot start it with as sudo chrt -f -p 80 ./brutefir -daemon, I have to type brutefir sudo chrt -f -p 80 brutefir -daemon

Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 18th January 2009, 10:38 AM   #907
diyAudio Member
 
soundcheck's Avatar
 
Join Date: Mar 2005
Location: D
Here is the complete "stereo" config and some instructions.

Setup a brutefir base dir. Copy the entire content of your brutefir sourcedir incl compiled binaries over there.
I personally skip "make install". I keep everything in one location.

You should remove now the old brutefir binaries from /usr/bin or /usr/local/bin

Make sure that the PATH inside your .bashrc is referring to your brutefir basedir. e.g. /home/juergen/brutefir

This way you can run brutefir and the other related binaries from any place.
The above brutefir basedir you should add to your bash shell PATH variable in .bashrc

gedit ~/.bashrc

find the line starting with PATH
change your whatever basedir base you've chosen.

PATH=$PATH:/home/juergen/brutefir

save it. And open a new terminal

Type
echo $PATH
now you should see the brutefir basedir as part of the chain

CONFIG "brutefir-mpd.conf" for stereo-output and fifo input:

Code:
# 1 ".brutefir_defaults"
# 1 "<built-in>"
# 1 "<command line>"
# 1 ".brutefir_defaults"

float_bits: 64;             # internal floating point precision
sampling_rate: 44100;       # sampling rate in Hz of audio interfaces
filter_length: 1024,2048;       # length of filters
overflow_warnings: false;    # echo warnings to stderr if overflow occurs
show_progress: false;        # echo filtering progress to stderr
max_dither_table_size: 0;   # maximum size in bytes of precalculated dither
allow_poll_mode: false;     # allow use of input poll mode
modules_path: "/home/juergen/brutefir";          # extra path where to find BruteFIR modules
monitor_rate: false;        # monitor sample rate
powersave: false;           # pause filtering when input is zero
lock_memory: true;          # try to lock memory if realtime prio is set
convolver_config: "/home/juergen/brutefir/.brutefir_convolver"; # location of convolver config file

coeff "dleft" {
        filename: "dirac pulse";
        format: "text";     # file format
        attenuation: 0.0;   # attenuation in dB
	blocks: -1;         # how long in blocks
	skip: 0;            # how many bytes to skip
	shared_mem: false;  # allocate in shared memory
};

coeff "dright" {
        filename: "dirac pulse";
        format: "text";     # file format
        attenuation: 0.0;   # attenuation in dB
	blocks: -1;         # how long in blocks
	skip: 0;            # how many bytes to skip
	shared_mem: false;  # allocate in shared memory
};


input "ileft", "iright" {
      device: "file" {path: "/tmp/mpd.fifo"; };  # module and parameters to get audio
      sample: "S16_LE";   # sample format
      channels: 2/0,1;    # number of open channels / which to use
      delay: 0,0;         # delay in samples for each channel
      maxdelay: -1;       # max delay for variable delays
      mute: false,false;  # mute active on startup for each channel
};

output "oleft", "oright" {
      device: "alsa" {device: "hw:0,0"; ignore_xrun: true; };  # module and parameters to put audio
      sample: "S16_LE";   # sample format
      channels: 2/0,1;    # number of open channels / which to use
      delay: 0,0;         # delay in samples for each channel
      maxdelay: -1;       # max delay for variable delays
      mute: false,false;  # mute active on startup for each channel
      dither: true;       # apply dither
};

filter "leftfilter" {
      from_inputs: "ileft";
      to_outputs: "oleft"/0;
      process: 0;        # process index to run in (-1 means auto)
      coeff: -1;          # -1 means "copy"
      delay: 0;           # predelay, in blocks
      crossfade: false;   # crossfade when coefficient is changed
};

filter "rightfilter" {
      from_inputs: "iright";
      to_outputs: "oright"/0;
      process: 1;        # process index to run in (-1 means auto)
      coeff: -1;
      delay: 0;           # predelay, in blocks
      crossfade: false;   # crossfade when coefficient is changed
};

You'd be able to start brutefir, once you have started mpd playback with


chrt -f -p 80 brutefir -nodefault -deamon /home/juergen/brutefir/brutefir-mpd.conf

make sure that the fifo /tmp/mpd.fifo exists.

Cheers
  Reply With Quote
Old 18th January 2009, 10:53 AM   #908
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Thanks,
this cleared the filter thing to me!

We're getting closer, but there is still something wrong:

I get the following messages (only relevant part):

Audio processing starts now
Alsa I/O: underflow! (write on, 0)
Alsa I/O: Could not restart audio: file descriptor in bad state

With other programs the alsa driver is working

Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 18th January 2009, 11:13 AM   #909
diyAudio Member
 
soundcheck's Avatar
 
Join Date: Mar 2005
Location: D
This is what I was trying to tell you.

You need to start mpd "playback" on the fifo output "FIRST"
Then there won't be any <EOF>, no timer inits, no fifo flushes. or whatever stuff
generated by mpd.

Then you start the brutefir deamon. It then hooks up on the fifo.

If you try to do it the other way around you'll get exactly your error message.

You can't use start/stop within MPD once it is running. Just next/prev/pause.
Otherwise brutefir will jump out.

If you go some posts back phofman and myself were discussing exactly this problem.
I also opened a thread in the MPD forum.

It seems that brutefir just expects a pure raw datastream from the fifo, as it would be
done in a normal pipe.

Cheers
  Reply With Quote
Old 18th January 2009, 11:25 AM   #910
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Well, this is what I get when I start brutefir with MPD already playing. The fifo exists and is routed in mpd.config, mpd starts without complains. then I start brutefir and get the posted message

Rüidger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  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 09:06 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