[Freeswitch-dev] Strange mod_portaudio permissions issue

Podrigal, Aron aronp at guaranteedplus.com
Tue Oct 13 08:00:15 MSD 2015


Hey Mark.

mod_portaudio is based on portaudio <http://portaudio.com> 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.

I attached a small program, give it a shot.

Install libs
sudo apt-get install portaudio19-dev

gcc devices.c -o devices -lportaudio


Regards

On Thu, Aug 27, 2015 at 6:30 PM, Mark Haun <haunma at keteu.org> wrote:

> Hi,
>
> I posted this to freeswitch-users but did not receive any replies.
> Probably
> no one but the developers have a chance to know what is happening, so I'm
> posting it here in the hope that it jogs someone's memory.  It would be
> nice
> to understand it properly.
>
> ---
>
> I built freeswitch version 1.7.0+git~20150730T192909Z~ab7f83c654~32bit for
> my ARM-based home server (an NVIDIA Jetson board), with the intention of
> using mod_portaudio with a wireless USB headset for my main home phone.  It
> works well when running freeswitch directly as root, but when I configured
> freeswitch to run at system startup, mod_portaudio could no longer find any
> audio devices.
>
> No problem, I thought, it's a simple permissions issue.  I am using the
> example debian init script from the wiki (this is a Jessie install with
> SysV
> init rather than systemd).  It runs freeswitch as user freeswitch, group
> daemon using the -u and -g command-line options.  So I added "freeswitch"
> to
> the audio group, then used sudo to verify that I could play sound files
> with
> "aplay" as the freeswitch user.  That worked, but it did not solve the
> mod_portaudio failure.
>
> Thinking there must be an issue with portaudio separate from ALSA, I
> fetched
> and built the "pa_devs" utility which enumerates and prints the available
> audio devices.  (This is basically what mod_portaudio is doing on startup.)
> Running as the freeswitch user, that worked too.  Hmmmm.
>
> I tried running freeswitch from the command line using sudo rather than the
> -u and -g options, i.e.
>
> $ sudo -u freeswitch /usr/local/freeswitch/bin/freeswitch -nc
>
> and that worked as well!  Then I started experimenting with -u and -g and
> discovered that
>
> $ /usr/local/freeswitch/bin/freeswitch -nc -u freeswitch
>
> allows mod_portaudio to load correctly, whereas
>
> $ /usr/local/freeswitch/bin/freeswitch -nc -u freeswitch -g daemon
>
> causes mod_portaudio to fail.
>
> Can anyone explain what's happening here?  In both cases the process UID,
> GID, EUID, EGID, FUID, and FGID are the same (freeswitch:daemon) as
> displayed with "ps xao pid,uid,gid,euid,egid,fuid,fgid".  Could this be a
> bug in freeswitch?  There are a couple of threads from 2-3 years ago in the
> archives, where mod_portaudio permissions issues were never resolved and
> the
> solution remained a mystery.
>
> For the time being I guess this (not using -g) is a workaround, but I'd
> sure
> like to understand what is going on.
>
> Mark
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>



-- 
Aron Podrigal
-
'1000001', '1110010', '1101111', '1101110'   '1010000', '1101111',
'1100100', '1110010', '1101001', '1100111', '1100001', '1101100'

P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20151013/c3da3057/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: devices.c
Type: text/x-csrc
Size: 650 bytes
Desc: not available
Url : http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20151013/c3da3057/attachment.bin 


Join us at ClueCon 2014 Aug 4-7, 2014
More information about the FreeSWITCH-dev mailing list