Log in

View Full Version : Aften 0.0.8 is out


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 [13] 14 15 16 17 18 19 20 21 22 23

mltan
5th June 2007, 10:15
Hi everyone, finally i get to post at this thread.

Anyway, thanks justin and wisodev for the replies! very much appreciated. :thanks:

Just a little background, I am currently trying to do 2 things (under the windows OS):
1. build a stand alone ac-3 encoder from ffmpeg
2. create win32 binaries of Aften on my own

Unfortunately, the documentation only has instructions for building Aften using Cmake under Linux. So I'm trying to do wisodev's way for building aften right now.

i was wondering if there are any available resources that can show a step by step guide on building win32 binaries of Aften encoder using kurtnoise way, building Cmake under Windows, or any other methods.

aften does a really good job i must say. really interesting. thanks in advance!

- mark

Kurtnoise
5th June 2007, 12:36
@Tebasuna : many thanks. Ok so, the problem is not on my side.

@mltan : post #301 (http://forum.doom9.org/showthread.php?p=894151#post894151)from this thread...I think it's a good start. For cvs, you can use TortoiseCVS. Very easy to use and contains an installer. Same thing for MinGW package. Anyway, you can find some doc all around the web.

tebasuna51
12th June 2007, 10:47
@Kurtnoise13
Bad news. Aften rev521 dont work at all (command line or pipe mode) in a Pentium Dual Core with Windows Vista Basic.

All wisodev v0.07 compiles work fine.

Kurtnoise
12th June 2007, 12:23
my builds do not support multithreading...:-/

JuanC
13th June 2007, 04:00
@Kurtnoise13
Bad news. Aften rev521 dont work at all (command line or pipe mode) in a Pentium Dual Core with Windows Vista Basic.
All wisodev v0.07 compiles work fine.
I've used Kurt's rev521 with -threads 1

It works in my c2d.

tebasuna51
13th June 2007, 10:18
I've used Kurt's rev521 with -threads 1

It works in my c2d.

Is true, work.

@Kurtnoise
Then, if the alternate option is a crash in MT systems, why not use -threads 1 like default instead -threads 0 (detect)?

You only need add in aften/opts.c:
...
84 opts->pad_start = 1;
85 opts->read_to_eof = 0;
86 opts->s->params.n_threads = 1;
...
At least the crash occurs only when explicitly add the -threads parameter with a value other than 1.

Kurtnoise
13th June 2007, 17:32
yeah, that's a workaround but I'm not really satisfied with it. I'll try something new.

Anyway, I think I should stop to build Aften right now. Wisodev's builds are more appropriate for this.

DarkAvenger
17th June 2007, 17:22
@tebasuna51

Does it crash? Could you be more specific or even try to debug with gdb? I would really like to get the mingw compile going instead of deactivating a feature.

tebasuna51
17th June 2007, 19:22
@tebasuna51

Does it crash? Could you be more specific or even try to debug with gdb? I would really like to get the mingw compile going instead of deactivating a feature.
Only can offer this:
http://img238.imageshack.us/img238/6564/aften521fz4.gif (http://imageshack.us)

And debug with gdb is chinese for me.

gruntster
21st June 2007, 15:49
libaften.dll (R522) crashes here everytime for me:

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 816.0x2b0]
sse2_process_exponents (tctx=0x684af90)
at c:/dev/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.0/include/emmintrin.h:1028
1028 return (__m128i)__builtin_ia32_psubb128 ((__v16qi)__A, (__v16qi)__B);
(gdb) bt
#0 sse2_process_exponents (tctx=0x684af90)
at c:/dev/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.0/include/emmintrin.h:1028
#1 0x003321da in encode_frame (tctx=0x684af90, frame_buffer=0x9307f38 "")
at c:/Dev/aften/libaften/a52enc.c:1344
#2 0x00333b08 in aften_encode_frame (s=0x61a5610, frame_buffer=0x9307f38 "",
samples=0x67ed020) at c:/Dev/aften/libaften/a52enc.c:1493
#3 0x00419d43 in AUDMEncoder_Aften::getPacket (this=0x8e70030,
dest=0x9307f38 "", len=0x930ff38, samples=0x930ff3c)
at c:/Dev/avidemux_2.4_dev/avidemux/ADM_audiofilter/audioencoder_aften.cpp:150
#4 0x00525864 in defaultAudioQueueSlave (context=0x61bee80)
at c:/Dev/avidemux_2.4_dev/avidemux/ADM_toolkit/ADM_audioQueue.cpp:39
#5 0x611812fa in ptw32_threadStart@4 ()
from c:\dev\avidemux_2.4_build\pthreadGC2.dll
#6 0x780085bc in endthreadex () from C:\WINNT\system32\msvcrt.dll
#7 0x06140e20 in ?? ()
#8 0xffffffff in ?? ()
#9 0x40000060 in ?? ()
#10 0x0508e6a8 in ?? ()
#11 0x00000000 in ?? ()


Compiled using MinGW and GCC 4.2.0.

Any ideas? :confused:

Thanks.

DarkAvenger
21st June 2007, 16:37
Could your try to make a debugging build with -O0 -g3 and try again? Pass -DCMAKE_BUILD_TYPE=Debug along with the flags. I don't understand what is the problem with the threaded dll.

gruntster
21st June 2007, 16:45
I built it with CFLAGS -g3 -O0 but not CMAKE_BUILD_TYPE=Debug. I'll redo it.

Other users can use the DLL fine but it crashes on my single and dual core PCs running Windows 2000, XP & Vista.

gruntster
21st June 2007, 17:13
I get the same inflated filesize and same backtrace.

If I comment out the HAVE_SSE2 define in config.h and rebuild, the DLL works.

Anything else I can try?

DarkAvenger
21st June 2007, 18:15
It still seems gcc doesn't get the aligning right. COuld you try changing in the line with

__m128i vexp2 = _mm_load_si128((__m128i*)&exponents_blk[i]);

in file x86_sse2_exponent.c the "load" to "loadu"?

update: I just commited this, since I got sick of it. Please sync to svn and try again.

gruntster
21st June 2007, 18:32
Unfortunately it still crashes:


sse2_process_exponents (tctx=0x684b008)
at c:/dev/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.0/include/emmintrin.h:695
695 *__P = __B;


