Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] timidity++ and pulseaudio
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
chris_harvey
n00b
n00b


Joined: 12 Mar 2010
Posts: 42
Location: Ottawa, Canada

PostPosted: Sat Jun 30, 2012 12:44 am    Post subject: [SOLVED] timidity++ and pulseaudio Reply with quote

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
View user's profile Send private message
olek
Apprentice
Apprentice


Joined: 22 Oct 2011
Posts: 173

PostPosted: Sat Jun 30, 2012 1:15 am    Post subject: Reply with quote

According http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/PerfectSetup
Quote:
Should users be in the "audio" group?

and http://wiki.gentoo.org/wiki/PulseAudio#Fast_user_switching
Quote:
For ConsoleKit managed permissions to be respected no one may be part of the audio group (not even even the user pulse). In fact, for users to be able to output sound vai PA they do not have to be part of any specific group. Also it is recommended that the acl USE flag is globally enabled (Desktop profiles do this by default).

EDIT: No one should be part of the audio group.
_________________
https://plaintext.blog
Back to top
View user's profile Send private message
chris_harvey
n00b
n00b


Joined: 12 Mar 2010
Posts: 42
Location: Ottawa, Canada

PostPosted: Sat Jun 30, 2012 3:18 am    Post subject: Reply with quote

removed all users from audio group.

MIDI works, but no other sound. :?
Back to top
View user's profile Send private message
olek
Apprentice
Apprentice


Joined: 22 Oct 2011
Posts: 173

PostPosted: Sat Jun 30, 2012 7:20 am    Post subject: Reply with quote

At my setup, there are also no users in pulse and pulse-access.
_________________
https://plaintext.blog
Back to top
View user's profile Send private message
chris_harvey
n00b
n00b


Joined: 12 Mar 2010
Posts: 42
Location: Ottawa, Canada

PostPosted: Sat Jun 30, 2012 1:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
worch
n00b
n00b


Joined: 10 Apr 2013
Posts: 4

PostPosted: Wed Apr 10, 2013 3:16 am    Post subject: Reply with quote

This thread was marked as solved, but I see no proposed solution. :o

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum