Giter VIP home page Giter VIP logo

dsf2flac's Introduction

INTRODUCTION

A file conversion tool for translating dsf or dff dsd audio files into
flac pcm audio files.

I originally wrote this because I could not quite find any tool which
did exactly what I wanted.

I program quite a lot in java and I'm pretty good at matlab. Although I've
very occasionally written things in C and CPP, this is really my first attempt
at a full CPP program. I'm sure there are errors, hopefully none to horrible.

I've tried to write things in a pretty versatile/clear way. It should be possible
to expand the functionality to add other file types quite easily.

If you want to try different conversion filters then it should be dead simple:
just look in filters.cpp.


COMPILING

I developed and tested this program on Linux x86_64 with GCC. It probably compiles and
works on x86 GCC too. Windows might be a bit more work.

I've added a cmake build configuration which works on Linux and should be relatively easy to
adapt for other platforms.

Usage:

mkdir build
cd build
cmake ..
make




If you want to try manual compilation then you'll need to link against these libs:

FLAC++
FLAC
boost_system
boost_timer
boost_filesystem
boost_chrono
id3
z
rt
ogg


RUNNING

If you run "dsf2flac -h" you'll get a list of the options.

At the very simplest level you just need to run
"dsf2flac -i some_audio_file.dsf"


BENCHMARK

I was quite pleased with the performance.
For example, with the default filters (which are quite long) the program
will convert and encode from DSD64 to 24bit 88200Hz flac at around 
14x realtime on my ageing laptop (Intel Core2Duo [email protected])



LICENSE

Copyright (c) 2013 by respective authors.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


ACKNOWLEDGEMENTS

Many thanks to the following authors and projects whose work has greatly
helped the development of this tool.


Sebastian Gesemann - dsd2pcm (http://code.google.com/p/dsd2pcm/)
SACD Ripper (http://code.google.com/p/sacd-ripper/)
Maxim V.Anisiutkin - foo_input_sacd (http://sourceforge.net/projects/sacddecoder/files/)
Vladislav Goncharov - foo_input_sacd_hq (http://vladgsound.wordpress.com)
Jesus R - www.sonore.us



dsf2flac's People

Contributors

marcoravich avatar

Watchers

 avatar  avatar

dsf2flac's Issues

Compile under OS-X fails: rt and -static option not required

Compilation as is will fail under OS-X 10.10. However, when removing Rt from 
CMakeLists.txt and setting CMAKE_EXE_LINKER_FLAGS to "" will make it compile 
perfectly. Some fast checking the resulting binary seems to work fine.

Original issue reported on code.google.com by mvkoster on 18 Nov 2014 at 7:07

Error when compiling on 32bit

What steps will reproduce the problem?
1. First step without errors
build # cmake ..
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   timer
--   filesystem
--   chrono
-- Found Ogg: /usr/lib/i386-linux-gnu/libogg.so
-- Found Flac: /usr/lib/i386-linux-gnu/libFLAC.so
-- Found Flac++: /usr/lib/i386-linux-gnu/libFLAC++.so
-- Found Id3: /usr/lib/libid3.so
-- Found Zlib: /usr/lib/i386-linux-gnu/libz.so
-- Found Rtlib: /usr/lib/i386-linux-gnu/librt.so
-- Configuring done
-- Generating done
-- Build files have been written to: /root/dsf2flac-read-only/build

2.  error: make
build # make
[  6%] Building CXX object CMakeFiles/dsf2flac.dir/src/tagConversion.cpp.o
[ 12%] Building CXX object CMakeFiles/dsf2flac.dir/src/dop_packer.cpp.o
[ 18%] Building CXX object CMakeFiles/dsf2flac.dir/src/dsd_sample_reader.cpp.o
[ 25%] Building CXX object CMakeFiles/dsf2flac.dir/src/dsf_file_reader.cpp.o
/root/dsf2flac-read-only/src/dsf_file_reader.cpp: In member function ‘virtual 
bool DsfFileReader::step()’:
/root/dsf2flac-read-only/src/dsf_file_reader.cpp:89:24: warning: comparison 
between signed and unsigned integer expressions [-Wsign-compare]
  else if (blockMarker>=blockSzPerChan)
                        ^
[ 31%] Building CXX object CMakeFiles/dsf2flac.dir/src/filters.cpp.o
[ 37%] Building CXX object CMakeFiles/dsf2flac.dir/src/fstream_plus.cpp.o
[ 43%] Building CXX object CMakeFiles/dsf2flac.dir/src/dsd_decimator.cpp.o
[ 50%] Building CXX object CMakeFiles/dsf2flac.dir/src/main.cpp.o
[ 56%] Building CXX object CMakeFiles/dsf2flac.dir/src/dsdiff_file_reader.cpp.o
/root/dsf2flac-read-only/src/dsdiff_file_reader.cpp: In member function 
‘virtual bool DsdiffFileReader::step()’:
/root/dsf2flac-read-only/src/dsdiff_file_reader.cpp:217:25: warning: comparison 
between signed and unsigned integer expressions [-Wsign-compare]
  else if (bufferMarker>=sampleBufferLenPerChan)
                         ^
[ 62%] Building C object CMakeFiles/dsf2flac.dir/src/cmdline.c.o
[ 68%] Building C object CMakeFiles/dsf2flac.dir/src/libdstdec/ccp_calc.c.o
[ 75%] Building C object CMakeFiles/dsf2flac.dir/src/libdstdec/unpack_dst.c.o
[ 81%] Building C object CMakeFiles/dsf2flac.dir/src/libdstdec/dst_ac.c.o
[ 87%] Building C object CMakeFiles/dsf2flac.dir/src/libdstdec/dst_data.c.o
[ 93%] Building C object CMakeFiles/dsf2flac.dir/src/libdstdec/dst_fram.c.o
[100%] Building C object CMakeFiles/dsf2flac.dir/src/libdstdec/dst_init.c.o
In file included from /root/dsf2flac-read-only/src/libdstdec/dst_init.c:68:0:
/usr/lib/gcc/i686-linux-gnu/4.8/include/emmintrin.h:31:3: error: #error "SSE2 
instruction set not enabled"
 # error "SSE2 instruction set not enabled"
   ^
/root/dsf2flac-read-only/src/libdstdec/dst_init.c: In function 
‘MemoryAllocate’:
/root/dsf2flac-read-only/src/libdstdec/dst_init.c:84:14: warning: assignment 
makes pointer from integer without a cast [enabled by default]
   if ((Array = _mm_malloc(NrOfElements * SizeOfElement, 16)) == NULL) 
              ^
make[2]: *** [CMakeFiles/dsf2flac.dir/src/libdstdec/dst_init.c.o] Error 1
make[1]: *** [CMakeFiles/dsf2flac.dir/all] Error 2
make: *** [all] Error 2


What is the expected output?

Binary created successfully

What do you see instead?

In file included from /root/dsf2flac-read-only/src/libdstdec/dst_init.c:68:0:
/usr/lib/gcc/i686-linux-gnu/4.8/include/emmintrin.h:31:3: error: #error "SSE2 
instruction set not enabled"
 # error "SSE2 instruction set not enabled"
   ^
/root/dsf2flac-read-only/src/libdstdec/dst_init.c: In function 
‘MemoryAllocate’:
/root/dsf2flac-read-only/src/libdstdec/dst_init.c:84:14: warning: assignment 
makes pointer from integer without a cast [enabled by default]
   if ((Array = _mm_malloc(NrOfElements * SizeOfElement, 16)) == NULL) 
              ^
make[2]: *** [CMakeFiles/dsf2flac.dir/src/libdstdec/dst_init.c.o] Error 1
make[1]: *** [CMakeFiles/dsf2flac.dir/all] Error 2
make: *** [all] Error 2


What version of the product are you using? On what operating system?

dsf2flac - Revision 51: /trunk
In linux mint 17 cinnamon (32 bits)


Additional information 

            cat /proc/cpuinfo
processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 16
model       : 6
model name  : AMD Athlon(tm) II 160u Processor
stepping    : 3
microcode   : 0x10000c8
cpu MHz     : 800.000
cache size  : 1024 KB
physical id : 0
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fdiv_bug    : no
f00f_bug    : no
coma_bug    : no
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat 
pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 
3dnowext 3dnow constant_tsc nonstop_tsc extd_apicid pni monitor cx16 popcnt 
lahf_lm svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs 
skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock nrip_save
bogomips    : 3616.03
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

Excuse my English

Original issue reported on code.google.com by [email protected] on 3 Oct 2014 at 11:55

Application crashes in id tag processing

What steps will reproduce the problem?
1. ./dsf2flac -d -i/Users/jbackes/Music/HOURGLASS_DSF/01_LINE_EM_UP.dsf


What is the expected output? What do you see instead?
WARNING: unknown chunk type: DIAR
WARNING: unknown chunk type: DITI
Illegal instruction


What version of the product are you using? On what operating system?
dsf2flac 0.1Rev30

Please provide any additional information below.
Process:         dsf2flac [14530]
Path:            /Applications/dsd2flac_OSX_v3/dsf2flac
Identifier:      dsf2flac
Version:         0
Code Type:       X86-64 (Native)
Parent Process:  tcsh [14457]
User ID:         501

Date/Time:       2014-01-17 20:33:43.971 -0800
OS Version:      Mac OS X 10.8.5 (12F45)
Report Version:  10

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   dsf2flac                        0x000000010b5fec63 
ID3_TagImpl::ID3_TagImpl(char const*) + 137
1   dsf2flac                        0x000000010b5fc22a ID3_Tag::ID3_Tag(char 
const*) + 50
2   dsf2flac                        0x000000010b5c38ad 
DsfFileReader::DsfFileReader(char*) + 61
3   dsf2flac                        0x000000010b5c92c3 main + 835
4   libdyld.dylib                   0x000000010b9497e1 start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x000000010b616ac0  rbx: 0x00007f8589404ae0  rcx: 0x000000010b619001  rdx: 0x000000010b619080
  rdi: 0x00007f8589404ae8  rsi: 0x0000000000000002  rbp: 0x00007fff54640380  rsp: 0x00007fff54640350
   r8: 0x000000000000000c   r9: 0x000000000000001b  r10: 0x000000010b6c3000  r11: 0x000000000000000c
  r12: 0x000000010b619300  r13: 0x000000010b6169e0  r14: 0x0000000000000000  r15: 0x00007f8589404b28
  rip: 0x000000010b5fec63  rfl: 0x0000000000010206  cr2: 0x000000010b5f6b2a
Logical CPU: 0

Binary Images:
       0x10b5bf000 -        0x10b614ff7 +dsf2flac (0) <89686F54-4282-3B92-BB2B-7E974456F907> /Applications/dsd2flac_OSX_v3/dsf2flac
       0x10b6c7000 -        0x10b6d9ff7  libz.1.dylib (43) <2A1551E8-A272-3DE5-B692-955974FE1416> /usr/lib/libz.1.dylib
       0x10b6e2000 -        0x10b7d7fff  libiconv.2.dylib (34) <FEE8B996-EB44-37FA-B96E-D379664DEFE1> /usr/lib/libiconv.2.dylib
       0x10b7ee000 -        0x10b856ff7  libc++.1.dylib (65.1) <20E31B90-19B9-3C2A-A9EB-474E08F9FE05> /usr/lib/libc++.1.dylib
       0x10b8b1000 -        0x10b8b2ff7  libSystem.B.dylib (169.3) <DF030DDB-DF22-3769-A8CD-9806DDB84008> /usr/lib/libSystem.B.dylib
       0x10b8c0000 -        0x10b8c5fff  libcache.dylib (57) <65187C6E-3FBF-3EB8-A1AA-389445E2984D> /usr/lib/system/libcache.dylib
       0x10b8cf000 -        0x10b8ddfff  libcommonCrypto.dylib (60027) <BAAFE0C9-BB86-3CA7-88C0-E3CBA98DA06F> /usr/lib/system/libcommonCrypto.dylib
       0x10b8ed000 -        0x10b8f2fff  libcompiler_rt.dylib (30) <08F8731D-5961-39F1-AD00-4590321D24A9> /usr/lib/system/libcompiler_rt.dylib
       0x10b900000 -        0x10b907fff  libcopyfile.dylib (89) <876573D0-E907-3566-A108-577EAD1B6182> /usr/lib/system/libcopyfile.dylib
       0x10b90f000 -        0x10b924ff7  libdispatch.dylib (228.23) <D26996BF-FC57-39EB-8829-F63585561E09> /usr/lib/system/libdispatch.dylib
       0x10b93c000 -        0x10b93dff7  libdnsinfo.dylib (453.19) <14202FFB-C3CA-3FCC-94B0-14611BF8692D> /usr/lib/system/libdnsinfo.dylib
       0x10b947000 -        0x10b94aff7  libdyld.dylib (210.2.3) <F59367C9-C110-382B-A695-9035A6DD387E> /usr/lib/system/libdyld.dylib
       0x10b957000 -        0x10b957fff  libkeymgr.dylib (25) <CC9E3394-BE16-397F-926B-E579B60EE429> /usr/lib/system/libkeymgr.dylib
       0x10b95f000 -        0x10b967fff  liblaunch.dylib (442.26.2) <2F71CAF8-6524-329E-AC56-C506658B4C0C> /usr/lib/system/liblaunch.dylib
       0x10b970000 -        0x10b976fff  libmacho.dylib (829) <BF332AD9-E89F-387E-92A4-6E1AB74BD4D9> /usr/lib/system/libmacho.dylib
       0x10b982000 -        0x10b984fff  libquarantine.dylib (52.1) <143B726E-DF47-37A8-90AA-F059CFD1A2E4> /usr/lib/system/libquarantine.dylib
       0x10b98e000 -        0x10b98fff7  libremovefile.dylib (23.2) <6763BC8E-18B8-3AD9-8FFA-B43713A7264F> /usr/lib/system/libremovefile.dylib
       0x10b998000 -        0x10b999fff  libsystem_blocks.dylib (59) <D92DCBC3-541C-37BD-AADE-ACC75A0C59C8> /usr/lib/system/libsystem_blocks.dylib
       0x10b9a4000 -        0x10ba70ff7  libsystem_c.dylib (825.40.1) <543B05AE-CFA5-3EFE-8E58-77225411BA6B> /usr/lib/system/libsystem_c.dylib
       0x10bab8000 -        0x10bac0ff7  libsystem_dnssd.dylib (379.38.1) <BDCB8566-0189-34C0-9634-35ABD3EFE25B> /usr/lib/system/libsystem_dnssd.dylib
       0x10bacb000 -        0x10bb01fff  libsystem_info.dylib (406.17) <4FFCA242-7F04-365F-87A6-D4EFB89503C1> /usr/lib/system/libsystem_info.dylib
       0x10bb1f000 -        0x10bb3aff7  libsystem_kernel.dylib (2050.48.12) <4B7993C3-F62D-3AC1-AF92-414A0D6EED5E> /usr/lib/system/libsystem_kernel.dylib
       0x10bb4e000 -        0x10bb7cff7  libsystem_m.dylib (3022.6) <B434BE5C-25AB-3EBD-BAA7-5304B34E3441> /usr/lib/system/libsystem_m.dylib
       0x10bb8b000 -        0x10bb99ff7  libsystem_network.dylib (77.10) <0D99F24E-56FE-380F-B81B-4A4C630EE587> /usr/lib/system/libsystem_network.dylib
       0x10bbac000 -        0x10bbb7fff  libsystem_notify.dylib (98.5) <C49275CC-835A-3207-AFBA-8C01374927B6> /usr/lib/system/libsystem_notify.dylib
       0x10bbc1000 -        0x10bbc2ff7  libsystem_sandbox.dylib (220.3) <B739DA63-B675-387A-AD84-412A651143C0> /usr/lib/system/libsystem_sandbox.dylib
       0x10bbc8000 -        0x10bbcaff7  libunc.dylib (25) <92805328-CD36-34FF-9436-571AB0485072> /usr/lib/system/libunc.dylib
       0x10bbd1000 -        0x10bbd7ff7  libunwind.dylib (35.1) <21703D36-2DAB-3D8B-8442-EAAB23C060D3> /usr/lib/system/libunwind.dylib
       0x10bbde000 -        0x10bc00ff7  libxpc.dylib (140.43) <70BC645B-6952-3264-930C-C835010CCEF9> /usr/lib/system/libxpc.dylib
       0x10bc1f000 -        0x10bc6eff7  libcorecrypto.dylib (106.2) <CE0C29A3-C420-339B-ADAA-52F4683233CC> /usr/lib/system/libcorecrypto.dylib
       0x10bc81000 -        0x10bd9992f  libobjc.A.dylib (532.2) <90D31928-F48D-3E37-874F-220A51FD9E37> /usr/lib/libobjc.A.dylib
       0x10bdbb000 -        0x10be07ff7  libauto.dylib (185.4) <AD5A4CE7-CB53-313C-9FAE-673303CC2D35> /usr/lib/libauto.dylib
       0x10be1e000 -        0x10be43ff7  libc++abi.dylib (26) <D86169F3-9F31-377A-9AF3-DB17142052E4> /usr/lib/libc++abi.dylib
       0x10be78000 -        0x10be79fff  libDiagnosticMessagesClient.dylib (8) <8548E0DC-0D2F-30B6-B045-FE8A038E76D8> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fff6b1bf000 -     0x7fff6b1f394f  dyld (210.2.3) <8958FE97-5830-3928-BC38-23136E7D3783> /usr/lib/dyld

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 4048
    thread_create: 2
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=7856K resident=4632K(59%) 
swapped_out_or_unallocated=3224K(41%)
Writable regions: Total=18.2M written=328K(2%) resident=508K(3%) 
swapped_out=0K(0%) unallocated=17.7M(97%)

REGION TYPE                      VIRTUAL
===========                      =======
MALLOC                             9396K
MALLOC guard page                    16K
STACK GUARD                        56.0M
Stack                              8192K
__DATA                             1068K
__LINKEDIT                         1932K
__TEXT                             5976K
shared memory                        12K
===========                      =======
TOTAL                              82.0M

Original issue reported on code.google.com by [email protected] on 18 Jan 2014 at 4:41

please add proper makefile and build instructions

Am just looking to be able to checkout code and be able to do (if necessary) 
"./configure" and then "make" and "make install" to have it compiled and 
installed, and a README which says as much.

Right now, the makefile is rather particular ;-)

Original issue reported on code.google.com by [email protected] on 15 Sep 2013 at 2:31

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.