Tux Guitar

Help

  Forums : Help
Subject trying to build tuxguitar-alsa plugin, help



Author Message
colbert
Post: Dec 18th 2007 at 5:34 PM

Hi, I am trying to build the tuxguitar alsa plugin. I have installed ant. Upon typing "ant" I am getting this error:

"bobby@dabox:~/installs/TuxGuitar-alsa-0.9-src$ ant
Buildfile: build.xml

init:

build:
[echo] +--------------------------------------------------------------------+
[echo] | B U I L D I N G T U X G U I T A R - A L S A |
[echo] +--------------------------------------------------------------------+
[javac] Compiling 10 source files to /home/bobby/installs/TuxGuitar-alsa-0.9-src/build
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[echo] +--------------------------------------------------------------------+
[echo] | P A C K A G I N G T U X G U I T A R - A L S A |
[echo] +--------------------------------------------------------------------+
[jar] Building jar: /home/bobby/installs/TuxGuitar-alsa-0.9-src/TuxGuitar-alsa.jar
[echo] +--------------------------------------------------------------------+
[echo] | B U I L D I N G N A T I V E - L I B R A R I E S |
[echo] +--------------------------------------------------------------------+
[exec] gcc -c -o midi_receiver.o midi_receiver.c
[exec] In file included from midi_receiver.c:3:
[exec] midi_receiver.h:2:17: error: jni.h: No such file or directory
[exec] In file included from midi_receiver.c:3:
[exec] midi_receiver.h:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.h:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.h:39: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.h:47: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.h:55: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.h:63: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.h:71: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.c:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.c:67: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.c:80: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.c:99: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.c:116: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.c:133: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.c:152: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] midi_receiver.c:171: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
[exec] make: *** [midi_receiver.o] Error 1

BUILD FAILED
/home/bobby/installs/TuxGuitar-alsa-0.9-src/build.xml:52: exec returned: 2

Total time: 3 seconds
bobby@dabox:~/installs/TuxGuitar-alsa-0.9-src$"

Any help is appreciated, thanks.


Back to Top
 
Julian
Post: Dec 18th 2007 at 5:47 PM

Hi,
try edit "TuxGuitar-alsa/src/jni/MakeFile" and uncomment "# INCLUDES...." line

then type ant again


Back to Top
 
colbert
Post: Dec 18th 2007 at 5:58 PM

Julian,

Thank you, it built successfully now! Okay, I have run tuxguitar and see the Plugins menu, I selected alsa plugin and hit okay. Now in settings > configure tuxguitar > sound, what do I do? Default or custom soundbank? I tried Custom Soundbank and loaded the plugin_tuxguitar-alsa.properties file, restarted and it said "Failed to use custom soundbank."

??


Back to Top
 
colbert
Post: Dec 18th 2007 at 6:22 PM

Okay, running tuxguitar with default soundbank and the Alsa plugin active, but I don't hear anything when it plays. In the Alsa plugin dialog box, the Device field is empty, I can't select anything.


Back to Top
 
Julian
Post: Dec 18th 2007 at 7:29 PM

> Now in settings > configure tuxguitar > sound, what do I do?
Java Soundbanks has no effect if alsa plugin is active.

> I tried Custom Soundbank and loaded the plugin_tuxguitar-alsa.properties file,
this file is not a soundbank.. it's only a config file for the tuxguitar-alsa plugin

> restarted and it said "Failed to use custom soundbank."
That's a known bug.. it happends because tuxguitar-alsa plugin is loaded "after" the default sound system.. so it try load the soundbank you select, and it throws the error because it's not a valid soundbank


