Linux Audio the way to go!? - Page 111 - 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 22nd April 2009, 01:47 PM   #1101
diyAudio Member
 
soundcheck's Avatar
 
Join Date: Mar 2005
Location: D
Quote:
Originally posted by uli.brueggemann


Klaus,

as already written before read the brutefir code. It clearly shows that SND_PCM_FORMAT_S32_LE is assigned to the format definition for the three cases S16_4LE, S24_4LE and S32_LE.

So there is no difference between interpretation of S24_4LE and SND_PCM_FORMAT_S32_LE

Yes I have been in there (5 minutes ago).

That's OK. It just talks about bytes. Somwhere the bytes needs to get shifted.

What I'd need in the end is a stdin S24_4LE and and Alsa S24_LE on the output.

If we talk stdin I need to look into the bfio_file.c
  Reply With Quote
Old 22nd April 2009, 03:51 PM   #1102
diyAudio Member
 
soundcheck's Avatar
 
Join Date: Mar 2005
Location: D
Hi folks.


The workaround for brutefir is to increase the volume by 48db and to configure
in- and outputs as S24_4LE.
(I did not mange to get S24_4LE on input and S24_LE on output working)

brutefir config look s like:

Code:
filter "leftfilter" {       
from_inputs: "ileft"/-48;       
to_outputs: "oleft";       
process: 0;        
coeff: -1;                 
delay: 0;                
crossfade: false;  };

Cheers
  Reply With Quote
Old 22nd April 2009, 05:00 PM   #1103
diyAudio Member
 
soundcheck's Avatar
 
Join Date: Mar 2005
Location: D
I updated the Wiki with the 24/96 "workaround" configurations for brutefir and ecasound.

BUT PLEASE - WARNING:

You're adding 48db to the signal. Don't mix up your configurations.
You could easily fry your machinery.
Handle with care. Don't blame me, if you mess it up, I don't take any responsibility !!!!!!!!


Cheers
  Reply With Quote
Old 22nd April 2009, 06:43 PM   #1104
tbrooke is offline tbrooke  United States
diyAudio Member
 
tbrooke's Avatar
 
Join Date: Apr 2007
Location: China Grove, NC
Default MPD Brutefir

Has anybody worked with MPD and Brutefir - I would like a script to allow me to change bruterfir filters, adjust eq, volume etc. remotely for mpd.

Tom
  Reply With Quote
Old 22nd April 2009, 07:12 PM   #1105
diyAudio Member
 
uli.brueggemann's Avatar
 
Join Date: Nov 2006
May I add some considerations to the topic?

BruteFIR is computing with float numbers. It should be mentioned that the valid range for these numbers is -1= < x <= +1. The logarithm of 1 is 0 dB. Thus the maximum output to the soundcard is defined as 0 dB.

Now a 16 bit PCM soundcard does not know anything about the float representation. The range is from -2^15 <= x < 2^15 or -32768 <= x < 32768. So 32768 is considered then a 0 dB.

Reading a 16 bit wav thus means that the input has to be divided by 32768 to get a float number in the allowed range.

Similarly a 24 bit soundcard has a range of -2^23 <= x < 2^23. here the maximum value of 2^23 is considered as 0 dB. Reading a 24 bit PCM input requires a division by 8388608.

For the output to the soundcard the float number has to multiplied by the proper factor to get the right integer number (PCM).

So far so ok.

16 bit are specified as S16_LE, represented by 2 bytes.
But now it is possible to use a 16 bit input also with a 24 bit soundcard. As 0 dB input should also be 0 dB output the input number has to be shifted by 8 bit = factor 256 = 48 dB gain.

$ff$ff are then represented by $ff$ff$00

This should be also clear.

And now the game starts with 24 bit PCM. A computer typically does not like 3 bytes. 2 bytes is ok, also 4 bytes. And so some different formats are invented:
24 bits as $ff$ff$ff
24 bits as $ff$ff$ff$00
24 bits as $00$ff$ff$ff
Formats like S24_LE, S32_LE, S24_4LE or S24_3LE. A bit strange anyway.

It should be also clear that it is necessary to boost by an 8 bit shift to get an equivalent 32 bit PCM number with a given 24 bit PCM number.

What does it mean for a real application?

If a program sends data to BruteFIR then the input section must be able to read the data. And to interprete it correctly. It must read the right count of bytes and maybe it must shift it by 8 bits and it must convert it to a float number.

When BruteFIR sends data to a program or a soundcard it must prepare the data according to the specified program or soundcard format.

So we have different conversions in the game.

Now if Klaus has a S24_3LE output from MPD but Brutefir cannot understand this format he may use S24_4LE. BruteFIR will read 3 bytes and copy it to S24_4LE. An 48 dB boost it necessary to get the right size for the following integer-to-float conversion.
Then Brutefir will do its job.
Now when the result has to be sent to a soundcard it does not help to specify S24_4LE again. The soundcard may just need 24 bits and the specification S24_LE should do the job.

Input and output format are indenpendent and can be set independently.

We can read a wav track by specifying S16_LE, filter the data with BruteFIR and send the result to a soundcard with S24_LE.

I hope this long text helps to understand the problem.

Of course it will be confusing when we now connect a CD player sending 16 bit by spdif to our soundcard and specify the input S24_LE. This also works but only because the proper number of bytes is read and the interpretation is also done correctly. As we do not see outside what is happening we may be simply worried.

I have learnt to keep input and output as 2 different problems. First I always read a 16 bit wav track with Brutefir (this can be easily done with the config file and is 100% safe) and test the output configuration. When the output is working properly then I play with the intended input data and the according specification.

Keep things simple. Never change input and output specs at the same time.

  Reply With Quote
Old 22nd April 2009, 07:18 PM   #1106
diyAudio Member
 
uli.brueggemann's Avatar
 
Join Date: Nov 2006
Anders Torger has responded:

"I've noted since suddenly I've got several mails about this issue :-).
Anyway, I shall look into it, but I'm a bit busy the next few days.

And thanks for the interest in the software.

/Anders"

Ok, BruteFIR 1.0l is not too far away
  Reply With Quote
Old 23rd April 2009, 09:00 AM   #1107
diyAudio Member
 
soundcheck's Avatar
 
Join Date: Mar 2005
Location: D
Great to hear that Anders responded- At least he responds to you. "Several mails" - Hmmh - I just sent him one.

Uli:

Coming back to your long post:

Clarification: MPD sends out ALSA S24_LE ,
which is somehow not ( though I guess it should) the same as brutefir S24_4LE, which as we've seen in the code is actually a S32_LE.
We couldn't find anything for masking/handling of LSB/MSB 0 padding - correct?

With aplay I don't have to increase the volume by 48db. There must be something wrong with the MSB/LSB 0 padding.

I tried S24_4LE on the input and S24_LE on the brutefir output. It just gave me awful noise.


Cheers
Klaus
  Reply With Quote
Old 23rd April 2009, 06:03 PM   #1108
tbrooke is offline tbrooke  United States
diyAudio Member
 
tbrooke's Avatar
 
Join Date: Apr 2007
Location: China Grove, NC
Default BruteEQ

I answered my own questio n re: brutefir control and found BruteEQ but the link appears broken:

http://jukebox.privateradio.org/proj...fir/bruteq.php

Anybody know where I can get it

Tom
  Reply With Quote
Old 23rd April 2009, 07:09 PM   #1109
diyAudio Member
 
uli.brueggemann's Avatar
 
Join Date: Nov 2006
Quote:
Anybody know where I can get it
Tom,

I have sent it to your private email adress.
  Reply With Quote
Old 23rd April 2009, 08:22 PM   #1110
tbrooke is offline tbrooke  United States
diyAudio Member
 
tbrooke's Avatar
 
Join Date: Apr 2007
Location: China Grove, NC
Quote:
Originally posted by uli.brueggemann


Tom,

I have sent it to your private email adress.

Thank you Uli - I am thinking that MPD, bruteEQ etc. may ultimately be a better solution for an Acourate PC than than a memory stick

Tom
  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 11:57 PM.


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