Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 54066 - /etc/init.d/timidity is starting Timidity as the wrong user (?) - alsa dmix
Summary: /etc/init.d/timidity is starting Timidity as the wrong user (?) - alsa dmix
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-16 00:38 UTC by Joël
Modified: 2004-06-28 01:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joël 2004-06-16 00:38:32 UTC
It is a rather strange problem..

When I start Timidity++ using:
/etc/init.d/timidity start  --or--  sudo timidity -iA -oS

And I do:
pmidi hello.mid &
aoss mpg123 test.mp3  <<<<-  this doesn't work (mpg123 waits forever)
.. it seems Timidity locks /dev/dsp (probably no use of dmix?)

But when I start it as a user:
timidity -iA -oS

I can then successfully do:
pmidi hello.mid &
aoss mpg123 test.mp3

... and the songs play simultaneously.

So, would it be a better idea to:
- start Timidity as non-root ?
- or tell Timidity to drop root priviledged (but how??)

When I launch Timidity with "su myuser -c" from root, it works.

For reference my ALSA dmix config is:

-= cat /etc/asound.conf =-
pcm.!default { type plug slave.pcm "swmix" }
pcm.dsp0 { type plug slave.pcm "swmix" }
pcm.swmix {
    type dmix
    ipc_key 888
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 8192
        rate 48000
    }
}
Comment 1 Jeremy Huddleston (RETIRED) gentoo-dev 2004-06-16 10:05:54 UTC
I have had THE worst luck getting dmix to work correctly with my test system...  but I did get it to work, and timidity played nice with it... I'm guessing that your sound card doesn't have friendly dmix support or something, but the root/non-root issue is really puzzling... what about adding your user to the 'audio' group (don't forget to logout/login after)?
Comment 2 Joël 2004-06-16 14:21:12 UTC
I agree it's quite strange..  the whole point of dmix was to compensate for those soundcards by mixing in software :-)

Yes, my user already belongs to group 'audio'.

Clearly, there's something strange when Timidity is started as root.

Should I add root to the 'audio' group too ?
Comment 3 Jeremy Huddleston (RETIRED) gentoo-dev 2004-06-16 17:42:59 UTC
what happens when you start xmms as root and run mpgq23 as root (not through aoss)?
Comment 4 Joël 2004-06-17 07:19:24 UTC
If I run xmms as root, it hangs until pmidi is stopped. Whether I run timidity as root or user, doesn't matter in this case.

If I run xmms as user, it does work simultaneously with pmidi, but *only* if I started timidity as user too.
Comment 5 Jeremy Huddleston (RETIRED) gentoo-dev 2004-06-28 01:04:34 UTC
You're going to have to talk to the alsa devs upstream to get this straightened out.  I can't reproduce this problem.  dmix is very touch-and-go, so I am betting that is the problem rather than timidity.