Re: Which X server gets to use sound



hans_schulze98@xxxxxxxx (Hans Schulze) writes:

> f95-msv@xxxxxxxx (=?iso-8859-1?Q?M=E5rten?= Svantesson) wrote in message news:<h6b64v57bry.fsf@xxxxxxxxxxxxxxxxxxx>...
>> hans_schulze98@xxxxxxxx (Hans Schulze) writes:
>>
>> > I am running several X servers (all with KDE), all on the same
>> > monitor. How
>> > do I know (and control) which one gets to use the sound output?
>> > Apparently only one at a time can make sound, but sometimes none of
>> > them can and usually the one I need can not.
>>
>> The X servers have nothing to do with the sound.
>
> You are right. All programs using sound that I know run under X, but
> that does not necessarily mean that X is needed.
>
>> On Linux it works something like this:
>> When you log in on the console the ownership of some devices,
>> especially audio devices, are given to you. So, if you log in locally
>> on several accounts you get in trouble.
>
> In this case, nobody ever logs in on the text console (there may not
> be any text consoles) but there are X servers. If only the active
> server (the one who has the screen) gets to use sound there should be
> no trouble.

I didn't specify text console. I meant any console, including X. And
as I said, think users, not servers.

>
>> You probably have a file /etc/security/console.perms
>
> Unfortunately not. I have no idea which script sets this. Looked but
> did not find.

No script at all. It's normally handled by the PAM framework, Pluggable
Authentication Modules. The relevant module is pam_console. It's
configured in console.perms.

See pam(8), pam_console(8) and console.perms(5). Now RTFM ;)

>> manually set the permissions for your audio device to
>> something appopriate you should be fine. This is a common scheme:
>>
>> Add all the users that should be able to use the audio-device
>> to the group audio and then
>>
>> chown root.audio /dev/dsp
>> chmod 660 /dev/dsp
>
> Thanks Marten, these permissions work. Now everyone has audio access.
> How do I set this up to start every time I run X?

The trick is turning of the mechanism that changes the permissions
upon login. See the man pages I mentioned above.

> Better yet, how can I change the owner of that file every time the
> virtual console (vt7, vt8, ...) changes? Is there a script that gets
> run on vt change?

Nothing I've heard of... It seems to be possible for a program to get
a signal when changing from a vt, but I don't know if that is usable.
I suspect not since I've never seen it used for these purposes.

--
- Mårten

mail: msv@xxxxxx *** ICQ: 4356928 *** mobile: +46 (0)707390385
.



Relevant Pages

  • Re: Which X server gets to use sound
    ... >> do I know which one gets to use the sound output? ... > The X servers have nothing to do with the sound. ... > especially audio devices, are given to you. ... nobody ever logs in on the text console (there may not ...
    (comp.windows.x)
  • Re: Which X server gets to use sound
    ... > do I know (and control) which one gets to use the sound output? ... The X servers have nothing to do with the sound. ... especially audio devices, are given to you. ...
    (comp.windows.x)
  • Re: [opensuse] Remote upgrade problem
    ... All my remote sites have serial console servers connected. ... CCM840 8 port, dedicated local console ...
    (SuSE)
  • Re: HALT, CONTINUE ==> CRASH. HUH?
    ... Something the console squats on, something with an I/O controller, software running on these boxes, a specific disk, something that sits on a memory lock state, etc. ... eliminate the need to maintain systems and servers; ... help with my severe reliability issues with the DDS tapes. ... Local usages shows somewhere about five to fifteen uses of each piece of DAT/DDS media and periodic replacement of the drives themselves was to be expected -- this based on the local usage models. ...
    (comp.os.vms)
  • Re: HALT, CONTINUE ==> CRASH. HUH?
    ... use for console sessions causes any connected systems to HALT... ... There are some vendors of terminal servers posted over at the web site, ... managed classically encountered a pile of hardware restart and recovery ... help with my severe reliability issues with the DDS tapes. ...
    (comp.os.vms)