<div dir="ltr"><div>Hey Mark.</div><div><br></div>mod_portaudio is based on <a href="http://portaudio.com">portaudio</a> I would suggest you try a small program to get the device count using portaudio directly while running as user freeswitch:daemon and strace to get a better view where that fails.<div><br></div><div>I attached a small program, give it a shot.</div><div><br></div><div>Install libs</div><div>sudo apt-get install portaudio19-dev<br></div><div><br></div><div>gcc devices.c -o devices -lportaudio<br></div><div><br></div><div><br></div><div>Regards</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 27, 2015 at 6:30 PM, Mark Haun <span dir="ltr"><<a href="mailto:haunma@keteu.org" target="_blank">haunma@keteu.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I posted this to freeswitch-users but did not receive any replies. Probably<br>
no one but the developers have a chance to know what is happening, so I'm<br>
posting it here in the hope that it jogs someone's memory. It would be nice<br>
to understand it properly.<br>
<br>
---<br>
<br>
I built freeswitch version 1.7.0+git~20150730T192909Z~ab7f83c654~32bit for<br>
my ARM-based home server (an NVIDIA Jetson board), with the intention of<br>
using mod_portaudio with a wireless USB headset for my main home phone. It<br>
works well when running freeswitch directly as root, but when I configured<br>
freeswitch to run at system startup, mod_portaudio could no longer find any<br>
audio devices.<br>
<br>
No problem, I thought, it's a simple permissions issue. I am using the<br>
example debian init script from the wiki (this is a Jessie install with SysV<br>
init rather than systemd). It runs freeswitch as user freeswitch, group<br>
daemon using the -u and -g command-line options. So I added "freeswitch" to<br>
the audio group, then used sudo to verify that I could play sound files with<br>
"aplay" as the freeswitch user. That worked, but it did not solve the<br>
mod_portaudio failure.<br>
<br>
Thinking there must be an issue with portaudio separate from ALSA, I fetched<br>
and built the "pa_devs" utility which enumerates and prints the available<br>
audio devices. (This is basically what mod_portaudio is doing on startup.)<br>
Running as the freeswitch user, that worked too. Hmmmm.<br>
<br>
I tried running freeswitch from the command line using sudo rather than the<br>
-u and -g options, i.e.<br>
<br>
$ sudo -u freeswitch /usr/local/freeswitch/bin/freeswitch -nc<br>
<br>
and that worked as well! Then I started experimenting with -u and -g and<br>
discovered that<br>
<br>
$ /usr/local/freeswitch/bin/freeswitch -nc -u freeswitch<br>
<br>
allows mod_portaudio to load correctly, whereas<br>
<br>
$ /usr/local/freeswitch/bin/freeswitch -nc -u freeswitch -g daemon<br>
<br>
causes mod_portaudio to fail.<br>
<br>
Can anyone explain what's happening here? In both cases the process UID,<br>
GID, EUID, EGID, FUID, and FGID are the same (freeswitch:daemon) as<br>
displayed with "ps xao pid,uid,gid,euid,egid,fuid,fgid". Could this be a<br>
bug in freeswitch? There are a couple of threads from 2-3 years ago in the<br>
archives, where mod_portaudio permissions issues were never resolved and the<br>
solution remained a mystery.<br>
<br>
For the time being I guess this (not using -g) is a workaround, but I'd sure<br>
like to understand what is going on.<br>
<br>
Mark<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" rel="noreferrer" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Aron Podrigal<div>-</div><div>'1000001', '1110010', '1101111', '1101110' '1010000', '1101111', '1100100', '1110010', '1101001', '1100111', '1100001', '1101100'</div><div><br></div><div>P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'<br></div><div><br></div></div></div></div></div>
</div>