Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
alsa+pulseaudio no sound out in root user
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
jiaxi
n00b
n00b


Joined: 25 Sep 2012
Posts: 30

PostPosted: Tue Nov 13, 2012 11:19 am    Post subject: alsa+pulseaudio no sound out in root user Reply with quote

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
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Tue Nov 13, 2012 3:48 pm    Post subject: Reply with quote

Whoa... why do you want sound as root? You shouldn't even care about that. 8O
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Nov 13, 2012 6:17 pm    Post subject: Reply with quote

You should probably pay attention to all those helpful fatal warnings it's giving you.
Back to top
View user's profile Send private message
jiaxi
n00b
n00b


Joined: 25 Sep 2012
Posts: 30

PostPosted: Wed Nov 14, 2012 1:26 am    Post subject: Reply with quote

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
View user's profile Send private message
jiaxi
n00b
n00b


Joined: 25 Sep 2012
Posts: 30

PostPosted: Thu Nov 22, 2012 8:29 am    Post subject: Reply with quote

It can output sound when set sink
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum