I have been testing this on Karmic and so far have come up with the following conclusions (please correct me if any of these are not correct):
- Out of the box timidity and pulse audio cannot play at the same time.
- Restarting timidity (sudo /etc/init.d/timidity restart) gets timidity to work again for a short while, until pulse audio takes control again.
- Timidity does not appear as an application within Sound Preferences.
- Timidity is started with the system
- Timidity runs as the user 'timidity'. It no longer runs as root.
- Pulseaudio runs as the logged in user.
- The 'timidity' user is a member of the 'audio' group and is not a member of the 'pulse-access' group.
I thought that adding the timidity user to the pulse-access group was going to be the answer. Sadly not, as timidity still didn't show up as an application within Sound Preferences.
The command I used was:
sudo usermod -a -G pulse-access timidity
I then tried running timidity at the command line. So first stopped the timidity daemon and then started it in a shell:
sudo /etc/init.d/timidity stop
timidity -Os -iA
Which works. The Sound Preferences window includes the application "ALSA plug-in [timidity]", and both midi and audio from other application play together nicely.
So I then tried to start timidity in the shell as the 'timidity' user to see if that worked:-
sudo -u timidity timidity -Os -iA
The output of which was:-
======================================
No protocol specified
XOpenDisplay() failed
Home directory /home/daniel not ours.
W: core-util.c: Failed to open configuration file '/home/daniel/.pulse//daemon.conf': Permission denied
W: daemon-conf.c: Failed to open configuration file: Permission denied
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
Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 30104, period size 3760 bytes
======================================
This failed to connect to pulseaudio correctly. To resolve the permission denied errors, I added rwx permissions to /home/daniel/.pulse using:
chmod o+rwx ~/.pulse
Now timidity starts without the permission denied errors, but still fails to connect to pulse audio correctly. I don't understand what else is needed to get a process to connect to pulse audio from a different user id. Any ideas?
I have been testing this on Karmic and so far have come up with the following conclusions (please correct me if any of these are not correct):
- Out of the box timidity and pulse audio cannot play at the same time. d/timidity restart) gets timidity to work again for a short while, until pulse audio takes control again.
- Restarting timidity (sudo /etc/init.
- Timidity does not appear as an application within Sound Preferences.
- Timidity is started with the system
- Timidity runs as the user 'timidity'. It no longer runs as root.
- Pulseaudio runs as the logged in user.
- The 'timidity' user is a member of the 'audio' group and is not a member of the 'pulse-access' group.
I thought that adding the timidity user to the pulse-access group was going to be the answer. Sadly not, as timidity still didn't show up as an application within Sound Preferences.
The command I used was:
sudo usermod -a -G pulse-access timidity
I then tried running timidity at the command line. So first stopped the timidity daemon and then started it in a shell:
sudo /etc/init. d/timidity stop
timidity -Os -iA
Which works. The Sound Preferences window includes the application "ALSA plug-in [timidity]", and both midi and audio from other application play together nicely.
So I then tried to start timidity in the shell as the 'timidity' user to see if that worked:-
sudo -u timidity timidity -Os -iA
The output of which was:-
======= ======= ======= ======= ======= === daniel/ .pulse/ /daemon. conf': Permission denied ======= ======= ======= ======= ===
No protocol specified
XOpenDisplay() failed
Home directory /home/daniel not ours.
W: core-util.c: Failed to open configuration file '/home/
W: daemon-conf.c: Failed to open configuration file: Permission denied
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
Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 30104, period size 3760 bytes
=======
This failed to connect to pulseaudio correctly. To resolve the permission denied errors, I added rwx permissions to /home/daniel/.pulse using:
chmod o+rwx ~/.pulse
Now timidity starts without the permission denied errors, but still fails to connect to pulse audio correctly. I don't understand what else is needed to get a process to connect to pulse audio from a different user id. Any ideas?