The rest of the callstack (from #1) is the same as before.

I'm not that familiar with gdb. Can I set a breakpoint somewhere and step through the code to find the offending line?

update: cross-compiler build also crashes

DarkAvenger
21st June 2007, 19:27
??? Now I am really puzzled. When I find time, I'll try to reproduce it on the single core machine...

A quick guess: Could you change _mm_store_si128 to _mm_storeu_si128?

gruntster
22nd June 2007, 15:00
A quick guess: Could you change _mm_store_si128 to _mm_storeu_si128?

No change :(

DarkAvenger
22nd June 2007, 16:58
OK, I could reproduce it and I found the cause:

http://gcc.gnu.org/ml/gcc-help/2007-01/msg00231.html

Unfortunately that "fix" leads to segfault at the end, probably because the stack gets messed up and not cleaned up properly. Anybody who wants to play around getting mingw and threads going with SIMD, please have your luck.

So I am probably going to disallow threads usage on windows if compiled with mingw. msvc has no problems. Please compile using msvc, you get it for free with the express edition.

gruntster
22nd June 2007, 17:24
Thanks for looking into it.

Aften's threads setting is set to 1 (handle->params.n_threads=1). Shouldn't this disable Aften's use of threads?

DarkAvenger
22nd June 2007, 18:46
Where did you see that setting? I couldn't locate it.

gruntster
22nd June 2007, 18:50
Sorry, I mean we set threads to 1 straight after calling aften_set_defaults.

I thought this would have disabled Aften's multithreading?

DarkAvenger
22nd June 2007, 23:08
Depends, init actually detects the cpus and thus sets the number of threads, but if you set the n_threads paramter (see below) to one, aften should run single threaded.


ctx->n_threads = (ctx->params.n_threads > 0) ? s->params.n_threads : get_ncpus();
ctx->n_threads = MIN(ctx->n_threads, MAX_NUM_THREADS);

gruntster
23rd June 2007, 21:46
I'll go with MSVC8 for the time being then.

Obviously SSE3 isn't supported but I'm guessing this probably won't impact on speed much anyway.

I've compiled it with the /MT option to remove msvcr80.dll as a dependency and everything works a treat.

Thank you for your efforts!

jruggle
8th July 2007, 06:26
I have restructured the audio input framework for the Aften commandline program. The major reason for this change was to support raw pcm input. The new framework will also make it easier to add support for other audio formats.

There are 3 new commandline options in rev526.

[-raw_fmt X] Raw audio input sample format (default: s16_le)
One of the pre-defined sample formats:
u8, s16_le, s16_be, s20_le, s20_be, s24_le, s24_be,
s32_le, s32_be, float_le, float_be, double_le, double_be
[-raw_sr #] Raw audio input sample rate (default: 48000)
[-raw_ch #] Raw audio input channels (default: 2)

DarkAvenger
8th July 2007, 10:01
I commited some stupid hack for maybe making it possible to use mingw with windows threads. Perhaps somebody wants to try it? I at least works on my single core windows machine now usng 2 threads w/o crashing.

Kurtnoise
14th July 2007, 09:30
Works fine here too...:)

http://kurtnoise.free.fr/index.php?dir=Aften/&file=aften_rev531.zip






edit: slightly off-topic but...Justin, can we start to test the eac3 decoder from the FFmpeg soc project or is it too much early right now ?

jruggle
14th July 2007, 12:46
edit: slightly off-topic but...Justin, can we start to test the eac3 decoder from the FFmpeg soc project or is it too much early right now ?

Please do! It is definitely early, but it could be very useful. In fact, we're running into sort of a road block in that we can't find samples which use the any of the enhanced features in the specification. So the more people that test it, the more likely we are to get reports of better samples. The hope is that the sooner we get the decoder into the mainline FFmpeg repository, the better chance we have of getting good samples before the end of the summer.

edit: let me elaborate. The AC-3 specification provides a separate bitstream format for Enhanced AC-3. This bitstream format allows for some more advanced features which lead to better compression vs. quality, and also allows for higher bitrates. Well, so far, the samples we've found which use the enhanced format only take advantage of the higher bitrate. In fact, they actually use less compression features than standard AC-3 since the higher bitrate makes it less necessary. This is a problem because we can't fully test the decoder.

honai
14th July 2007, 15:00
In fact, they actually use less compression features than standard AC-3 since the higher bitrate makes it less necessary.

That's interesting observation. A great many HD-DVD/Blu-ray reviews claim how titles with 640kbps EAC3 audio were better sounding than "all previous formats" - including DTS at 768kbps and 1536kbps. Looks like those claim might turn out to be pure conjecture ...

jruggle
14th July 2007, 15:09
That's interesting observation. A great many HD-DVD/Blu-ray reviews claim how titles with 640kbps EAC3 audio were better sounding than "all previous formats" - including DTS at 768kbps and 1536kbps. Looks like those claim might turn out to be pure conjecture ...

I don't know much about the quality of DTS, but I doubt that 640kbps could sound better than 1536kbps even with all the enhanced features. This claim may very well be true though, and we just haven't been lucky enough to find the right samples.

totya
17th July 2007, 11:18
Hi, in #1 I read this :

For whose who prefer GUIs instead of command lines, I've made a small one.

This is immediately crashed on my Core2 system. I think this is small error, beacuse if I use aften.exe from aften-0.07-win32-bin\exe_pgo_sse3_MT, works correctly with AftenGUI ver 1.4.

Thank you, this is great audio encoder application.

Kurtnoise
17th July 2007, 11:58
You need Aften rev 531 or higher if you use my own builds...

totya
17th July 2007, 12:18
You need Aften rev 531 or higher if you use my own builds...

Possible you don't understand for me (my english is poor).

1. I downloaded "AftenGUI-1.4.zip", OK.
2. Unpack this, OK
3. Running, encoding start - crashed.

If AftenGUI-1.4.zip is bad, why available on the your www site?

4. If I change/swap aften.exe to aften-0.07-win32-bin\exe_pgo_sse3_MT\aften.exe, Aften Gui works correctly.

Boulder
17th July 2007, 12:21
Kurtnoise13 meant that if you use his Aften.exe builds, you need rev 531 or higher. There's nothing wrong with the GUI itself, it's aften.exe that crashed.

totya
19th July 2007, 12:27
Kurtnoise13 meant that if you use his Aften.exe builds, you need rev 531 or higher. There's nothing wrong with the GUI itself, it's aften.exe that crashed.

OK, I know, suggest : 1. repack 1.4 GUI (zip) without aften.exe, or 2. repack 1.4 GUI (zip) with latest aften.exe - and no problem.

This is very good encoder, and GUI too, thank you.

Nikos
20th July 2007, 13:45
I am a litle confused.
What is the right command line to encode 6 mono wav to AC3 5.1 with aften?
The help from aften.exe say nothing for 6 mono wav.

Kurtnoise
20th July 2007, 15:24
I am a litle confused.
What is the right command line to encode 6 mono wav to AC3 5.1 with aften?
The help from aften.exe say nothing for 6 mono wav.

For the moment, you can't do that directly. First, you need to create a .mux file :
C:\channelFL.wav
C:\channelC.wav
C:\channelFR.wav
C:\channelSL.wav
C:\channelSR.wav
C:\channelLFE.wav

Then, via BeSweet to create the command line :
BeSweet -core( -input myfile.mux -output myoutput.ac3 -logfile mylog.log ) -bsn( -exe aften.exe -b 448 -6chnew -chmap 1)

aften.exe and bsn.dll (http://kurtnoise.free.fr/index.php?dir=BeLight/&file=bsn_20070513.zip) are both of course required. There is probably an other way with the help of avisynth & SoundOut plugin...

Nikos
20th July 2007, 16:13
Thank you Kurtnoise13, now i am not confused :)

tebasuna51
20th July 2007, 19:27
There is probably an other way with the help of avisynth & SoundOut plugin...
To complete the Kurtnoise13 post, here the AviSynth methods necessaries for big files not supported by BeSweet.

First, you need to create a merge.avs file :
fl = WavSource("G:\channelFL.wav")
fr = WavSource("G:\channelFR.wav")
fc = WavSource("G:\channelC.wav")
lf = WavSource("G:\channelLFE.wav")
sl = WavSource("G:\channelSL.wav")
sr = WavSource("G:\channelSR.wav")
MergeChannels(fl, fr, fc, lf, sl, sr)

a) Now you can use a few methods to convert this .avs to ac3

a-1) BeHappy (http://www.box.net/shared/nkihizx1dh), a GUI method with more options like Delay, Trim, Resample, TimeStretch, ..., and other encoder options like mp4, ogg, flac, ... (.NET FrameWork v2.0 required)

a-2) BePipe, a command line tool with the syntax:
"G:\BePipe.exe" --script "Import(^G:\Merge.avs^)" | "G:\Aften.exe" -pad 0 -readtoeof 1 -b 448 - "G:\Output.ac3"
(.NET FrameWork v2.0 required)

a-3) Wavi (http://forum.doom9.org/showthread.php?p=1019016#post1019016), another command line tool, without .NET FrameWork v2.0 dependency, but slow than BePipe. The syntax:
"G:\Wavi.exe" "G:\Merge.avs" - | "G:\Aften.exe" -pad 0 -readtoeof 1 -b 448 - "G:\Output.ac3"

b) Also you can use the AviSynth plugin SoundOut (http://forum.doom9.org/showthread.php?t=120025).
Now you need add at end of Merge.avs this line:
SoundOut(output="cmd", filename="g:\Output.ac3", autoclose=true, type=0, executable="g:\aften.exe", prefilename="-pad 0 -readtoeof 1 -b 448 -")

To do the conversion you can choice between:

b-1) Open the Merge.avs with any tool with avs support, like VirtualDub. The conversion run automatically, after you can close VirtualDub.

b-2) With a command line tool like avs2avi (http://www.avs2avi.org/). The syntax:
"G:\avs2avi.exe" "G:\Merge.avs" -c null -q -e

If the last line included in the avs file is only SoundOut(), without parameters, a GUI is open to select the encoder and the parameters.

@Kurtnoise13
Your .mux have the proper order for ac3enc.dll but not for Aften if you don't use the -chmap 1 parameter.

quantum
22nd July 2007, 02:57
@tebasuna51
Awesome instructions. Thanks for putting it together. Tested and working using the wavi method.

Nikos
22nd July 2007, 03:40
Thanks tebasuna51 for the valuable information.

This is the wav channel mapping FL, FR, C, LFE, SL, SR.
This is the ac3 channel mapping FL, C, FR, SL, SR, LFE.
I am correct or not?
Is there any other channel mapping e.g LPCM?

One more question, which is the difference between Lt/Rt and Lo/Ro downmix preferred in -dmixmod switch?

tebasuna51
22nd July 2007, 11:26
This is the wav channel mapping FL, FR, C, LFE, SL, SR.
This is the ac3 channel mapping FL, C, FR, SL, SR, LFE.
I am correct or not?
Yes, you are correct, this is the internal order of each format (with MicroSoft spec's for wav).
Is there any other channel mapping e.g LPCM?
I think FL, FR, C, SL, SR, LFE and big-endian format instead little-endian values.
One more question, which is the difference between Lt/Rt and Lo/Ro downmix preferred in -dmixmod switch?
From a_52b document:
"Two types of downmix should be provided: downmix to an LtRt matrix surround encoded stereo pair; and downmix to a conventional stereo signal, LoRo."

Susana
22nd July 2007, 16:59
is there some specific program to know the bsi of an ac3 ?

I know Azid can be used, but the info is very limited; also Sonic Soft Encode can be used, with a more complete info, but is very slow importing a complete (normal) stream.

thanks

jruggle
22nd July 2007, 17:04
Thanks tebasuna51 for the valuable information.

This is the wav channel mapping FL, FR, C, LFE, SL, SR.
This is the ac3 channel mapping FL, C, FR, SL, SR, LFE.
I am correct or not?
Is there any other channel mapping e.g LPCM?


There is also MPEG channel mapping, which is C, FL, FR, SL, SR, LFE.

Formats which use the same mappings:
WAVE and FLAC (this is also called SMPTE or ITU channel mapping)
AC-3 and Vorbis
DTS and any MPEG audio (mp2, mp3, aac, etc...)

DarkAvenger
28th July 2007, 11:02
I just commited changes to the SIMD detection. It is now done via compiler-independant inline assembly so that nasm and yasm won't be necessary anymore. I tested with gcc on linux, mingw on windows and msvc orcas (nmake generator). I would appreciate tests, esp with icc.

Anima123
31st July 2007, 10:08
jruggle:

Is psychoacoustic implementation in your recent todo list?

HeadBangeR77
31st July 2007, 10:17
Welcome all :)

After few months without encoding literally anything I did some transcodes of AC3 448 kbps into AC3 384 kbps, using Aften 0.7 sse build by Wisodev and the latest SoundOut 1.0.3. I must state it was damned quick, even though I've reduced the OC of my system because of the recent heat waves in Europe. Very good job, nice to discover some improvements after some time!

:thanks:

Is the latest Kurtnoise13's build (rev. 531) generic or optimized for any kind of CPUs?

EDIT: Thanks for the quick explenation, Kurtnoise13!

Kurtnoise
31st July 2007, 12:19
Is the latest Kurtnoise13's build (rev. 531) generic or optimized for any kind of CPUs?
Mine's optimized for MMX, SSE, SSE2, SSE3.

ak
31st July 2007, 12:55
I just commited changes to the SIMD detection. It is now done via compiler-independant inline assembly so that nasm and yasm won't be necessary anymore. I tested with gcc on linux, mingw on windows and msvc orcas (nmake generator). I would appreciate tests, esp with icc.
Shared lib build seems affected (x86, gcc-4.1.2), with -fPIC it breaks with:

/usr/bin/gcc -DAFTEN_BUILD_LIBRARY -Wno-switch -Wextra -Wfloat-equal -Wdisabled-optimization -pedantic -Wall -Wpointer-arith -Wredundant-decls -Wformat -Wunused -fvisibility=hidden -Wdeclaration-after-statement -Wbad-function-cast -std=gnu99 -O2 -march=athlon -mtune=athlon -fomit-frame-pointer -pipe -funroll-loops -fomit-frame-pointer -fPIC -I/tmp/aften/build -I/tmp/aften -I/tmp/aften/libaften -I/tmp/aften/aften -I/tmp/aften/pcm -I/tmp/aften/libaften/x86 -I/tmp/aften/bindings -DHAVE_CONFIG_H -DHAVE_GCC_VISIBILITY -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -o CMakeFiles/aften.dir/libaften/x86/x86_cpu_caps.o -c /tmp/aften/libaften/x86/x86_cpu_caps.c
/tmp/aften/libaften/x86/x86_cpu_caps.c: In function ‘cpu_caps_detect’
/tmp/aften/libaften/x86/x86_cpu_caps.c:53: error: PIC register ‘%ebx’ clobbered in ‘asm’

DarkAvenger
31st July 2007, 16:13
@ak

Thx for the report, I fixed it. Must check whether msvc it likes it, as well...

totya
31st July 2007, 16:16
Thank you, "AftenGUI-1.4.zip" is now correct (only GUI).