Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Opus SoundSource to Mixxx #151

Merged
merged 19 commits into from
Apr 15, 2014
Merged

Add Opus SoundSource to Mixxx #151

merged 19 commits into from
Apr 15, 2014

Conversation

illuusio
Copy link
Contributor

As Mangatune is currently supporting Opus releases and it's standardized by the Internet Engineering Task Force (IETF) as RFC 6716 is natural that Mixxx support for Opus.
This is 90% made after Ogg/Vorbis SoundSource as libopusfile is nearly 100% compatible with libvorbisfile by API wise (of course there are name changes from ov_ space to op_ space).
Tested with setup:

  • Libopus 1.1
  • Libopusfile 0.4 (Libopufile minimum is libopus 1.0.3)

There ain't much Opus audio available in internet so I tested these with converted FLAC files or if you have Mangatune subscription you can download Opus easily from there. Currently this is always compiling but It can be tuned as feature (I'm just not that good with scons..)

# More info http://http://www.opus-codec.org/
if build.platform_is_linux or build.platform_is_osx \
or build.platform_is_bsd:
# Check for libavcodec, libavformat
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy and paste left over?

@daschuer
Copy link
Member

Hi @illuusio thank you for your work.

I have tried to compile it with Ubuntu Sourcy, after changing the minimum libopusfile version to 0.2. But it fails with:

src/soundsourceopus.cpp:18:29: fatal error: taglib/opusfile.h: File not found
#include <taglib/opusfile.h>

What was your test OS?

I think Yes, we need to make it an optional feature, since Ubuntu Precise, the oldest supported Ubuntu has no
libopusfile by default.

Kind regards,

Daniel

@illuusio
Copy link
Contributor Author

I have tried to compile it with Ubuntu Sourcy, after changing the minimum libopusfile version to 0.2. But it fails with:

src/soundsourceopus.cpp:18:29: fatal error: taglib/opusfile.h: File not found
#include

