View previous topic :: View next topic |
Author |
Message |
jiaxi n00b
Joined: 25 Sep 2012 Posts: 30
|
Posted: Tue Nov 13, 2012 11:19 am Post subject: alsa+pulseaudio no sound out in root user |
|
|
Use alsa+pulseaudio,It is ok when use normal user login,But when switch to root user,it is no sound out.
1 modify /etc/pulse/system.pa
load-module module-native-protocol-unix auth-anonymous=1
2 add pulse user and group
3 etc/asound.conf
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}
4 start pulseaudio
# pulseaudio --system&
# W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set!
W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set!
N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode!
N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time!
W: [pulseaudio] main.c: OK, so you are running PA in system mode. Please note that you most likely shouldn't be doing that.
W: [pulseaudio] main.c: If you do it nonetheless then it's your own fault if things don't work as expected.
W: [pulseaudio] main.c: Please read http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode for an explanation why system mode is usually a bad idea.
W: [pulseaudio] shm.c: Failed to read /dev/shm/: No such file or directory
W: [pulseaudio] random.c: Failed to get proper entropy. Falling back to unsecure pseudo RNG.
5 play music.
# aplay -v 48.wav &
# Home directory /root not ours.
Playing WAVE '48.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
ALSA <-> PulseAudio PCM I/O Plugin
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 24000
period_size : 6000
period_time : 125000
tstamp_mode : NONE
period_step : 1
avail_min : 6000
period_event : 0
start_threshold : 24000
stop_threshold : 24000
silence_threshold: 0
silence_size : 0
boundary : 1572864000
6 cat card status
# cat /proc/asound/cards
0 tlv320aic3x - HSI_SIO
HSI_SO (tlv320aic3x)
# cat /proc/asound/card0/pcm0p/sub0/hw_params
closed
7 ps
352 pulse 79364 S < pulseaudio --system
356 root 78452 S aplay 48.wav
359 root 3000 R ps
why card0 closed? |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6639 Location: The soundosphere
|
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Tue Nov 13, 2012 6:17 pm Post subject: |
|
|
You should probably pay attention to all those helpful fatal warnings it's giving you. |
|
Back to top |
|
|
jiaxi n00b
Joined: 25 Sep 2012 Posts: 30
|
Posted: Wed Nov 14, 2012 1:26 am Post subject: |
|
|
Ant P. wrote: | You should probably pay attention to all those helpful fatal warnings it's giving you. |
Though there are some warnings,pulseaudio can start in system mode.
why is the user is pulse when pulseaudio in system mode,But the aplay's user is root.I donot know if is it right? |
|
Back to top |
|
|
jiaxi n00b
Joined: 25 Sep 2012 Posts: 30
|
Posted: Thu Nov 22, 2012 8:29 am Post subject: |
|
|
It can output sound when set sink |
|
Back to top |
|
|
|