Gentoo Archives: gentoo-user

From: Kevin Thompson <phlux@×××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] problem trying to play sound when pulse audio is enabled
Date: Mon, 29 Apr 2013 09:21:28
Message-Id: 20130429092054.GB23603@localhost.gateway.2wire.net
In Reply to: Re: [gentoo-user] problem trying to play sound when pulse audio is enabled by covici@ccs.covici.com
1 On Mon, Apr 29, 2013 at 04:43:46AM -0400, covici@××××××××××.com wrote:
2 > Canek Peláez Valdés <caneko@×××××.com> wrote:
3 >
4 > > On Mon, Apr 29, 2013 at 12:35 AM, <covici@××××××××××.com> wrote:
5 > > > Canek Peláez Valdés <caneko@×××××.com> wrote:
6 > > >
7 > > >> On Sun, Apr 28, 2013 at 11:57 PM, <covici@××××××××××.com> wrote:
8 > > >> > Canek Peláez Valdés <caneko@×××××.com> wrote:
9 > > >> >
10 > > >> >> On Sun, Apr 28, 2013 at 11:08 PM, <covici@××××××××××.com> wrote:
11 > > >> >> > Canek Peláez Valdés <caneko@×××××.com> wrote:
12 > > >> >> >
13 > > >> >> >> On Sun, Apr 28, 2013 at 10:07 PM, <covici@××××××××××.com> wrote:
14 > > >> >> >> > Canek Peláez Valdés <caneko@×××××.com> wrote:
15 > > >> >> >> >
16 > > >> >> >> >> On Sun, Apr 28, 2013 at 7:56 PM, <covici@××××××××××.com> wrote:
17 > > >> >> >> >> > Hi. I have not used pulseaudio at all, but with gnome 3.8 I guess it
18 > > >> >> >> >> > must be there, but when I try to play a sound using either mplayer from
19 > > >> >> >> >> > the console which works fine withalsa, or even aplay, I get no sound
20 > > >> >> >> >> > unless I change the /etc/pulse/client.conf to spawn=no .
21 > > >> >> >> >>
22 > > >> >> >> >> Unless you have a very specific setup, you should not need to touch
23 > > >> >> >> >> the files under /etc/pulse. Also, are you trying to run the
24 > > >> >> >> >> system-wide PulseAudio service? Because that's basically wrong:
25 > > >> >> >> >>
26 > > >> >> >> >> http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide
27 > > >> >> >> >>
28 > > >> >> >> >> > Anyway to fix this?
29 > > >> >> >> >>
30 > > >> >> >> >> If you are running PA as a normal user (as you should), then perhaps
31 > > >> >> >> >> the per-application volume for MPlayer is muted. While playing
32 > > >> >> >> >> something with MPlayer, go to Settings -> Sound, then select the
33 > > >> >> >> >> Applications tab, and there should be a volume slider for all the
34 > > >> >> >> >> applications using audio. Just adjust as necessary.
35 > > >> >> >> >
36 > > >> >> >> > I got no sound when pa was run as a user. I am running these apps from
37 > > >> >> >> > the console -- apps such as aplay or anything which uses alsa. So I
38 > > >> >> >> > can't adjust any volumes under gnome, etc.
39 > > >> >> >>
40 > > >> >> >> Also, from the console you can use pactl. To play a sample sound there, do:
41 > > >> >> >>
42 > > >> >> >> pactl play-sample 0
43 > > >> >> >> pactl play-sample 1
44 > > >> >> >>
45 > > >> >> >> It should work. You can also set the volume from here:
46 > > >> >> >>
47 > > >> >> >> pactl set-sink-volume 0 "100%"
48 > > >> >> >>
49 > > >> >> >> 0 is usually the "master" volume.
50 > > >> >> >>
51 > > >> >> >> Check out man pactl.
52 > > >> >> >
53 > > >> >> > Well, in either system or user mode, root can play sound whereas a
54 > > >> >> > regular user gets silent, but without pulseaudio -- spawn=no, then a
55 > > >> >> > regular user can play sound. Does this give a clue?
56 > > >> >>
57 > > >> >> Not really; as I said, the PA documentation clearly says that if you
58 > > >> >> use system mode "You are on your own. You need to know you way around,
59 > > >> >> be able to write init scripts, dbus policies, to fix up device
60 > > >> >> permissions, and unix users, you need to pass around security cookies
61 > > >> >> and more."
62 > > >> >>
63 > > >> >> I haven't ever used system-wide PA.
64 > > >> >>
65 > > >> >> I think of the following; try to delete both /root/.pulse and
66 > > >> >> $HOME/.pulse, and rebooting (probably a logout/login should suffice,
67 > > >> >> but you never know).
68 > > >> >>
69 > > >> >> Another thing: if you installed PA since GNOME 3.8 needs it, why are
70 > > >> >> you using it without GNOME? If you use GNOME, the session manager will
71 > > >> >> automatically start PA as a user for you, and everything should work.
72 > > >> >> If you are not running GNOME, why do you run PA? If you are at the
73 > > >> >> console without X running, just don't use PA. Use mplayer -ao alsa or
74 > > >> >> whatever.
75 > > >> >>
76 > > >> >> Or do you want to run several audio apps in the console?
77 > > >> >
78 > > >> > I want to run apps from the console, but to start gnome when I need it.
79 > > >>
80 > > >> Then do that. When you start GNOME, it will start PA automatically:
81 > > >> you don't need to do anything. Don't try to start PA yourself; it's
82 > > >> DBus activated.
83 > > >>
84 > > >>
85 > > >> > I am running pa as a user and things are still not working, except for
86 > > >> > the root user who can play sounds.
87 > > >>
88 > > >> I repeat: you don't need to run PA. GNOME will start it for you.
89 > > >
90 > > > But will that workif I have spawn=no in my /etc/pulse/client.conf which
91 > > > I have to have for regular apps to work from theconsole? Or is there
92 > > > some other way to make this happen?
93 > >
94 > > I don't understand the question. If you don't run PA by yourself, then
95 > > it will be started only when using GNOME. And if you are using GNOME,
96 > > you can use the nice sound settings dialog to get your sound.
97 > >
98 > > If you don't start GNOME, then PA will not be started. If you don't
99 > > have sound in your console even without PA running, then is for some
100 > > issue completely unrelated to PA.
101 > >
102 > > PA should not be started if you only log in through the console.
103 > > Unless you are still running it system-wide, which is basically
104 > > unsupported.
105 >
106 > OK, we will see what happens, so I have set spawn=no which should work
107 > to prevent pa except in gnome, so hopefully that should work.
108 >
109 > Thanks for clarifying this for me.
110 >
111 >
112 > --
113 > Your life is like a penny. You're going to lose it. The question is:
114 > How do
115 > you spend it?
116 >
117 > John Covici
118 > covici@××××××××××.com
119 >
120
121 I had the same issue here when installing pulseaudio. I don't use GNOME,
122 so that does take part of the equation away. The problem was solved by
123 changing permissions to /dev/snd and it's containing files. After
124 chmodding /dev/snd/* to 666, I was able to play sounds as a normal user.
125 In the Gentoo guide, it mentions this, and it also mentions taking your
126 user out of the audio group if you're currently in it. Please see
127 http://wiki.gentoo.org/wiki/PulseAudio#Root_can_play_sound.2C_other_users_cannot
128 for more detailed information.
129
130 Very Respectfully,
131
132 Kevin Thompson

Replies