Results 1 to 8 of 8

Thread: Trouble with sound using multiple accounts

  1. #1
    Join Date
    Dec 2008
    Location
    Cornwall, PEI Canada
    Posts
    30

    Default Trouble with sound using multiple accounts

    Bonjours:

    I've switched off the borg at home 100% (yippee). Wife and kids are now logging on, firing up 2-3 apps (usually FF, songbird and nautilus) and then switching users to allow the other on. This has the unexpected side effect of locking the audio device so the other user cannot use it until they shutdown those apps that have /dev/dsp open in a locked fashion.

    Is this "normal" behaviour? or is there something I'm missing in the setup?

    thx.
    Wendell

  2. #2
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,564
    Blog Entries
    38

    Default Re: Trouble with sound using multiple accounts

    Quote Originally Posted by mackendw View Post
    Is this "normal" behaviour? or is there something I'm missing in the setup?
    Unfortunately this is typical Linux behaviour.

    Dependant on your hardware, you may be able to work around this by selecting use of the ALSA API (where alsa provides both an audio driver and also an API) in the preferences of your various multimedia applications. That way (when using the alsa API) multiple applications may be able to share the same audio device. Unfortunately that does not work for all hardware.

    Pulse audio was supposed to help solve this, but pulse audio is buggy and hence not many guides have been written around this.

    You best bet may be to train/encourage users to shut down the audio applications that are using the audio device properly prior to logging out.

  3. #3
    Join Date
    Dec 2008
    Location
    Cornwall, PEI Canada
    Posts
    30

    Default Re: Trouble with sound using multiple accounts

    hum....it would appear that this is what I'm looking for:

    SystemWideInstance – PulseAudio

    anyone out there tried this successfully with opensuse 11.2??

    hints/suggestions are welcome before I hose my system

    thx

  4. #4
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,743

    Default Re: Trouble with sound using multiple accounts

    Pulse still does not work well. Alsa should work. The problem is that some apps use the dsp directly or very old methods and thus lock the device.

    Rather then switching environments log out this will free up any locks.

  5. #5
    Join Date
    Dec 2008
    Location
    Cornwall, PEI Canada
    Posts
    30

    Default Re: Trouble with sound using multiple accounts

    OK, just tested it and yep...it dood what I'm after.


    Cool....

  6. #6
    Join Date
    Dec 2008
    Location
    Cornwall, PEI Canada
    Posts
    30

    Default Re: Trouble with sound using multiple accounts

    Here is the recipe to make this work:

    - follow the instructions @:

    pulseaudio.org/wiki/SystemWideInstance

    NOTE: opensuse 11.2 has most of this setup already. I used the
    /var/run/pulse as per the above wiki recommendation to
    avoid the start warning.

    - disable the start for each user gnome-session-properties of the
    2 occurrences where it starts up the pulseaudio daemon for gnome
    or kde.

    - run gnome-save-session

    - as root, create a script in /etc/init.d named pulseaudio
    containing the following:

    #!/bin/sh
    #
    # pulseaudio This shell script takes care of starting and stopping
    # the pulseaudio sound driver.
    #
    #
    ### BEGIN INIT INFO
    # Provides: pulseaudio
    # Required-Start:
    # Should-Start: $remote_fs resmgr
    # Required-Stop:
    # Should-Stop: $remote_fs resmgr
    # Default-Start: 2 3 5
    # Default-Stop:
    # Short-Description: Set up pulseaudio sound system
    # Description: Loading pulseaudio
    ### END INIT INFO

    set -e

    . /etc/sysconfig/sound

    if [ x"$PULSEAUDIO_ENABLE" = x"no" ] ; then
    exit 1
    fi

    [ -z "$PULSE_SERVER" ]

    /usr/bin/pulseaudio --system=yes --disallow-exit --disallow-module-loading &

    - create a symlink as follows:

    # ln -s /etc/init.d/rc5.d/S12pulseaudio ../pulseaudio

    - as root, run Yast -> System -> RunLevel editor

    specify that pulseaudio above is to run in runlevels:
    2, 3 and 5

    - reboot.


    one caveat, when using firefox with flash that uses sound, even when stopped if the window/tab is still open and paused, it will continue to hold the audio device. Closing it will give other users access to it.

    Hope that helps.
    Wendell

  7. #7
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,845
    Blog Entries
    14

    Default Re: Trouble with sound using multiple accounts

    I have everything using ALSA, and have exactly what you want: user1's system noises sound through user2's music, sounding through user3's TV sound. Don't know how you did it to get to your situation.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  8. #8
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,564
    Blog Entries
    38

    Default Re: Trouble with sound using multiple accounts

    Quote Originally Posted by mackendw View Post
    Here is the recipe to make this work:
    Thanks for sharing your experience. I'm hoping there will come a day when pulse audio is more or less bug free and hence the experience/guides of users such as yourself will be come more and more valueable.

    Thankyou for your contribution.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •