1

On my computer audio works sometimes and sometimes not. I want to troubleshoot this. First I verified I am using pulseaudio. I did this by strace'ing the pulseaudio process:

[pid  2289] send(28, "\0\0\0\24\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0L\0\0\0=L\377\377\377\377L\0"..., 40, MSG_NOSIGNAL) = 40

At the same time the application speaker-test receives data from process 2289, pulseaudio. Many lines like this:

[pid 29146] recvmsg(7, {msg_name(0)=NULL, msg_iov(1)=[{"\0\0\0\0\377\377\377\377\0\0\0\20\0\0\0\0@\0\0\0", 20}], msg_controllen=24, {cmsg_len=24, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=2289, uid=0, gid=0}}, msg_flags=0}, 0) = 20

Now I can see the sockets are neighbors:

# ll /proc/29146/fd/7
lrwx------ 1 root root 64 Apr  4 16:46 /proc/29146/fd/7 -> socket:[114414]
# ll /proc/2289/fd/28
lrwx------ 1 root root 64 Apr  4 15:13 /proc/2289/fd/28 -> socket:[114415]

Which leads me to two questions:

  • why is pulseaudio sending data and speaker-test is receiving data? I would expect it to be the other way round.
  • where can I find that socket 114414 and 114415 are connected? Can I sniff their traffic?

BTW I am blogging this adventure on http://www.linuxintro.org/wiki/Sound_troubleshooting#strace.27ing_sound_II

1 Answers1

0

I found the answer here: https://stackoverflow.com/questions/820782/how-do-i-find-out-what-programs-on-the-other-end-of-a-local-socket/4834881#4834881

The answer is

ss -p | grep <socket-number>