Debian Codegraph @

doc/pipewire-appname.html

raw
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head><meta name="robots" content="noindex,nofollow">
5 <meta http-equiv="content-type" content="text/html;charset=utf-8" />
6 <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
7 <meta name="description" content="Internet DJ Console (IDJC) is a Shoutcast/Icecast internet radio client incorporating features for live radio show production." />
8 <meta name="keywords" xml:lang="en" content="idjc dj shoutcast icecast radio linux gtk live recorded voip irc" />
9 <link rel="shortcut icon" href="favicon.png" type="application/png" />
10 <link rel="stylesheet" href="style-code.css" type="text/css" />
11 <link rel="stylesheet" href="pygments.css" type="text/css" />
12 <title>Internet DJ Console Homepage</title>
13 </head><body><h1 class="unshown">Internet DJ Console Homepage IDJC</h1>
14 <div class="highlight"><pre><span></span>pipewire-appname.patch
15 Writen by Stephen Fairchld ([email protected]) &lt;- ignored email.
16
17 There is a python module called setproctitle that works for some use cases but
18 not this one so here is a patch to fix an issue where some programs such as idjc
19 appear as python within pipewire and also not surprisingly, wireplumber.
20
21 The application name comes from the /proc/self/exe symbolic link and therefore
22 the modification of pipewire&#39;s source code appears to be the only recourse.
23
24 On the client side simply set the PIPEWIRE_APPLICATION_NAME_HINT environment
25 variable to what the application name ought to be or perhaps better still set
26 PIPEWIRE_USE_PR_GET_NAME_HINT and also set the process name using prctl.
27
28 Hints containing leading whitespace will be rejected.
29 <span class="gh">diff --git a/src/pipewire/pipewire.c b/src/pipewire/pipewire.c</span>
30 <span class="gh">index 4451fa525..1e7378d1a 100644</span>
31 <span class="gd">--- a/src/pipewire/pipewire.c</span>
32 <span class="gi">+++ b/src/pipewire/pipewire.c</span>
33 <span class="gu">@@ -654,6 +654,24 @@ static void init_prgname(void)</span>
34 <span class="w"> </span> static char name[PATH_MAX];
35 <span class="w"> </span>
36 <span class="w"> </span> spa_memzero(name, sizeof(name));
37 <span class="gi">+ {</span>
38 <span class="gi">+ char *ev;</span>
39 <span class="gi">+</span>
40 <span class="gi">+ if ((ev = getenv(&quot;PIPEWIRE_USE_PR_GET_NAME_HINT&quot;)) &amp;&amp; ev[0] &gt; &#39; &#39; &amp;&amp;</span>
41 <span class="gi">+ prctl(PR_GET_NAME, (unsigned long) name, 0, 0, 0) == 0) {</span>
42 <span class="gi">+ if (name[0] &gt; &#39; &#39;) {</span>
43 <span class="gi">+ prgname = name;</span>
44 <span class="gi">+ return;</span>
45 <span class="gi">+ } else {</span>
46 <span class="gi">+ memset(name, &#39;\0&#39;, sizeof(name));</span>
47 <span class="gi">+ }</span>
48 <span class="gi">+ }</span>
49 <span class="gi">+ if ((ev = getenv(&quot;PIPEWIRE_APPLICATION_NAME_HINT&quot;)) &amp;&amp; ev[0] &gt; &#39; &#39;) {</span>
50 <span class="gi">+ strncpy(name, ev, sizeof(name)-1);</span>
51 <span class="gi">+ prgname = name;</span>
52 <span class="gi">+ return;</span>
53 <span class="gi">+ }</span>
54 <span class="gi">+ }</span>
55 <span class="w"> </span>#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__MidnightBSD_kernel__) || defined(__GNU__)
56 <span class="w"> </span> {
57 <span class="w"> </span> if (readlink(&quot;/proc/self/exe&quot;, name, sizeof(name)-1) &gt; 0) {
58 </pre></div>
59 </body>