Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Flake vs Flac and the -Ax2 switch (Read 31140 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Flake vs Flac and the -Ax2 switch

Reply #25
Yes, it's happening with all AIFF and Wav Files I tried. Maybe it's some kind of Big Endian Bug in libpcm_io? Then also Sparc, MIPS & MC68000 Machines will be affected.
I might try to make an Amiga crosscompile under FreeBSD to see if it only affects PPC or all Big Endian architectures.
I've made a SVN build on my PPC iMac maybe a year ago and that one works without problems. That's why I didn't fully test it in first place.

Hopefully it is just a big-endian issue.  I used to have remote access to a PPC machine to test on, but libpcm_io has been modified a lot since then and it looks like a bug creeped in.

Quote
Another weird thing:
With very noisy music (Death Metal, Japanese Noise, Industrial) the compression ratio is like this:
[best] flake -12 > flac -8 -A tukey\(0.5\) -A flattop > flac -8 > flake -8 [worst]
but with very silent music (Piano Sonatas, String Quartets) it is like this:
[best] flac -8 -A tukey\(0.5\) -A flattop > flac -8 > flake -12 > flake -8 [worst]

For the noisy music, that is about what is expected.  The higher number of prediction coefficients in level 12 would certainly help in modelling the noise a little better.  flake -8 and flac -8 should be relatively close.  As for the quiet music, I have come across a few "lossless killer" samples, which are mostly complex classical music.  There is one I have that actually compresses much better with flac -8 than not only flake, but also La and wavpack...  I have not spent significant time analyzing it yet.

Flake vs Flac and the -Ax2 switch

Reply #26
Maybe libsndfile (http://www.mega-nerd.com/libsndfile/) would be a better choice than libpcm-io? it works flawlessly on Big Endian and Little Endian machines and supports a lot of sound file formats. I haven't had a look  yet if it's a lot of work to switch to libsndfile.

The Adagio sostenuto from Beethovens "Mondschein Sonata" played by Daniela Rusó is one of those classical pieces where FLAC is much better than Flake. On most other musical pieces Flake -12 wipes the floor with FLAC.
WavPack 4.50.1 -hhx6 | LAME 3.98.2 -V 0

Flake vs Flac and the -Ax2 switch

Reply #27
Maybe libsndfile (http://www.mega-nerd.com/libsndfile/) would be a better choice than libpcm-io? it works flawlessly on Big Endian and Little Endian machines and supports a lot of sound file formats. I haven't had a look  yet if it's a lot of work to switch to libsndfile.

I'm not too keen on depending on an external library, but I might add a compile option for it.  It would not be too difficult to do.  Flake used to work just fine on big endian, and I will still try to fix the issue.

Flake vs Flac and the -Ax2 switch

Reply #28
Maybe libsndfile (http://www.mega-nerd.com/libsndfile/) would be a better choice than libpcm-io? it works flawlessly on Big Endian and Little Endian machines and supports a lot of sound file formats. I haven't had a look  yet if it's a lot of work to switch to libsndfile.

I'm not too keen on depending on an external library, but I might add a compile option for it.  It would not be too difficult to do.  Flake used to work just fine on big endian, and I will still try to fix the issue.

I added support for libsndfile in Flake SVN r249.  Until I do more testing, it will not be enabled by default.  To use it, run CMake with the option -DUSE_LIBSNDFILE=yes.

Flake vs Flac and the -Ax2 switch

Reply #29
I just did a quick test under i386 Linux. libsndfile works perfectly. I've successfully encoded WAV, AIFF, FLAC (works only if you have a libsndfile.so.1 in /usr/lib with FLAC support) and WAVEX 6-channel. I couldn't encode AU and Vorbis Files, even with a libsndfile supporting those formats.
The biggest problem is that most players doesn't support variable blocksizes. The only ones i found so far that played flake -9 and upwards are Totem and Cynthiune. The audioeditors Jokosher and Audacious can also read variable blocksize. Most players just skip variable blocksize files, JavaTunes even crashes. Flake -8 and below works everywhere without problems.

I'll test on PPC this evening. Thanks a lot for the quick and great work 
WavPack 4.50.1 -hhx6 | LAME 3.98.2 -V 0

Flake vs Flac and the -Ax2 switch

Reply #30
Thanks to libsoundfile Flake also works now on OS X PPC again:

16 Bit AIFF: works flawlessly
16 Bit WAV: works flawlessly
8 Bit WAV: encodes, but the audio is distorted
6-channel WAVEX: works flawlessly
FLAC: untested because I compiled libsndfile without FLAC support.

Cog and Play are both able to playback variable blocksize files.
WavPack 4.50.1 -hhx6 | LAME 3.98.2 -V 0

Flake vs Flac and the -Ax2 switch

Reply #31
I couldn't encode AU and Vorbis Files, even with a libsndfile supporting those formats.

That's interesting.  I'll try to work out how to fix this if I can.  Maybe I need to use the API in a different way for it to work.

Quote
The biggest problem is that most players doesn't support variable blocksizes. The only ones i found so far that played flake -9 and upwards are Totem and Cynthiune. The audioeditors Jokosher and Audacious can also read variable blocksize. Most players just skip variable blocksize files, JavaTunes even crashes. Flake -8 and below works everywhere without problems.

I was afraid of that...  My guess is that it is because of the FLAC format change in 1.2.0 which added a flag in the frame header to indicate variable blocksize.  I'm going to leave it as-is though.  If it's something else then knowing which players don't work would at least allow me to report it to the developers.

...
8 Bit WAV: encodes, but the audio is distorted

Thanks for the tests.  The 8-bit WAV not working is probably signed vs. unsigned.  I thought libsndfile would take care of that, but I guess not.  I'll try to fix it.

Flake vs Flac and the -Ax2 switch

Reply #32
I just tested a 8SVX File (on i386 Linux). It encodes, but the resulting FLAC File is silent.
I also tried my Cowon A3 PMP, and to my surprise it is able to play variable blocksize files 
The software players I've tested that doesn't play VBS are Audacious (skip), Amarok (skip), Dragon Player (skip), VLC (skip), MPlayer (skip), Codeine (skip), Kplayer (crash) and JavaTunes (crash). xine starts with a short noise but plays those files. Aqualung, Totem, Cynthiune, Elisa, Kaffeine (only in Xine mode, in Gstreamer mode it stays silent), Cog and Play work without problems.

Here are some fresh r255 compiles for Linux i386 and OS X 10.5 PPC. A libsndfile with FLAC support and a small install script is included.
WavPack 4.50.1 -hhx6 | LAME 3.98.2 -V 0

Flake vs Flac and the -Ax2 switch

Reply #33
I also tried my Cowon A3 PMP, and to my surprise it is able to play variable blocksize files 

I have an A3 as well.    I'm amazed at what files I can throw at it.

Quote
The software players I've tested that doesn't play VBS are Audacious (skip), Amarok (skip), Dragon Player (skip), VLC (skip), MPlayer (skip), Codeine (skip), Kplayer (crash) and JavaTunes (crash). xine starts with a short noise but plays those files. Aqualung, Totem, Cynthiune, Elisa, Kaffeine (only in Xine mode, in Gstreamer mode it stays silent), Cog and Play work without problems.

Thank you so much for the info.  I'm very surprised VLC and MPlayer don't work.  It appears all those players are open source, so I will have a look at their FLAC code and see if I can send some patches in.  I'm confident that I can at least get MPlayer fixed.

edit: latest MPlayer and Amarok 2 work fine for me with variable blocksize files.  I haven't tried the others you mentioned, but I will soon.

edit2: There seem to be 2 main culprits.  xine-lib 1.1 branch uses the FFmpeg FLAC decoder from at least as long ago as Nov 2007, maybe older.  JavaTunes uses jFLAC, which also does not have the 1.2.0 format change, which was released 7/23/2007.  I definitely won't change Flake to support decoders that are that old.  xine-lib 1.2 branch uses libFLAC from what I can tell, so it should be ok.

Flake vs Flac and the -Ax2 switch

Reply #34
Ahh ok. On my Kubuntu 9.04 I still have Amarok 2.0. I hope there will be a deb for 2.1 soon. Probably my MPlayer is also a bit outdated.

I'm having problems to compile r255 with libsndfile support on FreeBSD 7. cmake isn't able to find libsndfile. I've copied the libsndfile to /usr/lib, /usr/local/lib and /lib ... neither seems to be the right place. cmake version is 2.6.3, maybe 2.6.4 might work better ...
WavPack 4.50.1 -hhx6 | LAME 3.98.2 -V 0

Flake vs Flac and the -Ax2 switch

Reply #35
I'm having problems to compile r255 with libsndfile support on FreeBSD 7. cmake isn't able to find libsndfile. I've copied the libsndfile to /usr/lib, /usr/local/lib and /lib ... neither seems to be the right place. cmake version is 2.6.3, maybe 2.6.4 might work better ...

Is it a compiling problem or a linking problem?  The cmake version probably would not matter.  It's using a custom cmake script which just tries to compile and link a small test file.

Flake vs Flac and the -Ax2 switch

Reply #36
Quote
...
8 Bit WAV: encodes, but the audio is distorted

Thanks for the tests.  The 8-bit WAV not working is probably signed vs. unsigned.  I thought libsndfile would take care of that, but I guess not.  I'll try to fix it.

The issue with encoding 8-bit when using libsndfile is now fixed in SVN.

Flake vs Flac and the -Ax2 switch

Reply #37
I have an A3 as well.    I'm amazed at what files I can throw at it.


Probably quite off-topic, but I just tested my brand new Sandisk Sansa Fuze, and it doesn't support variable blocksizes  It plays, but quite fast (setting -9, about 300%, setting -12, about 180%) continuously skipping. It depends on the piece I play how bad this skipping is. It plays -10 with VB disabled flawlessly, -12 is a bit too high for it
Music: sounds arranged such that they construct feelings.

Flake vs Flac and the -Ax2 switch

Reply #38
I'm having problems to compile r255 with libsndfile support on FreeBSD 7. cmake isn't able to find libsndfile. I've copied the libsndfile to /usr/lib, /usr/local/lib and /lib ... neither seems to be the right place. cmake version is 2.6.3, maybe 2.6.4 might work better ...
Is it a compiling problem or a linking problem?  The cmake version probably would not matter.  It's using a custom cmake script which just tries to compile and link a small test file.
It's the cmake 2.6.3 in the FreeBSD portstree that isn't working correctly. libsndfile is present in /lib, in /usr/lib and in /usr/local/lib but camke can't find it:
Code: [Select]
# cmake .. -DUSE_LIBSNDFILE=yes                                                 
-- The C compiler identification is GNU                                       
-- Check for working C compiler: /usr/bin/gcc                                 
-- Check for working C compiler: /usr/bin/gcc -- works                         
-- Detecting C compiler ABI info                                               
-- Detecting C compiler ABI info - done                                       
-- Performing Test HAVE_FLAG_STD=C99                                           
-- Performing Test HAVE_FLAG_STD=C99 - Success                                 
-- Performing Test HAVE_FLAG_WDISABLED_OPTIMIZATION                           
-- Performing Test HAVE_FLAG_WDISABLED_OPTIMIZATION - Success                 
-- Performing Test HAVE_FLAG_WFLOAT_EQUAL                                     
-- Performing Test HAVE_FLAG_WFLOAT_EQUAL - Success                           
-- Performing Test HAVE_FLAG_WBAD_FUNCTION_CAST                               
-- Performing Test HAVE_FLAG_WBAD_FUNCTION_CAST - Success
-- Performing Test HAVE_FLAG_WDECLARATION_AFTER_STATEMENT
-- Performing Test HAVE_FLAG_WDECLARATION_AFTER_STATEMENT - Success
-- Performing Test HAVE_FLAG_WEXTRA
-- Performing Test HAVE_FLAG_WEXTRA - Success
-- Performing Test HAVE_FLAG_WNO_SWITCH
-- Performing Test HAVE_FLAG_WNO_SWITCH - Success
-- Performing Test HAVE_FLAG_WSTRICT_OVERFLOW
-- Performing Test HAVE_FLAG_WSTRICT_OVERFLOW - Success
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Performing Test HAVE_VISIBILITY
-- Performing Test HAVE_VISIBILITY - Success
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for byteswap.h
-- Looking for byteswap.h - not found
-- Performing Test HAVE_STRNLEN
-- Performing Test HAVE_STRNLEN - Failed
-- Performing Test HAVE_LIBSNDFILE
-- Performing Test HAVE_LIBSNDFILE - Failed
-- libsndfile not found. using libpcm_io instead.
-- Writing config.h
-- Configuring done
-- Generating done
-- Build files have been written to: /home/frank/Desktop/SVN/build
the resulting config.h is empty! So I did create one myself:
Code: [Select]
#define HAVE_LIBSNDFILE 1

#define SVN_VERSION "258"


but that didn't help. I also had to change the CMakeCache.txt:
Code: [Select]
//Test HAVE_LIBSNDFILE
HAVE_LIBSNDFILE:INTERNAL=1

after that compiling with libsndfile worked without problems. I reinstalled my FreeBSD a few days ago, and before that I was using CMake 2.6.4 from the CMake homepage.
WavPack 4.50.1 -hhx6 | LAME 3.98.2 -V 0

Flake vs Flac and the -Ax2 switch

Reply #39
I did some testing and 8 bit Files are working correctly now:

8 bit Wav - OK
8 bit Sun Au - OK
IFF 8SVX - OK

I guess most AU Files ain't working because it is very common to use µ-law and A-law with AU files.

I've also made some compiles of r258 with libsndfile support:
Flake r258 Linux i386
Flake r258 Linux PPC
Flake r258 OS X 10.5 PPC
Flake r258 FreeBSD 7.x i386
WavPack 4.50.1 -hhx6 | LAME 3.98.2 -V 0


 

Flake vs Flac and the -Ax2 switch

Reply #41
I have an A3 as well.    I'm amazed at what files I can throw at it.


Probably quite off-topic, but I just tested my brand new Sandisk Sansa Fuze, and it doesn't support variable blocksizes  It plays, but quite fast (setting -9, about 300%, setting -12, about 180%) continuously skipping. It depends on the piece I play how bad this skipping is. It plays -10 with VB disabled flawlessly, -12 is a bit too high for it


flake -12 works fine in rockbox on the Fuze.  And quite efficiently (~10MHz needed for decode!).