Peoples,
I'm about to launch into a debugging session to see why mp3gain
(http://mp3gain.sourceforge.net/ ) and madplay 0.15.1b don't seem to be
playing together (no pun intended). I thought I'd ask if anyone has used
the two together yet, or if there is another linux-based replaygain
processor (for adding replaygain to existing mp3s) that is more reliable.
map3gain does appear to be adding a tag, as it finds it again if rerun
over the same file.
"# mp3gain /tmp/Abracadabra.mp3
/tmp/…
[View More]Abracadabra.mp3
Recommended "Track" dB change: -1.690000
Recommended "Track" mp3 gain change: -1
Max PCM sample at current gain: 28533.063680
Max mp3 global gain field: 180
Min mp3 global gain field: 116
Recommended "Album" dB change for all files: -7.490000
Recommended "Album" mp3 gain change for all files: -5"
madplay doesn't appear to find it:
"# madplay -G -Tv /tmp/Abracadabra.mp3
MPEG Audio Decoder 0.15.1 (beta) - Copyright (C) 2000-2004 Robert Leslie
et al.
Title: Abracadabra
Artist: The Steve Miller Band
Album: Golds Greatest Hits
Track: 11
Year: 1982
Genre: Vocal
Encoder Version: LAME 3.92
VBR Method: constant
Bitrate: 255+ kbps
Stereo Mode: normal
Preset: none
Unwise Settings: no
Encoding Flags:
Lowpass Filter: 19500 Hz
ATH Type: 2
Noise Shaping: 1
Surround: none
Start Delay: 576 samples
End Padding: 1503 samples
Source Rate: 44.1 kHz
Music Length: 9948263 bytes
Audio Frames: 11900"
(note the missing "Replay Gain" printout I expect after reading the source)
I'd hasten to add that I suspect mp3gain of doing something wrong, not
madplay. I'm guessing the tag is wrong or in the wrong place.
Any info would be appreciated, otherwise I'll report my findings to the
list when I discover the root cause.
/Bruce
[View Less]
> is that the DAC runs autonomously, and interrupts when it wants more
> data.
> I can't 'choose' how fast to give it samples. As the CPU and DAC
> clocks
> won't be exactly synchronised, over time I'll end up with either too
> many
> or too few samples in my buffer.
Not if you buffer in between. Since decoding MPEG-frames is independant of
clocking, you can run this as fast or slow as you like. Just decode a bit
faster if the buffer you're using to feed the DAC is …
[View More]running below a certain
treshhold and halt decoding of input-frames if the buffer gets to full.
Or what I did, decode always as fast as possible and try to keep the
input-buffers as full as possible. This will allow usage of smaller buffers.
The only problem there is, that of course you need to be in control of your
MPEG-stream. That is, it needs to be from an asynchronous source like a disk
and not from a synchronous like a live network-stream (like shoutcast).
But in that case, the problem is not the difference between the CPU clock
and the DAC clock, but the source-clock (for instance shoutcast-server) and
your DAC-clock. That is a standard, but not easy to solve problem.
If that is the case, indeed you have this problem:
> I guess I need to add or delete samples, either by changing the
> buffer or
> by adjusting the resampling ratio slightly. My question is when to
> do it
> and how much to adjust.
You may not believe how many commercial products just use one buffer and
when it runs out, stall the whole system untill new data is there, and
simply trow samples away. Usually the clock-differences are so small we are
talking about just a few samples per hour or less!
Of course if your product doesn't allow this, you need to take care of this
in a better way, but the solution is hard. Look for instance how it is done
in network protocols like RTP/RTCP/etc.
Regards,
Armin
[View Less]
> > I'm planning to use MAD in a streaming application. I have no
> > control over
> > the incoming data rate, although it is ostensibly CBR data with a
> > fixed
> > sample rate. Similarly, the processing rate of the decoded
> samples is
> > controlled by the DAC. So inevitably sooner or later I'll get a
> > buffer
> > overflow or underflow.
>
> So if I understand, the input can be for instance 128kbps or
> 160kbps, but
> the …
[View More]DAC expects a fixed rate of PCM samples? I don't see a
> problem then,
> since the rate of PCM samples is independent on the bitrate of the
> MPEG-stream. So your PCM-samples will be delivered to the DAC
> with always
> the same speed.
Thanks. I do know the sample rate (in fact, I need to resample the data
from typically 48000Hz mono to 22050Hz stereo after the decode). My problem
is that the DAC runs autonomously, and interrupts when it wants more data.
I can't 'choose' how fast to give it samples. As the CPU and DAC clocks
won't be exactly synchronised, over time I'll end up with either too many
or too few samples in my buffer.
I guess I need to add or delete samples, either by changing the buffer or
by adjusting the resampling ratio slightly. My question is when to do it
and how much to adjust.
The contents of this email and any attachments are sent for the personal attention
of the addressee(s) only and may be confidential. If you are not the intended
addressee, any use, disclosure or copying of this email and any attachments is
unauthorised - please notify the sender by return and delete the message. Any
representations or commitments expressed in this email are subject to contract.
ntl Group Limited
[View Less]
Currently in my MP3 player (using libmad) I have to scan through an entire
mp3 to calculate an accurate playtime and build up a random access seek
table.
On the platform I'm using, this can be very slow taking 3 minutes plus for a
35 minute vbr file.
Is there a better way of calculating the length of an mp3 if it isn't in the
id3 tag, and/or a better way of jumping to a certain time frame within an
mp3 without having scanned the entire thing beforehand?
TIA!
Yours Unwhettedly,
Robert John …
[View More]Shepherd.
Editor
DVD REVIEWER
The UK's BIGGEST Online DVD Magazine
http://www.dvd.reviewer.co.uk
For a copy of my Public PGP key, email: pgp(a)robertsworld.org.uk
[View Less]
> I'm planning to use MAD in a streaming application. I have no
> control over
> the incoming data rate, although it is ostensibly CBR data with a
> fixed
> sample rate. Similarly, the processing rate of the decoded samples is
> controlled by the DAC. So inevitably sooner or later I'll get a
> buffer
> overflow or underflow.
So if I understand, the input can be for instance 128kbps or 160kbps, but
the DAC expects a fixed rate of PCM samples? I don't see a problem …
[View More]then,
since the rate of PCM samples is independent on the bitrate of the
MPEG-stream. So your PCM-samples will be delivered to the DAC with always
the same speed.
The problem can occur, if the data has also an unknown samplerate (32kHz or
44,1kHz for instance).
I had this problem with a network-streaming-device. The MPEG input could and
would vary from time to time and this would happen completely randomly. As
long as you have some buffering in front of MAD, the decoder has no problem
in handling this since it will decode CBR frame by frame.
Handling sample-rate changes is more difficult. I added also a small amount
of double buffering after the MAD library and I added a small check after
the MAD decoder, to see whether the samplerate changed compared to the
previous sample. (And for instance 'stereoness' - although that is easy to
handle: simply copy the channel to L+R).
If a samplerate change was detected, it would switch buffers at once to have
the decoded frames with the new samplerate go into the second buffer, while
the DAC was still fed from the first. When the first buffer was emptied
under a certain level, I would activate a samplerate conversion function on
the second buffer. When the first buffer was then empty, the DAC would be
fed from that moment on with the converted second buffer, and new decoded
samples would enter the first buffer and the process would repeat itself
until that buffer was full or another sample-rate conversion was detected.
Regards,
Armin
[View Less]
Hi
Could anyone send me across information about porting the MADLIB for 16 bit
fixed point DSPs (either the 54x or 55x)
Regards
Balaji Shanmugam
_________________________________________________________________
NRIs ! http://go.msnserver.com/IN/52616.asp FREE money transfers to India.
Hi,
I'm planning to use MAD in a streaming application. I have no control over
the incoming data rate, although it is ostensibly CBR data with a fixed
sample rate. Similarly, the processing rate of the decoded samples is
controlled by the DAC. So inevitably sooner or later I'll get a buffer
overflow or underflow.
Any suggestions how best to handle this? I'm sure someone must have been
here before and I don't want to reinvent wheels.
Thanks.
The contents of this email and any …
[View More]attachments are sent for the personal attention
of the addressee(s) only and may be confidential. If you are not the intended
addressee, any use, disclosure or copying of this email and any attachments is
unauthorised - please notify the sender by return and delete the message. Any
representations or commitments expressed in this email are subject to contract.
ntl Group Limited
[View Less]
Hi Rob
I am new in using the MAD Library and upon working with the code, I have got
doubt in the Scaling (1st operand shifted right by 12 and 2nd operand
shifted right by 16) being done during the mad_f_mul operation.
I like to know about the sbsamples from the IMDCT routine. Is it in Q4.28
format. If so why we need to scale it down during SYNTHESIS Filter
operation. I have read the comments in fixed.h telling that
" * The scale factors are constant as this is not used with SSO.
*
* Pre-…
[View More]rounding is required to stay within the limits of compliance.
"
I like to know how this scaling has been taken care in the further
calculations.
Please find below my doubt.
I have defined as FPM_DEFAULT and doesnt define OPT_SPEED.[OPT_SSO will be
defined as FPM_DEFAULT is defined]. With that the mad_f_mul (A,B) is defined
as [((A+(1L<<11))>>12) * ((B+(1L<<15))>>16)]
This has been used during the synth_full operation. When the synth_full
function calls the dct32() function,
sbsamples<2><2><576> (in Q28.4 format) from IMDCT is passed on to the
function where it will be multiplied with costab<1..31>.
During this multiplication the mad_f_mul MACRO is used. After that the
result from dct32 is stored as the filter output. While storing the filter
output, the multiplied value is scaled down by a factor of 12.
Then windowing[D array values being scaled down by 12] was applied over the
filter ouput and the PCM output is stored with a scale down of 2.
The operation of SSO is understandable but the intial scaling that happens
with the mad_f_mul MACRO needs explanation.
Thanks in advance
Balaji Shanmugam
_________________________________________________________________
News, views and events. Hot downloads n pictures.
http://www.msn.co.in/Cinema/ Get it all at MSN Cinema!
[View Less]
Hi
I too have started doing most of the stuffs in asm rather than going for C
functions. The first thing that I am concentrating is the SYNTH function.
Bt still since i am following the LONG calculation(Q28.4) instead of Q15.1,
mine is still vulnerable for timing issues. It will be gr8 help if you
could send me across your version (16 bit arithmetic and Q15.1 for 55X) of
MAD decoder for my reference.
Thanks in advance
Balaji Shanmugam
>From: "Grigory A." <Ryhor(a)tut.by>
>…
[View More]Reply-To: "Grigory A." <Ryhor(a)tut.by>
>To: "balaji shanmugam" <balajiami(a)hotmail.com>
>CC: mad-dev(a)lists.mars.org
>Subject: Re: [mad-dev] MAD library for TI-54X DSPs
>Date: Wed, 21 Jul 2004 09:58:50 +0900
>
>Hi Balaji!
>
>I have ported MAD to TI-55xx. I used Q1.15 format and 16 bits
>arithmetics for all calculation. As result of this is:
>
>limited accuracy ISO/IEC 11172-3 audio decoder
>
>according to
>http://www.underbit.com/resources/mpeg/audio/compliance/
>
>Yes - synthesis step of decoding is most calculation intensive part.
>I've used a little different method to port MAD to TI-55xx DSP -
>instead of providing "arithmetics macro" for given platform I've
>rewrite on DSP asm all calculation intensive functions (8 or 9 ?). So
>I think this is a better way in case if someone need close to optimal
>implementation for given hardware platform. Only you need to do is
>to rewrite these asm functions for your platform.
>
>I can send you my implementation of decoder. And maybe it is better to put
>it to
>MAD site? Because I've sent it several times before to other people
>and this question is arisen again and again :). In additional I have
>same style implementation of MAD for sp3R5m DSP (www.3dsp.com) this
>one is 32 DSP core and in this case "fully compliant" decoder is
>obtained.
>
>
>
>Tuesday, July 20, 2004, 11:25:28 PM, you wrote:
>
>bs> Hi
>bs> I am trying to port the MAD library for the TI-54X DSP and running into
>bs> tight timing issues. When analysed, I found out that the 54X DSP takes
>more
>bs> instructions to perform LONG calculations at the SYNTHESIS FILTER Bank
>stage
>bs> as it is a 16 bit processor [but with a 40 bit accumulator]. As it is
>bs> required to perform 72 times the DCT32 and the remaining MATRIX
>calculations
>bs> at the SYNTH stage, I like to optimize the synthesis filter bank.
>bs> I am not sure about using the Q28.4 format being used by MAD. Is there
>bs> anyway we can use the Q15.1 format for the calculations?
>bs> I like to know is there any hints or clues for the LONG calculations
>that I
>bs> can make use of during my 54X porting phase. Also any thought about
>using
>bs> the NORM instruction to round the final samples to 16 bit will be
>helpful.
>
>bs> Regards
>bs> Balaji Shanmugam
>
>bs> _________________________________________________________________
>bs> Marriage?
>bs> http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 Join
>bs> BharatMatrimony.com for free.
>
>
>
>--
>Best regards,
> Grigory mailto:Ryhor@tut.by
>
_________________________________________________________________
Get head-hunted by 10,000 recruiters. http://go.msnserver.com/IN/46246.asp
Post your CV on naukri.com today.
[View Less]
Hi
I am trying to port the MAD library for the TI-54X DSP and running into
tight timing issues. When analysed, I found out that the 54X DSP takes more
instructions to perform LONG calculations at the SYNTHESIS FILTER Bank stage
as it is a 16 bit processor [but with a 40 bit accumulator]. As it is
required to perform 72 times the DCT32 and the remaining MATRIX calculations
at the SYNTH stage, I like to optimize the synthesis filter bank.
I am not sure about using the Q28.4 format being used …
[View More]by MAD. Is there
anyway we can use the Q15.1 format for the calculations?
I like to know is there any hints or clues for the LONG calculations that I
can make use of during my 54X porting phase. Also any thought about using
the NORM instruction to round the final samples to 16 bit will be helpful.
Regards
Balaji Shanmugam
_________________________________________________________________
Marriage? http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 Join
BharatMatrimony.com for free.
[View Less]