You are not logged in.

#1 2022-06-02 22:13:56

pradtf
Member
Registered: 2009-06-10
Posts: 149

SOLVED latency with midi keyboard, timidity++ and rosegarden

running timidity.service, rosegarden and working with a yamaha P35 keyboard.
using the FluidR3_GM.sf2 soundfont.

i press the keys and the midi sound comes out nearly 1/2 s later.

if i run fluidsynth.service instead of timidity then there is no delay.

so i presume the problem lies with timidity or the way i started the service, but am not sure how else to do it.

in the timidity wiki it says:
Daemon mode plays sound out of pace
TiMidity++'s ALSA output module (default) may cause this issue in ALSA server mode. Try another output option, for example, libao:
timidity -iA -OO
https://wiki.archlinux.org/title/Timidity++

so that works!

however, how do i go into libao mode (whatever that is) using systemd and just running the timidity.service?
i presume i can set libao mode in /etc/timidity/timidity.cfg (but don't know yet how to - there is no libao in the timidity.cfg manpage).

EDIT (22-06-02):
here is the solution i finally found to my problem.

/usr/lib/systemd/user/timidity.service
contains the lines
[Service]
ExecStart=/usr/bin/timidity -iA

so i just need to add on -OO to this and it works by putting me in libao!

however, i tried to put the modified file into
~/.config/systemd/user/

and though i can start it from there, i can't successfully enable it getting the following explanation when i try:
Unit ~/.config/systemd/user/timidity.service is added as a dependency to a non-existent unit multi-user.target
even though the directory ~/.config/systemd/user/multi-user.target is created with a timidity.service link to the actual file in .config/...

i don't know why enable is trying to put the ln -s into multi-user.target instead of
.config/systemd/user/default.target.wants/
where my other stuff is.

in any case,
i can just use the file in /usr/lib/systemd/user/
or
i can manually link
ln -s ~/.config/systemd/user/timidity.service  ~/.config/systemd/user/default.target.wants/timidity.service
and all should be well.

Last edited by pradtf (2022-06-03 06:15:02)


in friendship,
prad

Offline

Board footer

Powered by FluxBB