You are not logged in.

#1 2011-06-19 10:05:51

lazork
Member
Registered: 2008-11-12
Posts: 30

[SOLVED] Timidity++ (and tuxguitar) problems with pulseaudio

I'm having two problems with timidity, even though I've followed the instructions on the wiki.

The first is that I can't start timidity by putting it in the daemons array in /etc/rc.conf.
It gives the following error during boot and fails to start:

socket(): Address family not supported by protocol
socket(): Address family not supported by protocol
Couldn't open output device

It works just fine if I start it later in a terminal:

/etc/rc.d/timidity++ start

I can't understand why it should make a difference...

The second problem concerns using timidity with tuxguitar.
After starting the timidity daemon manually and setting tuxguitar to use the timidity port and the "real time sequencer" it still doesn't produce any sound.
I've menaged to make it work by starting timidity with:

timidity -iA

Again, isn't it possible to obtain the same result by using the daemon?

I haven't been able to find any of these problems anywhere (google and forums) so any suggestion would be appreciated

Last edited by lazork (2011-06-21 16:12:35)

Offline

#2 2011-06-20 10:06:20

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: [SOLVED] Timidity++ (and tuxguitar) problems with pulseaudio

1. Edit /etc/rc.d/timidity++ and remove the pipes to /dev/null, i.e the "> /dev/null". Then add "read" to the end of /etc/rc.local to monitor the process. Alternatively, you may replace the pipe to null with a text file to log the ouput of the daemon, example "> /tmp/timidity-daemon.log", and boot normally to then analyse the log file created.

2. Play a MIDI file with timidity to ensure playback works.


I need real, proper pen and paper for this.

Offline

#3 2011-06-20 12:09:27

lazork
Member
Registered: 2008-11-12
Posts: 30

Re: [SOLVED] Timidity++ (and tuxguitar) problems with pulseaudio

it really seems that running timidity as a daemon is what's causing the problem.
"timidity -iA" works, but "timidity -iAD" produces this error message when i start tuxguitar:

Can't open pcm device 'default'.
Couldn't open ALSA pcm device (`s')
schivmeister wrote:

2. Play a MIDI file with timidity to ensure playback works.

playing a file using "timidity file.mid" works perfectly (even with timidity running as a daemon)

I figured I could use fluidsynth instead of timidity, but one problem remains:
I can't start the daemon by putting it in the daemon array.
I think in both cases it has to do with the fact that pulseaudio is not yet running.
Isn't there a way to start pulseaudio as a daemon? If i understand correctly how it works, pulseaudio is run on a user level...so what's the solution?

1. Edit /etc/rc.d/timidity++ and remove the pipes to /dev/null, i.e the "> /dev/null". Then add "read" to the end of /etc/rc.local to monitor the process. Alternatively, you may replace the pipe to null with a text file to log the ouput of the daemon, example "> /tmp/timidity-daemon.log", and boot normally to then analyse the log file created.

Thanks, useful tip, it will surely come in handy in the future

EDIT: fluidsynth uses too much cpu when in idle, so I'm not liking it as an alternative

Last edited by lazork (2011-06-20 12:18:00)

Offline

#4 2011-06-20 20:01:45

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: [SOLVED] Timidity++ (and tuxguitar) problems with pulseaudio

PulseAudio must be the root of your problem. And the root of that problem is root itself, i.e the root user. When you start a daemon, you're starting it as root, and system policies may be preventing that from connecting to pulse. To test this hypothesis, could you try starting the daemon as root _after_ bootup? You may have to resort to loading the daemon from a startup script if that is indeed the issue.

edit: indeed it is inherent:

https://bugs.launchpad.net/ubuntu/+sour … bug/210472
http://blog.flameeyes.eu/2007/11/24/pro … pulseaudio
http://www.pulseaudio.org/wiki/PerfectSetup#TiMidity

Last edited by schivmeister (2011-06-20 20:06:24)


I need real, proper pen and paper for this.

Offline

#5 2011-06-20 21:29:38

lazork
Member
Registered: 2008-11-12
Posts: 30

Re: [SOLVED] Timidity++ (and tuxguitar) problems with pulseaudio

I always start daemons as root (they give problems otherwise). Anyway, running timidity as a daemon (using "timidity -iAD" instead of "timidity -iA") is causing it not to work (and running it as a user or as root makes no difference). So putting it in the daemon array is useless anyway, since it's not working when started a s a daemon in the first place.
Using a different output for timidity as suggested in two of your links is not working either (other problems, but I believe  trying to solve those too it's not worth it)
I guess the simplest solution would be to start timidity within some script executed after login and to kill it at logout. Are there any such kind of scripts, where i can add something like:

timidity -iAD &

and

killall timidity

?

I'm really thankful for the huge help you're giving me...
I just wonder how can I be the only one having problems with timidity, now that gnome is using pulseaudio by default

Offline

#6 2011-06-21 15:29:44

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: [SOLVED] Timidity++ (and tuxguitar) problems with pulseaudio

Oops, what I meant was "try starting the daemon after login", but actually you mentioned that in the first post already which I had somehow missed. I cannot reproduce this because I run neither GNOME nor PulseAudio.

There are a lot of ways you can start it upon login, but since this does not depend on a GUI environment, you can just start it with .bashrc and kill it with .bash_logout.


I need real, proper pen and paper for this.

Offline

#7 2011-06-21 16:10:29

lazork
Member
Registered: 2008-11-12
Posts: 30

Re: [SOLVED] Timidity++ (and tuxguitar) problems with pulseaudio

schivmeister wrote:

There are a lot of ways you can start it upon login, but since this does not depend on a GUI environment, you can just start it with .bashrc and kill it with .bash_logout.

Exactly what I was looking for.
In case someone else should encounter the same problem, here is what I added to .bashrc and .bash_logout:

.bashrc

timidity -iA > /dev/null 2>&1 &

.bash_logout

killall timidity

Thanks again for your help, I'll mark the topic as "solved"

Offline

Board footer

Powered by FluxBB