| 1 |
Installing instructions for Tritonus, version 0.3.1 |
| 2 |
|
| 3 |
First: do you really need to build Tritonus yourself? |
| 4 |
For several common cases, this is not necessary. These cases are: |
| 5 |
- you want to do mp3 decoding (all platforms) |
| 6 |
- you want to do mp3 encoding (Linux i386, Windows) |
| 7 |
- you want to do GSM 06.10 decoding or encoding (all platforms) |
| 8 |
- you want to do ogg/vorbis decoding (all platforms) |
| 9 |
- you want to do CD digital audio extraction (Linux i386) |
| 10 |
For these cases, precompiled components are available. Go to: |
| 11 |
http://www.tritonus.org/plugins.html |
| 12 |
If you want to have kaffe with Java Sound, use the cvs of kaffe |
| 13 |
(Tritonus has been integrated there). Go to: |
| 14 |
http://www.kaffe.org/ |
| 15 |
|
| 16 |
|
| 17 |
Which components do i need? |
| 18 |
[TODO: Which coponents to compile/install] |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
What you need |
| 23 |
============= |
| 24 |
|
| 25 |
- jdk 1.5.x. Testing was done with the |
| 26 |
Sun jdk 1.5.0-b64. Other versions may work. |
| 27 |
If you want to compile Linux specific components, it is recommended to do |
| 28 |
it on a Linux system, so you need a j2sdk for Linux. Cross-compiling has not |
| 29 |
been tested. |
| 30 |
If you only want to build pure-java (not Linux specific) components, you |
| 31 |
can use a j2sdk on any platform. |
| 32 |
Tritonus does not work with jdk1.1.X. |
| 33 |
There are no experiences with gcj. Reports are welcome. |
| 34 |
|
| 35 |
- Optional: jikes (recommended, testing was done with version 1.16) |
| 36 |
|
| 37 |
- Either: the Enlightened Sound Daemon (esd or EsounD). On Debian |
| 38 |
systems, install the packages esound-common, esound, libesd0 and |
| 39 |
libesd0-dev. On Suse systems, install the package esound. If esd is |
| 40 |
not part of your Linux distribution, look at www.gnome.org. Make sure |
| 41 |
you have not only the daemon and the shared library, but also the header |
| 42 |
files for libesd. |
| 43 |
|
| 44 |
NOTE: this is kept more or less as a compatibility option. Esd is |
| 45 |
considered a badly designed program. Using ALSA is highly |
| 46 |
recommended. |
| 47 |
|
| 48 |
- Or: ALSA 0.9.0rc2 or later or the corresponding cvs state. Get it |
| 49 |
from http://www.alsa-project.org/. It is recommended to use ALSA if |
| 50 |
you want to get high-performance, low-latency operation, or reliable |
| 51 |
full-duplex. It is a necessity if you want professional-grade MIDI support. |
| 52 |
Testing was done with ALSA 0.9.0rc2. 0.9.0rc3 has been reported to work. |
| 53 |
|
| 54 |
STILL ANOTHER NOTE: currently, Tritonus' ALSA handling does not do |
| 55 |
software mixing. This means that for normal JS operation (multiple |
| 56 |
SourceDataLines/Clips) your soundcard has to support hardware |
| 57 |
mixing. Common chipsets that do this are emu10k1 (SB Life!) and |
| 58 |
Trident NX (e.g. Hoontech 4DWaveNX). Otherwise, you will get only |
| 59 |
one line at a time. In other words: if your soundcard does not do hw |
| 60 |
mixing, you need to choose the esd options to have multiple lines. |
| 61 |
|
| 62 |
|
| 63 |
For MIDI: |
| 64 |
- Either: ALSA (see above) |
| 65 |
|
| 66 |
- Or: MidiShare. Get it from http://www.grame.fr/MidiShare/. |
| 67 |
|
| 68 |
For cdda: |
| 69 |
- cdparanoia III version 9.8. Version 9.7 is not sufficient. |
| 70 |
|
| 71 |
For the build process: |
| 72 |
- make (Testing done with GNU make 3.79) |
| 73 |
- ant (Testing done with Apache Ant 1.6; 1.5 should work, too. |
| 74 |
Get it from http://jakarta.apache.org/ant/ if not present in your distribution) |
| 75 |
- gcc |
| 76 |
- libtool (currently not needed) |
| 77 |
- m4 |
| 78 |
- cpp |
| 79 |
- javah (for building the native libraries) |
| 80 |
|
| 81 |
|
| 82 |
Building mp3 related components |
| 83 |
------------------------------- |
| 84 |
|
| 85 |
The ant based build requires that javalayer.jar is already compiled |
| 86 |
and that it is available in the classpath during the build. Only then |
| 87 |
the mp3 SPI plug-in gets compiled and packaged. |
| 88 |
|
| 89 |
|
| 90 |
Installing steps |
| 91 |
================ |
| 92 |
|
| 93 |
--------------------- |
| 94 |
Currently, the build process is a mess. |
| 95 |
I'm currently building with these commands: |
| 96 |
|
| 97 |
../tritonus> autoconf |
| 98 |
../tritonus> ./configure |
| 99 |
../tritonus> ant -f build-dtd.xml |
| 100 |
../tritonus> ant |
| 101 |
../tritonus> make -C src/lib/alsa |
| 102 |
../tritonus> make -C src/lib/vorbis |
| 103 |
../tritonus> make -C src/lib/... |
| 104 |
|
| 105 |
If you want ant to use jikes, issue: |
| 106 |
|
| 107 |
../tritonus> ant -Dbuild.compiler=jikes |
| 108 |
|
| 109 |
[IDEA: options to configure: build-prefix, install-prefix] |
| 110 |
|
| 111 |
Installation never worked really well. I did (by hand): |
| 112 |
> cd /usr/local/java/j2sdk1.4.0/jre/lib/ext |
| 113 |
> ln -s /home/matthias/java/tritonus/dist/tritonus_xxx.jar |
| 114 |
... |
| 115 |
> cd i386 |
| 116 |
> ln -s /home/matthias/java/tritonus/src/lib/alsa/libtritonusalsa.so |
| 117 |
... |
| 118 |
(Of course adapt the paths to your system.) |
| 119 |
|
| 120 |
--------------------- |
| 121 |
OLD |
| 122 |
|
| 123 |
1. Unpack the distribution. It should unpack into a directory |
| 124 |
tritonus-<version>. cd into the top-level directory. |
| 125 |
|
| 126 |
2. Issue 'configure' ('./configure' if you build as root) in the |
| 127 |
top-level directory. If you are building from the cvs, you have to |
| 128 |
create configure from configure.in by calling 'autoconf'. Note that |
| 129 |
autoconf 2.52 hat a bug that prevents Tritonus' configure from working |
| 130 |
correctely. Tested (and working) versions are 2.53 and 2.13. |
| 131 |
|
| 132 |
THE OLD WAY |
| 133 |
|
| 134 |
3. Issue 'make' or 'make compileinitial' (the second one is |
| 135 |
faster). There are spurious compilation errors with some jdk1.1 |
| 136 |
versions. Just restart with 'make' (even if you originally said 'make |
| 137 |
compileinitial') and they will go away. This may be necessary several |
| 138 |
times. |
| 139 |
|
| 140 |
|
| 141 |
THE NEW WAY |
| 142 |
|
| 143 |
3. Issue 'ant'. |
| 144 |
|
| 145 |
-- following needs to be updated -- |
| 146 |
|
| 147 |
4. Issue 'make install'. This will copy the files tritonus.jar, |
| 148 |
javalayer.jar, libesdtritonus.so.1.0 and libtritonusalsa.so.1.0 into |
| 149 |
the directory tree of the jdk, thereby installing it as an |
| 150 |
extension. Note that this works only if you have a jdk/jre1.2 or |
| 151 |
higher and java is accessible in the path. If you have jdk/jre1.1.x, |
| 152 |
you have to set the CLASSPATH and LD_LIBRARY_PATH to include the above |
| 153 |
files. The important files are: |
| 154 |
|
| 155 |
- tritonus-x.y.z/tritonus.jar - this contains the java classes and |
| 156 |
should be in your CLASSPATH |
| 157 |
|
| 158 |
- tritonus-x.y.z/javalayer.jar - this contains the java classes for |
| 159 |
the mp3 decoder (seperated because of legal reasons). They should be |
| 160 |
in your CLASSPATH, too. |
| 161 |
|
| 162 |
- tritonus-x.y.z/src/lib/alsa/libtritonusalsa.so.1.0 (if you use the |
| 163 |
MIDI stuff) |
| 164 |
|
| 165 |
- tritonus-x.y.z/src/lib/esd/libtritonusesd.so.1.0 |
| 166 |
|
| 167 |
this contains the native |
| 168 |
code and should be in your LD_LIBRARY_PATH |
| 169 |
|
| 170 |
|
| 171 |
USING TRITONUS WITH SUN/IBM/BLACKDOWN JDK 1.3/1.4 |
| 172 |
|
| 173 |
If you are using Tritonus with a jdk/jre that already has an |
| 174 |
implementation of the Java Sound API (this is true for 1.3/1.4), you |
| 175 |
have two choices: |
| 176 |
|
| 177 |
1. Use only the components of Tritonus that are not available/not |
| 178 |
working correctely in the native Java Sound implementation. |
| 179 |
|
| 180 |
2. Completely replace the Java Sound implementation by Tritonus. |
| 181 |
|
| 182 |
Since 1.3 and 1.4 behave sligtly different with respect to this issue, |
| 183 |
there are even more pitfalls. |
| 184 |
|
| 185 |
If you just want to use one of Tritonus' FormatconversionProviders, |
| 186 |
MixerProviders or MidiDeviceProviders (these are the most common |
| 187 |
cases), put the respective tritonus_xxx.jar into either the user class |
| 188 |
path or the extension class path. Using the user class path can be |
| 189 |
convenient for quick tests. However, for permanent installation it is |
| 190 |
not recommanded. The reason is that executing a VM with 'java -jar |
| 191 |
...' overrides the user class path with the location of the .jar given |
| 192 |
on the command line. So Tritonus .jars put into the user class path |
| 193 |
become unavailable. Manipulating the boot class path is generally |
| 194 |
highly discouraged (see below for a useful, but still critical use of |
| 195 |
the boot class path). The remaining (and recommanded) way is to use |
| 196 |
the extension class path. |
| 197 |
|
| 198 |
Additionally, put native libs of .jar that need one into a generally |
| 199 |
system-accessible location (for instance /usr/lib/, /usr/local/lib, |
| 200 |
...). To install native libs in a custom location, you typically need |
| 201 |
to change the value of the environment variable LD_LIBRARY_PATH. |
| 202 |
|
| 203 |
This done, the components should be available to Java |
| 204 |
Sound. MixerProviders contribute to the list of Mixers |
| 205 |
(AudioSystem.getMixerInfo()). MidiDeviceProviders contribute to the |
| 206 |
list of MidiDevices |
| 207 |
(MidiSystem.getMidiDeviceInfo()). FormatConversionProviders are |
| 208 |
considered implicitely (by AudioSystem.getTargetEncodings(), |
| 209 |
AudioSystem.getTargetFormats(), AudioSystem.isConversionSupported(), |
| 210 |
AudioSystem.getAudioInputStream()). |
| 211 |
|
| 212 |
With jdk 1.3.X, the pitfall is that making the providers available does |
| 213 |
NOT automatically change the default devices (as returned/used by |
| 214 |
AudioSystem.getLine(), MidiSystem.getSynthesizer(), |
| 215 |
MidiSystem.getReceiver(), MidiSystem.getTransmitter(), |
| 216 |
MidiSystem.getSequencer(), MidiSystem.getSynthesizer()). The jdk |
| 217 |
searches the class paths for available providers in this order: boot |
| 218 |
class path, extension class path, user class path. Since the |
| 219 |
'built-in' providers appear in rt.jar, which appears in the boot class |
| 220 |
path, its devices act as defaults. Devices provided by |
| 221 |
additionally installed providers are available on explicit request |
| 222 |
(AudioSystem.getMixer(), MidiSystem.getMidiDevice()). |
| 223 |
|
| 224 |
With jdk 1.4, the defaults change without asking you, and exactely |
| 225 |
this can be a pitfal, too. This is due to the fact that the the search |
| 226 |
order for provider is reversed. Here, it is: user class path, |
| 227 |
extension class path, boot class path. So devices provided by |
| 228 |
additional providers can act as default devices. |
| 229 |
|
| 230 |
So with jdk1.4, your job is easy, while with jdk1.3 you have to |
| 231 |
explicitely name alternative Mixers and MidiDevices. Note that it is |
| 232 |
not a good idea to hard-code Tritonus' Mixer or MidiDevice names. The |
| 233 |
recommanded practice (anyway) is to give the user a list of available |
| 234 |
Mixers and MidiDevices and let her/him select an appropriate |
| 235 |
one. These choices may be stored as preferences. If the user doesn't |
| 236 |
explicitely select devices, default devices should be used (as |
| 237 |
provided by the Java Sound implementation, not hard-coded ones). |
| 238 |
|
| 239 |
You may want to opt to completely replace the jdk's Java Sound |
| 240 |
implementation by Tritonus. There are not many cases where this does |
| 241 |
make sense. It can be necessary to shadow severe bugs, but there are |
| 242 |
few of them. For now, it's mainly an option for testing Tritonus. It |
| 243 |
is not recommanded for normal users. Here is how it works: |
| 244 |
|
| 245 |
Since the native versions of the javax.sound.* classes are in the boot |
| 246 |
class path, it is necessary to alter the boot class path. Start the VM |
| 247 |
with the following options: |
| 248 |
|
| 249 |
java -Xbootclasspath/p:/path/to/tritonus_core.jar:/path/to/tritonus_share.jar |
| 250 |
|
| 251 |
This prepends some of the Tritonus .jars to the boot class path, |
| 252 |
resulting in Tritonus' versions of javax.sound.* shadowing the native |
| 253 |
ones. Note that this still does not remove the native service |
| 254 |
providers. To remove them, you have to edit or remove configuration |
| 255 |
files packaged in rt.jar. The easiest way is to just remove them. So, |
| 256 |
remove the following files from rt.jar: |
| 257 |
|
| 258 |
META-INF/services/javax.sound.midi.spi.MidiDeviceProvider |
| 259 |
META-INF/services/javax.sound.midi.spi.MidiFileReader |
| 260 |
META-INF/services/javax.sound.midi.spi.MidiFileWriter |
| 261 |
META-INF/services/javax.sound.midi.spi.SoundbankReader |
| 262 |
META-INF/services/javax.sound.sampled.spi.AudioFileReader |
| 263 |
META-INF/services/javax.sound.sampled.spi.AudioFileWriter |
| 264 |
META-INF/services/javax.sound.sampled.spi.FormatConversionProvider |
| 265 |
META-INF/services/javax.sound.sampled.spi.MixerProvider |
| 266 |
|
| 267 |
Be sure to keep a copy of the original rt.jar, so that you can easily |
| 268 |
restore the original state. |
| 269 |
|
| 270 |
And again: Be warned that this is a guru-level option. Don't dare to |
| 271 |
ask for help on a mailing list if something fails. You have to know |
| 272 |
what you are doing. |
| 273 |
|
| 274 |
|
| 275 |
TODO |
| 276 |
|
| 277 |
[table: which provider in which .jar] |
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
MISCELLANEOUS |
| 283 |
|
| 284 |
If you found bugs, have suggestions, want to contribute or whatever, |
| 285 |
you can contact the authors of this library: |
| 286 |
mailto:[email protected] |
| 287 |
|
| 288 |
Further information on Tritonus: |
| 289 |
http://www.tritonus.org/ |
| 290 |
|
| 291 |
You may also have a look at the Tritonus developer page: |
| 292 |
http://tritonus.sourceforge.net/developer.html |
| 293 |
|
| 294 |
Have fun!! |
| 295 |
|
| 296 |
|
| 297 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 298 |
Material not yet integrated (may be out of date) |
| 299 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 300 |
|
| 301 |
README.midi |
| 302 |
----------- |
| 303 |
|
| 304 |
ALSA |
| 305 |
---- |
| 306 |
|
| 307 |
The MIDI stuff of tritonus makes heavy use of the ALSA sequencer. |
| 308 |
ALSA is the Advanced Linux Sound Architecture |
| 309 |
(http://www.alsa-project.org), a new soundcard driver system intended |
| 310 |
to replace the OSS/Free driver in future kernels. |
| 311 |
|
| 312 |
|
| 313 |
HOW TO MAKE IT WORK |
| 314 |
------------------- |
| 315 |
|
| 316 |
Use a recent 2.2 kernel. The developer of this stuff uses 2.2.10 and |
| 317 |
2.2.14 kernels; every kernel newer than 2.2.3 should work. In the |
| 318 |
kernel configuration, enable sound support, but do not include any |
| 319 |
concrete driver. Enabling kernel symbol versioning helps if you |
| 320 |
recompile kernels frequently. |
| 321 |
|
| 322 |
Download and install the ALSA drivers/lib/utils version 0.5.x. |
| 323 |
You cannot use earlier versions of ALSA due to incompatible |
| 324 |
changes. Be sure to configure '--with-sequencer=yes' in the driver |
| 325 |
part. Install the modules and load the new versions. Load the |
| 326 |
sequencer modules. For help on installing ALSA, see the alsa-user |
| 327 |
mailing list (visit the ALSA web site). |
| 328 |
|
| 329 |
|
| 330 |
Installation check |
| 331 |
------------------ |
| 332 |
|
| 333 |
> cat /proc/asound/seq/clients |
| 334 |
The result should be similar to this: |
| 335 |
Client info |
| 336 |
cur clients : 2 |
| 337 |
peak clients : 2 |
| 338 |
max clients : 192 |
| 339 |
|
| 340 |
Client 0 : "System" [Kernel] |
| 341 |
Port 0 : "Timer" (system:Rwe:Rwe) |
| 342 |
Port 1 : "Announce" (system:R-e:R-e) |
| 343 |
Client 64 : "0: MIDI Synth" [Kernel] |
| 344 |
Port 0 : "MIDI 0-0" (device:RWe:RWe) |
| 345 |
|
| 346 |
If the file doesn't exist at all, load the sequencer module: |
| 347 |
|
| 348 |
modprobe snd-seq |
| 349 |
|
| 350 |
If the file exists, but the "MIDI Synth" doesn't show up, load the |
| 351 |
MIDI client module: |
| 352 |
|
| 353 |
modprobe snd-seq-midi |
| 354 |
|
| 355 |
If the internal synthesizer of your card is supported (not all |
| 356 |
cards), you can load the synth support, too: |
| 357 |
|
| 358 |
modprobe snd-seq-synth |
| 359 |
|
| 360 |
There may be additional lines if you have more than one soundcard, |
| 361 |
your soundcard has more than one MIDI port or the internal synth of |
| 362 |
the soundcard is supported. |
| 363 |
|
| 364 |
Second install check |
| 365 |
-------------------- |
| 366 |
|
| 367 |
Install pmidi (http://www.parabola.demon.co.uk/alsa/pmidi.html). |
| 368 |
You need version 1.4.0 or later. |
| 369 |
Call 'pmidi -l'. The output should be similar to this: |
| 370 |
Port Client name Port name |
| 371 |
64:0 0: MIDI Synth MIDI 0-0 |
| 372 |
|
| 373 |
Connect a synthesizer to the MIDI out of your computer. Call 'pmidi |
| 374 |
-p 64:0 <midifile>'. '64:0' should be the number shown in the first |
| 375 |
column of the output from 'pmidi -l'. The MIDI file should be played |
| 376 |
on your synth. |
| 377 |
|
| 378 |
(Hopefully) finished! |
| 379 |
--------------------- |
| 380 |
|
| 381 |
Now you should be able to use Tritonus with the ALSA sequencer. |