[pulseaudio-discuss] PA 10 : paplay can't connect !
sean darcy
seandarcy2 at gmail.com
Wed Feb 1 21:39:12 UTC 2017
On 01/28/2017 07:22 AM, Tanu Kaskinen wrote:
> On Thu, 2017-01-26 at 15:42 -0500, sean darcy wrote:
>> On 01/26/2017 12:39 AM, Tanu Kaskinen wrote:
>>> On Sat, 2017-01-21 at 16:18 -0500, sean darcy wrote:
>>>> On Fedora 25, running PA 10.0.
>>>>
>>>> [video at sixcore ~]$ ps aux | grep pulse
>>>> video 2319 0.0 0.0 433508 12212 ? Ssl 15:51 0:00
>>>> /usr/bin/pulseaudio --daemonize=no
>>>> video 2358 0.0 0.0 130028 4892 ? S 15:51 0:00
>>>> /usr/libexec/pulse/gconf-helper
>>>>
>>>> [video at sixcore ~]$ pacmd stat
>>>> Memory blocks currently allocated: 1, size: 63.9 KiB.
>>>> Memory blocks allocated during the whole lifetime: 35, size: 1.9 MiB.
>>>> Memory blocks imported from other processes: 0, size: 0 B.
>>>> Memory blocks exported to other processes: 0, size: 0 B.
>>>> Total sample cache size: 0 B.
>>>> Default sample spec: s16le 2ch 44100Hz
>>>> Default channel map: front-left,front-right
>>>> Default sink name:
>>>> alsa_output.usb-AudioQuest_inc._AudioQuest_DragonFly-00.analog-stereo
>>>> .....................
>>>>
>>>> but
>>>>
>>>> [video at sixcore ~]$ paplay /home/video/Music/Route_66.wav
>>>> Connection failure: Connection refused
>>>> pa_context_connect() failed: Connection refused
>>>
>>> The paplay error looks like pulseaudio isn't running, but obviously it
>>> is. So the problem appears to be that pulseaudio and paplay just don't
>>> find each other, and that's probably because they disagree where the
>>> communication socket should be.
>>>
>>> What does "netstat -l -x -p | grep pulse" print? What does
>>> "PULSE_LOG=99 pactl info" print? What does "echo $XDG_RUNTIME_DIR"
>>> print?
>>>
>>
>> Thanks for the response.
>>
>> [video at sixcore ~]$ netstat -l -x -p | grep pulse
>> (Not all processes could be identified, non-owned process info
>> will not be shown, you would have to be root to see it all.)
>> unix 2 [ ACC ] STREAM LISTENING 51237
>> 7388/pulseaudio /tmp/.esd-501/socket
>> unix 2 [ ACC ] STREAM LISTENING 26773 -
>> /run/user/0/pulse/native
>> unix 2 [ ACC ] STREAM LISTENING 40938 7362/systemd
>> /run/user/501/pulse/native
>>
>> [video at sixcore ~]$ PULSE_LOG=99 pactl info
>> Parsing configuration file '/home/video/.config/pulse/client.conf'
>> /home/video/.config/pulse/client.conf.d does not exist, ignoring.
>> Using shared memfd memory pool with 1024 slots of size 64.0 KiB each,
>> total size is 64.0 MiB, maximum usable slot size is 65472
>> Trying to connect to
>> {fd19a5b3f9ab48aeae18d687a1e5c0cc}unix:/run/user/1001/pulse/native...
>> Connection failure: Connection refused
>> pa_context_connect() failed: Connection refused
>>
>>
>> [video at sixcore ~]$ echo $XDG_RUNTIME_DIR
>> /run/user/501
>>
>> But it gets weirder.
>>
>> This is from an ssh session from a fedora laptop client. The server is
>> headless (running Fedora 25). If I ssh into the server from chromebook
>> OR my android phone - paplay works !! In all cases I'm logging directly
>> into the user "video" at sixcore.
>>
>> pactl from the android phone ssh session:
>>
>> Parsing configuration file '/home/video/.config/pulse/client.conf'
>> /home/video/.config/pulse/client.conf.d does not exist, ignoring.
>> Using shared memfd memory pool with 1024 slots of size 64.0 KiB each,
>> total size is 64.0 MiB, maximum usable slot size is 65472
>> Trying to connect to /run/user/501/pulse/native...
>> ...........
>>
>> Not at all like the odd connect I get when I ssh from the fedora laptop.
>>
>> From the fedora laptop ssh session:
>> [video at sixcore ~]$ id video
>> uid=501(video) gid=39(video) groups=39(video),10(wheel),63(audio)
>>
>> There is no user 1001. At least not in /etc/passwd.
>>
>> Very puzzled.
>
> I suspect
> {fd19a5b3f9ab48aeae18d687a1e5c0cc}unix:/run/user/1001/pulse/native
> comes from the X server. On your Fedora laptop, module-x11-publish puts
> the local pulseaudio socket addresses to X properties, and when you use
> ssh with X forwarding, paplay takes the socket address from the X
> server running on your laptop.
>
> The intended purpose of this is that if you load module-native-
> protocol-tcp (notice the -tcp suffix) on the laptop, applications that
> you use on the remote machine over ssh automagically connect to the
> local pulseaudio server on your laptop. In this case, however, if my
> guess is correct, paplay picks up a unix socket address from X, which
> is not useful at all.
>
> The {fd19a5b3f9ab48aeae18d687a1e5c0cc} part is supposed to be a filter
> that tells paplay to use the address only if the machine that paplay
> runs on has machine-id fd19a5b3f9ab48aeae18d687a1e5c0cc. What's the
> machine-id of the Fedora laptop, and what's the machine-id of the
> headless server? The machine-id is stored in /etc/machine-id. If
> they're the same on the two machines for some reason, then that's the
> problem.
>
> "xprop -root | grep ^PULSE_" will show the stuff that pulseaudio has
> stored in the X server.
>
From the headless server:
[video at sixcore ~]$ cat /etc/machine-id
ef65454e1a334e1e93f8ff6b0000000f
[video at sixcore ~]$ xprop -root | grep ^PULSE_
PULSE_COOKIE(STRING) =
"8c9ea5d609d838341a2b6335601ae5e8c107dae72a15421f0e9074893277fb7c2d311a68a7f5f61dfa532885bdeb0b14d7ce00a331a107fe88cebfc47bb7ead716b4fea6c5a6aa95303f6adf20827db2b56e2deb895e3152c198afadfa19c3bc514a0ca9ff4776f34fca4f9a67dc0f24a591606faadf66b90b92e832ed05b51a79095b8ee2129a7de14af953ac118733ce094234dc7df23d850672c4e5af5ebfc541089cc1f0a05754b9b77d1bee0325845688b3fd4e75d8aaadddfb10319f2156c14dbfd7ea62222ee9b73d2cccb42b71968236744caf5c09a04b4a501c6c4cf28190a115ed3b1fb90b3ef9b51d461a09c5c011350987dc00a021c16708b638"
PULSE_SERVER(STRING) =
"{fd19a5b3f9ab48aeae18d687a1e5c0cc}unix:/run/user/1001/pulse/native"
PULSE_SESSION_ID(STRING) = "1"
PULSE_ID(STRING) = "1001 at fd19a5b3f9ab48aeae18d687a1e5c0cc/1718"
The machine-id of the fedora laptop is fd19a5b3f9ab48aeae18d687a1e5c0cc
and I'm user 1001 on that machine.
If I switch to a console on the Fedora laptop ( CTL-ALT-F4) , and ssh
into the server, everything works. The music plays on the server.
So if X were running on the headless server, the music would play from
my laptop ?
Now that I know I can use the console, that's a decent workaround. Also
when I remove module-native-protocol-tcp.so, that also works. Does that
module have any function other than remote playback ?
But is there a switch where you can set playback to local or remote ?
Thanks for all your help. I appreciate it.
sean
More information about the pulseaudio-discuss
mailing list