Yes Opus support is added 7 months ago in Taglib so gotta do little bit reorganization in reading tags (use libopus if taglib is not available. One needs Taglib 1.9.1 at least and https://launchpad.net/ubuntu/+source/taglib only provides 1.8 for Saucy).

What was your test OS?

I tested this on openSUSE 13.1 and I think I'll compile it on Mac OS X on evening with macports to see if it's good.

I think Yes, we need to make it an optional feature, since Ubuntu Precise, the oldest supported Ubuntu has no
libopusfile by default.

I have investigate how to pump this to optional.

@illuusio
Copy link
Contributor Author

There is still move this one as feature. I'll do that later after I get this working on Ubuntu 12.04.

@illuusio
Copy link
Contributor Author

Ok now this can be compiled on Saucy Salamander (13.10) with libopusfile version 0.2 and opus version 1.0.2 but there is no libopusfile on 12.04 LTS so no luck on that.

  • Removed need for Taglib 1.9.1 there is code for parsing tags. Simple but working.
  • Opus is also moved as feature. opus=1 will enable it.

This should be ok to merge.

int SoundSourceOpus::parseHeader() {
int error = 0;

#ifdef __WINDOWS__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We got rid of this for all other soundsources -- now we just use toLocal8Bit.

@illuusio
Copy link
Contributor Author

this still failed building with ubuntu.

Instead of using scons you might want to replace you OPUSFILETAGS Macro with these macros from taglib.h:

#define TAGLIB_MAJOR_VERSION 1
#define TAGLIB_MINOR_VERSION 7
#define TAGLIB_PATCH_VERSION 0

(Taken from ubuntu Saucy)

Hello which way it doesn't work for you? Can you paste your error? With VirtualBox out box Ubuntu 13.10. It compiles just fine and with above fix it also compiles without opus.

@daschuer
Copy link
Member

Just tried the latest version, but it is still failing

scons: Reading SConscript files ...
INFO:root:Target Platform: linux
INFO:root:Target Machine: x86_64
INFO:root:Build: debug
INFO:root:Toolchain: gnu
INFO:root:Crosscompile: NO
INFO:root:Qt path: /usr/share/qt4
branch has changed denon-mapping -> opus
shutil.move lin64_build cache/denon-mapping/lin64_build
shutil.move .sconsign.dblite cache/denon-mapping/sconsign.dblite
shutil.move cache/custom.py cache/denon-mapping/custom.py
shutil.move cache/opus/lin64_build lin64_build
shutil.move cache/opus/sconsign.dblite .sconsign.dblite
shutil.move cache/opus/custom.py cache/custom.py
touch .sconsign.branch
Configuring MixxxCore
Checking for pkg-config (at least version 0.15.0)... (cached) yes
Configuring SoundTouch
Configuring ReplayGain
Configuring PortAudio
Checking for C library portaudio... (cached) yes
Configuring PortMIDI
Checking for C library porttime... (cached) yes
Checking for C library portmidi... (cached) yes
Checking for C header file portmidi.h... (cached) yes
Configuring Qt
Checking for QtCore (4.6 or higher)... (cached) yes
Configuring FidLib
Configuring SndFile
Checking for C library sndfile... (cached) yes
Configuring FLAC
Checking for C header file FLAC/stream_decoder.h... (cached) yes
Checking for C library libFLAC... (cached) yes
Configuring OggVorbis
Checking for C library libvorbisfile... (cached) yes
Checking for C library libvorbis... (cached) yes
Checking for C library libogg... (cached) yes
Checking for C library libvorbisenc... (cached) yes
Configuring OpenGL
Checking for C library GL... (cached) yes
Checking for C library GLU... (cached) yes
Configuring TagLib
Checking for C library tag... (cached) yes
Configuring ProtoBuf
Checking for C library libprotobuf-lite... (cached) yes
Configuring Chromaprint
Checking for C library chromaprint... (cached) yes
Configuring RubberBand
Checking for C library rubberband... (cached) yes
Configuring HifiEq
Configuring Mad
Checking for C library libmad... (cached) yes
Checking for C library libid3tag... (cached) yes
Configuring CoreAudio
Configuring MediaFoundation
Configuring HSS1394
Configuring HID
Checking for C library libusb-1.0... (cached) yes
Checking for C header file libusb-1.0/libusb.h... (cached) yes
Checking for C library pthread... (cached) yes
Checking for C library rt... (cached) yes
Configuring Bulk
Checking for C library libusb-1.0... (cached) yes
Checking for C header file libusb-1.0/libusb.h... (cached) yes
Configuring VinylControl
Configuring Shoutcast
Checking for C library libshout... (cached) yes
Configuring Opus
ERROR:root:Unmet dependency: invalid literal for int() with base 10: 'true'
Configuring Profiling
Configuring Tuned
Configuring QDebug
Configuring Verbose
Configuring Optimize
Configuring FAAD
Configuring WavPack
Configuring ModPlug
Configuring TestSuite
Configuring LADSPA
Configuring MSVCDebug
Configuring MSVSHacks
Configuring Vamp
Checking for C library vamp-hostsdk... yes
Checking for C library dl... yes
Checking for C library X11... yes
Checking for C header file fftw3.h... yes
Checking for C library fftw3... yes
Configuring AutoDjCrates
Configuring PerfTools
Configuring AsmLib
Configuring IPod
Configuring FFMPEG
ERROR:root:Build had unmet dependencies. Exiting.

@illuusio
Copy link
Contributor Author

Configuring Opus
ERROR:root:Unmet dependency: invalid literal for int() with base 10: 'true'

I just can't get this happen. Can you debug which row is affected.. or what reads in config.log in that part?

@illuusio
Copy link
Contributor Author

illuusio commented Feb 1, 2014

@rryan comments fixed and merged upstream test merging

@daschuer
Copy link
Member

daschuer commented Feb 1, 2014

Hi @illuusio, I have tested the latest version, but it is still failing with the error above.
I could probably debug, but i don't know how. Any hints?
Thank you.

@illuusio
Copy link
Contributor Author

illuusio commented Feb 2, 2014

I could probably debug, but i don't know how. Any hints?

Okay because this is scons problem mainly and I more than rookie with it I come up with this kind of stuff: What is you scons version (with ubuntu 13.10 it should be 2.3.0) and you have libopus 1.0.3 and libopusfile 0.2 (pkg-config installed!)?
After scons is ready there is file named 'config.log'. Open it and seek for opusfile you should find something like this or if ain't like this please paste what it is.

scons: Configure: Checking for opusfile (0.2 or higher)...      
pkg-config --atleast-version=0.2 'opusfile'
scons: Configure: yes

If that is not enough I have very very small minded patch to determine what line scons hangs it self. copy and paste it to mixxx opus dir and apply with 'patch -p1 -i yourpatchname' or meld or what ever you like to use (kdiff3? anyone?).

diff --git a/build/features.py b/build/features.py
index 0665d29..659dadc 100644
--- a/build/features.py
+++ b/build/features.py
@@ -898,37 +898,47 @@ class Shoutcast(Feature):
 
 class Opus(Feature):
     def description(self):
+        print "description 1#"
         return "Opus (RFC 6716) support"
 
     def enabled(self, build):
+        print "enabled 1#"
         build.flags['opus'] = util.get_flags(build.env, 'opus', 0)
         if int(build.flags['opus']):
             return True
         return False
 
     def add_options(self, build, vars):
+        print "add_options 1#"
         vars.Add('opus', 'Set to 1 to enable Opus (RFC 6716) support \
                            (supported are Opus 1.0 and above and Opusfile 0.2 and above)', 0)
 
     def configure(self, build, conf):
         if not self.enabled(build):
+            print "0#"
             return
 
+        print "configure 1#"
         # Supported for Opus (RFC 6716)
         # More info http://http://www.opus-codec.org/
         if build.platform_is_linux or build.platform_is_osx \
                 or build.platform_is_bsd:
             # Check for libopusfile
             # I just randomly picked version numbers lower than mine for this
+
+            print "configure 2#"
             if not conf.CheckForPKG('opusfile', '0.2'):
                 raise Exception('Missing libopusfile (needs at least 0.2)')
 
+            print "configure 3#"
             build.env.Append(CPPDEFINES='__OPUS__')
 
+            print "configure 4#"
        build.env.ParseConfig('pkg-config opusfile opus --silence-errors \
                                   --cflags --libs')
 
     def sources(self, build):
+        print "sources 3#"
         return ['soundsourceopus.cpp']
 
 

After patch script shows you when error happens.. and this wasn't very clear but hopefully we can get down to the problem.

@daschuer
Copy link
Member

daschuer commented Feb 5, 2014

Hi @illuusio,
I have tested with your patch, and it works, after reverting your patch it still works :-/
So I assume that it must be a fault in scons cache data or something.

My opus test file works fine now.
@rryan: Can we merge this now or do you have further comments or objections?

@illuusio
Copy link
Contributor Author

illuusio commented Feb 6, 2014

o I assume that it must be a fault in scons cache data or something.

@daschuer scons can be very tricky with these cache stuff. I always destroy cache and stuff when update different branch. It's slow but then I can be sure that scons doesn't fool me.
After this is in I'll update FFmpeg to support also Opus and new API changes. I also try to manage some patch for libav (avconv) to make it support Opus/Ogg Vorbis as good as FFmpeg.

@daschuer
Copy link
Member

@rryan: Any objections to merge this soon. Please note, it is a compile option.

@illuusio
Copy link
Contributor Author

@rryan and @daschuer yes this in very much in better shape than FFmpeg that definetly needs more love. When this get in then I'll also create Opus encode module so there is option to use it with shoutcast.

@rryan
Copy link
Member

rryan commented Apr 15, 2014

SGTM! Thanks @illuusio.

rryan added a commit that referenced this pull request Apr 15, 2014
Add Opus SoundSource to Mixxx
@rryan rryan merged commit fcce0bf into mixxxdj:master Apr 15, 2014
esbrandt added a commit to mixxxdj/manual that referenced this pull request Nov 12, 2014
@illuusio illuusio deleted the opus branch May 9, 2015 06:04
@mixxxbot mixxxbot mentioned this pull request Aug 22, 2022
m0dB pushed a commit to m0dB/mixxx that referenced this pull request Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants