Re: How to configure ALSA (No PulseAudio) with software mixing and multiple users?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Figured it out. I had to add each user to the audio group and put the configs in ~/.asoundrc rather than just /etc/asound.conf. Not sure why it's not needed to add to the audio group when it's just one user.




On Thu, Feb 13, 2014 at 9:59 AM, John Doh <shillshocked@xxxxxxxxx> wrote:
I have been able to get multiseat working with ALSA only including software mixing and an equalizer. But it only works if both seats are logged in as the same user. I would like to share the audio among different users.

Here is my working config for ALSA that allows multi-seat single user (a double login) using Arch Linux:

defaults.pcm.rate_converter "samplerate_best"

ctl.equal {
 type equal;
}

pcm.plugequal {
  type equal;
  # Modify the line below if you do not
  # want to use sound card 0.
  #slave.pcm "plughw:0,0";
  #by default we want to play from more sources at time:
  slave.pcm "plug:dmix";
}
#pcm.equal {
  # If you do not want the equalizer to be your
  # default soundcard comment the following
  # line and uncomment the above line. (You can
  # choose it as the output device by addressing
  # it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)
pcm.!default {
  type plug;
  slave.pcm plugequal;
}

I read over various wikis, forum posts and faqs on how to configure ALSA. This was what I came up with, and it is currently not working:

defaults.pcm.rate_converter "samplerate_best"

pcm.ossmix {
    type dmix
    ipc_key 1024 # must be unique!
    ipc_key_add_uid false   # let multiple users share
    ipc_perm 0666           # IPC permissions for multi-user sharing (octal, default 0600)
    slave {
        pcm "hw:0,0"      # you cannot use a "plug" device here, darn.
        period_time 0
        period_size 1024 # must be power of 2
        buffer_size 8192  # dito. It
       #format "S32_LE"
       #periods 128 # dito.
       #rate 8000 # with rate 8000 you *will* hear,
       # if ossmix is used :)
    }
    # bindings are cool. This says, that only the first
    # two channels are to be used by dmix, which is
    # enough for (most) oss apps and also lets
    # multichannel chips work much faster:
    bindings {
        0 0 # from 0 => to 0
        1 1 # from 1 => to 1
    }
}
pcm.dsp0 {
    type plug
    slave.pcm "ossmix" # use our new PCM here
}
# mixer0 like above
ctl.mixer0 {
    type hw
    card 0
}

# You may want to make your new ossmix the default for alsa.
# If your alsa programs are complaining that they can't open
# your sound devices, try uncommenting this next line
#pcm.default pcm.dsp0

What am I missing here?

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user


#
# General configuration
#
# start-default-seat = True to always start one seat if none are defined in the configuration
# greeter-user = User to run greeter as
# minimum-display-number = Minimum display number to use for X servers
# minimum-vt = First VT to run displays on
# lock-memory = True to prevent memory from being paged to disk
# user-authority-in-system-dir = True if session authority should be in the system location
# guest-account-script = Script to be run to setup guest account
# log-directory = Directory to log information to
# run-directory = Directory to put running state in
# cache-directory = Directory to cache to
# sessions-directory = Directory to find sessions
# remote-sessions-directory = Directory to find remote sessions
# greeters-directory = Directory to find greeters
#
[LightDM]
#start-default-seat=true
greeter-user=lightdm
#minimum-display-number=0
#minimum-vt=1
#lock-memory=true
#user-authority-in-system-dir=false
#guest-account-script=guest-account
log-directory=/var/log/lightdm
run-directory=/run/lightdm
#cache-directory=/var/cache/lightdm
#sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions
#remote-sessions-directory=/usr/share/lightdm/remote-sessions
#greeters-directory=/usr/share/lightdm/greeters:/usr/share/xgreeters

#
# Seat defaults
#
# type = Seat type (xlocal, xremote)
# xdg-seat = Seat name to set pam_systemd XDG_SEAT variable and name to pass to X server
# xserver-command = X server command to run (can also contain arguments e.g. X -special-option)
# xserver-layout = Layout to pass to X server
# xserver-config = Config file to pass to X server
# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server
# xserver-share = True if the X server is shared for both greeter and session
# xserver-hostname = Hostname of X server (only for type=xremote)
# xserver-display-number = Display number of X server (only for type=xremote)
# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true)
# xdmcp-port = XDMCP UDP/IP port to communicate on
# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf)
# unity-compositor-command = Unity compositor command to run (can also contain arguments e.g. unity-system-compositor -special-option)
# unity-compositor-timeout = Number of seconds to wait for compositor to start
# greeter-session = Session to load for greeter
# greeter-hide-users = True to hide the user list
# greeter-allow-guest = True if the greeter should show a guest login option
# greeter-show-manual-login = True if the greeter should offer a manual login option
# greeter-show-remote-login = True if the greeter should offer a remote login option
# user-session = Session to load for users
# allow-guest = True if guest login is allowed
# guest-session = Session to load for guests (overrides user-session)
# session-wrapper = Wrapper script to run session with
# greeter-wrapper = Wrapper script to run greeter with
# guest-wrapper = Wrapper script to run guest sessions with
# display-setup-script = Script to run when starting a greeter session (runs as root)
# greeter-setup-script = Script to run when starting a greeter (runs as root)
# session-setup-script = Script to run when starting a user session (runs as root)
# session-cleanup-script = Script to run when quitting a user session (runs as root)
# autologin-guest = True to log in as guest by default
# autologin-user = User to log in with by default (overrides autologin-guest)
# autologin-user-timeout = Number of seconds to wait before loading default user
# autologin-session = Session to load for automatic login (overrides user-session)
# autologin-in-background = True if autologin session should not be immediately activated
# exit-on-failure = True if the daemon should exit if this seat fails
#
[SeatDefaults]
#type=xlocal
#xdg-seat=seat0
xserver-command=/usr/bin/X
#xserver-layout=
#xserver-config=
#xserver-allow-tcp=false
#xserver-share=true
#xserver-hostname=
#xserver-display-number=
#xdmcp-manager=
#xdmcp-port=177
#xdmcp-key=
#unity-compositor-command=unity-system-compositor
#unity-compositor-timeout=60
greeter-session=lightdm-gtk-greeter
#greeter-hide-users=false
#greeter-allow-guest=true
greeter-show-manual-login=true
#greeter-show-remote-login=true
user-session=mate
#allow-guest=true
#guest-session=UNIMPLEMENTED
session-wrapper=/etc/lightdm/Xsession
#greeter-wrapper=
#guest-wrapper=
#display-setup-script=
#greeter-setup-script=
#session-setup-script=
#session-cleanup-script=
#autologin-guest=false
#autologin-user=
#autologin-user-timeout=0
#autologin-in-background=false
#autologin-session=UNIMPLEMENTED
pam-service=lightdm-autologin
exit-on-failure=true

#
# Seat configuration
#
# Each seat must start with "Seat:".
# Uses settings from [SeatDefaults], any of these can be overriden by setting them in this section.
#

[Seat:0]
xserver-command=/usr/bin/X :0 -sharevts
xserver-layout=Layout0
#autologin-user=phoenix
#autologin-user-timeout=-1
#session-setup-script=/etc/lightdm/scripts/sound_start
#session-cleanup-script=/etc/lightdm/scripts/sound_stop
 
[Seat:1]
xserver-command=/usr/bin/X :1 -sharevts
xserver-layout=Layout1
#autologin-user=phoenix
#autologin-user-timeout=-1

#
# XDMCP Server configuration
#
# enabled = True if XDMCP connections should be allowed
# port = UDP/IP port to listen for connections on
# key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf)
#
# The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn.  Alternatively
# it can be a word and the first 7 characters are used as the key.
#
[XDMCPServer]
#enabled=false
#port=177
#key=

#
# VNC Server configuration
#
# enabled = True if VNC connections should be allowed
# command = Command to run Xvnc server with
# port = TCP/IP port to listen for connections on
# width = Width of display to use
# height = Height of display to use
# depth = Color depth of display to use
#
[VNCServer]
#enabled=false
#command=Xvnc
#port=5900
#width=1024
#height=768
#depth=8

Attachment: .asoundrc
Description: Binary data

Section "ServerFlags"
    Option         "DefaultServerLayout" "Layout1"
#    Option         "AllowMouseOpenFail"  "true"
    Option         "AutoAddDevices"      "false"
    Option         "AutoEnableDevices"   "false"
    Option         "DontZap"             "false"
    Option         "Xinerama" "0"
    Option         "AutoAddGPU" "FALSE"
EndSection

Section "ServerLayout"
    Identifier     "Layout0"
    Screen         0  "Screen0" 0 0
    InputDevice    "kbd_0" "CoreKeyboard"
    InputDevice    "mouse_0" "CorePointer"
    Option         "AllowEmptyInput"       "true"
    Option 	   "DontVTSwitch"          "true" 
EndSection

Section "ServerLayout"
    Identifier     "Layout1"
    Screen         0  "Screen1" 0 0
    InputDevice    "kbd_1" "CoreKeyboard"
    InputDevice    "mouse_1" "CorePointer"
    Option         "AllowEmptyInput"       "true"
    Option 	   "DontVTSwitch"          "true"
EndSection

Section "Module"
#    Load           "dbe"
#    Load           "extmod"
#    Load           "type1"
#    Load           "freetype"
#    Load           "glx"
#    Load 	   "dri2"
#    Load 	   "glamoregl"
EndSection

Section "InputDevice"
    Identifier     "kbd_0"
    Driver 	   "evdev"
    Option         "Device"        "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"
    Option         "GrabDevice"    "on"
    Option 	   "XkbRules" "xorg"
    Option 	   "XkbModel" "105"
    Option 	   "XkbLayout" "us"
    Option  	   "Protocol"      "Standard"
EndSection

Section "InputDevice"
    Identifier     "kbd_1"
    Driver         "evdev"
    Option         "Device"        "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"
    Option         "GrabDevice"    "on"
    Option 	   "XkbRules" "xorg"
    Option 	   "XkbModel" "105"
    Option 	   "XkbLayout" "us"
    Option  	   "Protocol"      "Standard"
EndSection

Section "InputDevice"
    Identifier     "mouse_0"
    Driver         "evdev"
    Option         "Device"        "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"
    Option         "GrabDevice"    "on"
EndSection

Section "InputDevice"
    Identifier     "mouse_1"
    Driver         "evdev"
    Option         "Device"        "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"
    Option         "GrabDevice"    "on"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    Option	   "VendorName" "Unknown"
    Option	   "ModelName" "Generic Autodetecting Monitor"
#    Option	   "DPMS" "true"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    Option	   "VendorName" "Unknown"
    Option	   "ModelName" "Generic Autodetecting Monitor"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "radeon"
#    Option 	   "AccelMethod" "glamor"
    Option 	   "AccelMethod" "EXA"
    VendorName     ""
    BoardName      ""
    BusID          "PCI:1:0:0"
    Screen          0
#    Option         "EXAVSync"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "intel"
    VendorName     ""
    BoardName      ""
    BusID          "PCI:0:2:0"
    Screen          0
#    Option         "AccelMethod" "UXA"
#    Option         "TearFree" "1"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device     "Device0"
    Monitor    "Monitor0"
    DefaultDepth     24
    SubSection "Display"
    	Depth     24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux