View previous topic :: View next topic |
Author |
Message |
chris_harvey n00b
Joined: 12 Mar 2010 Posts: 42 Location: Ottawa, Canada
|
Posted: Sat Jun 30, 2012 12:44 am Post subject: [SOLVED] timidity++ and pulseaudio |
|
|
I'm running media-sound/timidity++-2.13.2-r13
if I run timidity from as my user with 'timidity -iA', then play a midi I can hear sound.
the /etc/init.d/timidity script looks like this:
Code: | #!/sbin/runscript
depend() {
after alsasound esound
}
start() {
ebegin "Starting TiMidity++ Virtual Midi Sequencer"
test -n "$TIMIDITY_PCM_NAME" && export TIMIDITY_PCM_NAME
start-stop-daemon --start --background --chdir /usr/share/timidity \
--user timidity:audio --make-pidfile --pidfile /var/run/timidity.pid \
--exec /usr/bin/timidity -- -iA ${TIMIDITY_OPTS}
eend $?
}
stop() {
ebegin "Stopping TiMidity++"
start-stop-daemon --stop --quiet --pidfile /var/run/timidity.pid
eend $?
}
|
running timidity with exactly the same options as the init script passes works fine, so long as it's run as a normal user. The --user flag in the init script says to run as the timidity user...fine. I added timidity to the pulse and pulse-access groups and rebooted my computer, but still no sound.
cat /etc/groups | grep pulse
Code: | audio:x:18:chris,pulse,other,timidity
pulse-access:x:102:timidity
pulse:x:101:timidity
|
looks like this could be a bad pulseaudio/timidity setup...bug report worthy?
thanks,
Chris
Last edited by chris_harvey on Sat Jun 30, 2012 5:22 pm; edited 1 time in total |
|
Back to top |
|
|
olek Apprentice
Joined: 22 Oct 2011 Posts: 173
|
|
Back to top |
|
|
chris_harvey n00b
Joined: 12 Mar 2010 Posts: 42 Location: Ottawa, Canada
|
Posted: Sat Jun 30, 2012 3:18 am Post subject: |
|
|
removed all users from audio group.
MIDI works, but no other sound. |
|
Back to top |
|
|
olek Apprentice
Joined: 22 Oct 2011 Posts: 173
|
Posted: Sat Jun 30, 2012 7:20 am Post subject: |
|
|
At my setup, there are also no users in pulse and pulse-access. _________________ https://plaintext.blog |
|
Back to top |
|
|
chris_harvey n00b
Joined: 12 Mar 2010 Posts: 42 Location: Ottawa, Canada
|
Posted: Sat Jun 30, 2012 1:10 pm Post subject: |
|
|
no change.
strange thing is I can see applications playing sound in the pulse audio volume mixer, but only a few are actually played.
working:
timidity
limbo (standalone game, not in portage)
broken:
flash player
audacious
I haven't tested further.
EDIT: rm -rf ~/.pulse* fixed the no sound problem!
midi is still broken, but I don't use it much so I can just run the server as a normal user when I need it. |
|
Back to top |
|
|
worch n00b
Joined: 10 Apr 2013 Posts: 4
|
Posted: Wed Apr 10, 2013 3:16 am Post subject: |
|
|
This thread was marked as solved, but I see no proposed solution.
I suspect the problem is related to the way timidity daemon is configured to access the sound system. Chris's symptoms are similar to mine in that only either pulseaudio or timidity work. This suggests that the timidity daemon is trying to grab exclusive access to the audio device instead of using the virtual alsa device, pulse, provided by pulseaudio.
Pulseaudio on gentoo is setup to use udev and consolekit to grant audio access dynamically to the currently active user. See http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/PerfectSetup. (Note: if the system-wide USE flag is defined, the behavior is probably different). /etc/init.d/timidity is configured to run the daemon under the timidity user, which is not the currently active user, and in the audio group, in which there should be no user.
Code: | start() {
ebegin "Starting TiMidity++ Virtual Midi Sequencer"
test -n "$TIMIDITY_PCM_NAME" && export TIMIDITY_PCM_NAME
start-stop-daemon --start --background --chdir /usr/share/timidity \
--user timidity --group audio --make-pidfile --pidfile /var/run/timidity.pid \
--exec /usr/bin/timidity -- -iA ${TIMIDITY_OPTS}
eend $?
} |
As a workaround, I was able to get the timidity daemon to work properly by running the daemon under my active user's credentials. I removed "--group audio" and replace "--user timidity" with "--user worch" e.g.
Code: | start() {
ebegin "Starting TiMidity++ Virtual Midi Sequencer"
test -n "$TIMIDITY_PCM_NAME" && export TIMIDITY_PCM_NAME
start-stop-daemon --start --background --chdir /usr/share/timidity \
--user worch --make-pidfile --pidfile /var/run/timidity.pid \
--exec /usr/bin/timidity -- -iA ${TIMIDITY_OPTS}
eend $?
} |
|
|
Back to top |
|
|
|