> In the Alsa plugin dialog box, the Device field is empty,
Here is where you need select something..
but i don't know why you don't see anything.. ( you should see the default "Midi Through Port"
maybe don't your kernel have "snd-seq" module loaded ??
try this ( as root ) :
modprobe snd-seq

However, that port don't play any sound as default (but yes you need the "snd-seq" module loaded ).. you need install a software synthesizer, like "timidity"
try install it, and then execute the timidity daemon:
timidity -iA -Os &

then restart tuxguitar, and select one timidity port on tuxguitar-alsa.

bye


Back to Top
 
colbert
Post: Dec 18th 2007 at 9:17 PM

Julian,

"modprobe snd-seq"
^^ this does nothing at shell, run as root. I enter it and prompt comes again, seems it is doing nothing. How can I get/fix this?

"timidity -iA -Os &"
^^ Running this, I get:

"[bobby@dabox TuxGuitar-alsa-0.9-src]$ timidity -iA -Os &
[1] 28745
[bobby@dabox TuxGuitar-alsa-0.9-src]$ Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 30104, period size 3760 bytes
TiMidity starting in ALSA server mode
Opening sequencer port: 128:0 128:1 128:2 128:3

[bobby@dabox TuxGuitar-alsa-0.9-src]$"

Now I run tuxguitar, I see ports 0-3 in tuxguitar-alsa, and I tried all of them, but can't hear anything. Here is in shell what shows as I ran tuxguitar and tried playing:

"[bobby@dabox TuxGuitar-alsa-0.9-src]$ Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 30104, period size 3760 bytes
Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 30104, period size 3760 bytes
Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 30104, period size 3760 bytes
Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 30104, period size 3760 bytes
Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 30104, period size 3760 bytes
Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 30104, period size 3760 bytes"

Means it's working, or at least in part? I think I am getting close hehe. I really want to use tuxguitar via Alsa!! It's my favourite program as I am a guitar player :) :)

Hope we can fix this, thanks for your help so far friend.


Back to Top
 
Anonymous
Post: Dec 19th 2007 at 8:32 AM

> How can I get/fix this?
the command "lsmod" show you a list of loaded modules..
so you can do this to see the alsa sound modules loaded:
lsmod | grep snd

if snd_seq ( or snd-seq ) isn't at the list, you must load:
modprobe snd_seq

this command, don't show a successfull result..( only errors )

> Means it's working, or at least in part?
mmm..
you "could" connect "tuxguitar -> alsa -> timidity", so the plugin worked.
but now your timidity don't play sounds :) and that is a "new" problem.
how did you install timidity ?? ( what GNU/Linux distribution do you have ? )

i'm not a "timidity" expert.. but we'll try fix it...
does your timidity config file have any "soundfont" or "patchs" available ??? ( i have it with "freepats" as default )


to test timidity .. i suggest you try it with a .midi file (not as daemon) :
timidity FILE.mid


Back to Top
 
colbert
Post: Dec 19th 2007 at 6:07 PM

Okay, in lsmod | grep snd, I see snd_seq, it is loaded.

I am using Arch linux. I installed timidity by doing "pacman -S timidity++" and here is the details of the timidity installed on my computer, from the package database:

"bobby@dabox:~$ p -Qi timidity++
Name : timidity++
Version : 2.13.2-5
URL : http://timidity.sourceforge.net
License : GPL
Groups : None
Provides : None
Depends On : libao libvorbis jack-audio-connection-kit>=0.102.20-2
Removes : None
Required By : None
Conflicts With : None
Installed Size : 1262.24 K
Packager : Arch Linux (http://www.archlinux.org)
Architecture : i686
Build Date : Sun Mar 11 17:40:02 2007 UTC
Build Type : Unknown
Install Date : Tue Dec 18 18:18:10 2007 UTC
Install Reason : Explicitly installed
Install Script : No
Description : TiMidity is a MIDI to WAVE converter and player

bobby@dabox:~$"


What is the timidity config file? I know nothing of timidity hehe. And I don't have any .mid files to test with.

So snd_seq is loaded, tuxguitar works and loads and plays files with the alsa plugin, but I just can't hear anything. So this is most likely a setting in timidity where the sound must be off or muted or something...


Back to Top
 
Julian
Post: Dec 20th 2007 at 7:59 AM

Well, as i see on timidity package dependencies, it don't depends on any soundfont or sound patchs. (and i don't think they are included at timidity package )

On my system, timidity package depends on "freepats", so that's why i get sounds as default.

See this doc:
http://wiki.archlinux.org/index.php/Timidity

I suggest you this soundfont:
ftp://ftp.personalcopy.net/pub/Unison.sf2.gz

uncompress it, and add this line in /etc/timidity++/timidity.cfg :
soundfont /WHERE_IS_THE_FILE/Unison.sf2


> What is the timidity config file
is a simple text where timidity found the sound info..
i have it on: "/etc/timidity/timidity.cfg" ( as i see on the arch linux package info you have it at "etc/timidity++/timidity.cfg" )

> And I don't have any .mid files
you can export midi files width tuxguitar.


Back to Top
 
colbert
Post: Dec 20th 2007 at 5:24 PM

Thank you!!! It is working :)

So I have placed the Unison.SF2 in my /home/user, edited the timidity.cfg and tried it now. My .ptb file plays just fine in tuxguitar, and I also played Amarok and VLC video at the same time, all is working!

Now, do I have to start timidity with that command everytime I want to use it? Because if I don't do "timidity -iA -Os &" then I see nothing in the alsa plugin for Devices. When I run that command and start timidity I do see ports 0-3.

Also, does it matter which port I use? I just tried all 4 and they all work.

Again, thank you so much, I was so frustrated having to close firefox, vlc, etc. every time I wanted to play tuxguitar. Now it's so much easier :) TY!


Back to Top
 
Anonymous
Post: Dec 20th 2007 at 9:14 PM

> So I have placed the Unison.SF2 in my /home/user,
Great!..
now you know how to configure timidity.. so you can search more soundfonts on the web, and set your favourite

> Now, do I have to start timidity with that command everytime I want to use it?
You can make an init script to run timidity daemon when your OS boot, but i don't know how rc.d scripts works on Arch Linux..

Under my debian and ubuntu that scrips already exists with the timidity package:
/etc/init.d/timidity [start | stop] ( this script run timidity -iA -Os as daemon)

with links at
/etc/rc*.d/S99timidity ( for start at boot)
/etc/rc*.d/K99timidity ( for kill at shutdown)

So.. you'll need investigate about it on Arch Linux

> Also, does it matter which port I use? I just tried all 4 and they all work.
no it don't matters, i think there are 4 ports, because maybe you want connect more than one app to the synthesizer at the same time. ( e.g: tuxguitar -> 128:0 and rosegarden -> 128:1 )

Bye


Back to Top
 
colbert
Post: Dec 21st 2007 at 7:26 PM

Thanks guys, this is so great. I am really enjoying this now, it works so well. I have added timidity to my startup daemons in my /etc/rc.conf, so it runs just fine.

Tuxguitar rules! :D


Back to Top
 
colbert
Post: Jan 12th 2008 at 11:12 PM

I reinstalled Arch last week and am running into this now (long output so I pastebin it):

http://pastebin.ca/852776


Back to Top
 
colbert
Post: Jan 14th 2008 at 6:10 PM

help ??


Back to Top
 
Johnny
Post: Jan 14th 2008 at 6:29 PM

You are having problems with Java dependencies. You have to add "swt.jar" and "TuxGuitar.jar" (maybe even new CVS version, I'm not sure) in your classpath.
Maybe it's way easier to download binary package from download page ( http://tuxguitar.com.ar/download.html ).


Back to Top
 
colbert
Post: Jan 14th 2008 at 7:44 PM

Can you please elaborate on what you mean by adding swt.jar and TuxGuitar.jar in my classpath? I'm still a bit new so I don't understand how to do that yet. And I am using the source package.

Thx


Back to Top
 
Johnny
Post: Jan 14th 2008 at 11:57 PM

If you are using Eclipse, you should go to Project Properties, Libraries and click on "Add external JARs". Add both *.jar files.

If you are not using Eclipse, but only javac, you should run it with -classpath=/path/to/TuxGuitar.jar;/path/to/SWT.jar.

If you want to run TuxGuitar from sources, there are some hints in the Wiki:
http://tuxguitar.com.ar/tgwiki/doku.php?id=doc:eclipse_import


Back to Top
 
colbert
Post: Jan 15th 2008 at 12:49 AM

Sorry, I still do not understand. I currently have tuxguitar-alsa-0.9-src folder, and I am at the point of typing "ant" to build it and this is not working. I just tried the command:

"ant -classpath=/home/bobby/tuxguitar-0.9.1-update1/lib/swt.jar;/home/bobby/tuxguitar-0.9.1-update1/TuxGuitar.jar"

That didn't work, even as root, it said:

"bash: /home/bobby/tuxguitar-0.9.1-update1/TuxGuitar.jar: Permission denied"

I never used eclipse but I just installed it. So what can I do now??


Back to Top
 
Johnny
Post: Jan 15th 2008 at 11:25 AM

Why do you need to compile it so badly?

Take the binary version. Or I'll compile it for your specific needs, it is still easier than to teach you.


Back to Top
 
colbert
Post: Jan 15th 2008 at 10:03 PM

Whoops, I got it now, it is working just fine. Thanks!!


Back to Top