[Freeswitch-users] Stumped by mod_portaudio permissions issue

Tom Lynn tom at tomlynn.com
Sun Feb 16 05:58:31 UTC 2020


When I run your example unit file, I found that yes, the pa devlist command
works, but freeswitch isn't running as the user.  it is running as root,
which is what I'm forbidden from doing.

On Sun, Feb 2, 2020 at 9:46 PM Tom Lynn <tom at tomlynn.com> wrote:

> Thank you, Tamer!
>
> I'll try your unit file sometime this week.
>
> On Sun, Feb 2, 2020 at 7:58 PM Tamer Higazi via FreeSWITCH-users <
> freeswitch-users at lists.freeswitch.org> wrote:
>
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Tamer Higazi <th982a at googlemail.com>
>> To: freeswitch-users at lists.freeswitch.org
>> Cc:
>> Bcc:
>> Date: Mon, 3 Feb 2020 04:57:26 +0100
>> Subject: Re: [Freeswitch-users] Stumped by mod_portaudio permissions issue
>> Dear Tom,
>>
>> It doesn't matter. It works, it shows you all devices.
>>
>> If you can run as usual user "alsamixer" and be capable to list the
>> soundcard and you run freeswitch where all files are owned by this user,
>> and start freeswitch as well as this user then you can access your
>> soundcard with mod_portaudio without any problems.
>>
>> here is my unit file:
>>
>> [Unit]
>> Description=freeswitch
>> After=syslog.target network.target local-fs.target
>>
>> [Service]
>> User=tamer
>> Group=users
>> Type=forking
>> PIDFile=/opt/freeswitch/var/run/freeswitch/freeswitch.pid
>> PermissionsStartOnly=true
>> ExecStart=/opt/freeswitch/bin/freeswitch -nc
>> TimeoutSec=45s
>> Restart=on-failure
>> ; exec
>> WorkingDirectory=/opt/freeswitch/bin
>> LimitCORE=infinity
>> LimitNOFILE=100000
>> LimitNPROC=60000
>> ;LimitSTACK=240
>> LimitRTPRIO=infinity
>> LimitRTTIME=7000000
>> IOSchedulingClass=realtime
>> IOSchedulingPriority=2
>> CPUSchedulingPolicy=rr
>> CPUSchedulingPriority=89
>> UMask=0007
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>>
>> here:
>>
>> tamer at tux ~ $ fs_cli -r
>> freeswitch at tux> pa dev
>>
>> [             devlist]
>>
>>
>> freeswitch at tux> pa devlist
>> 0;HDA NVidia: HDMI 0 (hw:0,3)(ALSA);0;8;
>> 1;HDA NVidia: HDMI 1 (hw:0,7)(ALSA);0;8;
>> 2;HDA NVidia: HDMI 2 (hw:0,8)(ALSA);0;2;
>> 3;HDA NVidia: HDMI 3 (hw:0,9)(ALSA);0;8;
>> 4;HD-Audio Generic: ALC892 Analog (hw:1,0)(ALSA);2;2;
>> 5;Logitech Webcam C925e: USB Audio (hw:2,0)(ALSA);2;0;
>> 6;Sound Blaster E5: USB Audio (hw:3,0)(ALSA);2;2;
>> 7;sysdefault(ALSA);128;128;
>> 8;front(ALSA);0;2;
>> 9;surround40(ALSA);0;2;
>> 10;iec958(ALSA);0;2;
>> 11;spdif(ALSA);2;2;
>> 12;pulse(ALSA);32;32;r,i,o
>> 13;upmix(ALSA);8;8;
>> 14;vdownmix(ALSA);6;6;
>> 15;dmix(ALSA);0;2;
>> 16;default(ALSA);32;32;
>>
>> freeswitch at tux>
>>
>> best, Tamer
>>
>> On 2020-02-03 01:43, Tom Lynn wrote:
>> > One more item, I still don't have pulseaudio installed and the pa
>> > commands work, so pulseaudio is not strictly necessary.
>> >
>> > On Sun, Feb 2, 2020 at 4:33 PM Tom Lynn <tom at tomlynn.com
>> > <mailto:tom at tomlynn.com>> wrote:
>> >
>> >     I followed your steps, and yes, pa commands function when
>> >     freeswitch is run from the command line.  Nice!
>> >
>> >     I tried running it as both root and as user tom.  Both times I was
>> >     able to use the pa commands with success.  I tried running user
>> >     tom group user from the systemd startup and was not successful
>> >     using pa commands.
>> >
>> >     The question becomes, why does this not work using the
>> >     freeswitch.service configuration file supplied with the packaged
>> >     freeswitch?  I installed freeswitch-meta-all.
>> >
>> >     Tom
>> >
>> >     On Sun, Feb 2, 2020 at 9:02 AM Tamer Higazi via FreeSWITCH-users
>> >     <freeswitch-users at lists.freeswitch.org
>> >     <mailto:freeswitch-users at lists.freeswitch.org>> wrote:
>> >
>> >
>> >
>> >
>> >         ---------- Forwarded message ----------
>> >         From: Tamer Higazi <th982a at googlemail.com
>> >         <mailto:th982a at googlemail.com>>
>> >         To: freeswitch-users at lists.freeswitch.org
>> >         <mailto:freeswitch-users at lists.freeswitch.org>
>> >         Cc:
>> >         Bcc:
>> >         Date: Sun, 2 Feb 2020 18:02:09 +0100
>> >         Subject: Re: [Freeswitch-users] Stumped by mod_portaudio
>> >         permissions issue
>> >         Dear Tom,
>> >
>> >         This is not true.
>> >         I am running freeswitch as the user I am logged in.
>> >
>> >         as root:
>> >         chown -R tamer:users /opt/freeswitch
>> >
>> >         as user:
>> >         /opt/freeswitch/bin/freeswitch -nc
>> >
>> >         as user:
>> >         fs_cli -r
>> >
>> >         and you will see portaudio runs without any problems.
>> >
>> >         I have it in combination with pulseaudio running.
>> >
>> >
>> >         best, Tamer
>> >
>> >         On 2020-02-02 17:01, Tom Lynn wrote:
>> >         > I do not have pulse audio installed.
>> >         >
>> >         > I can access alsamixer and aplay from the shell while logged
>> >         in as
>> >         > either root or freeswitch without issues.
>> >         >
>> >         > mod_portaudio only works WHEN I'm running freeswitch under
>> >         group root,
>> >         > which I will not be able to do in a production environment.
>> >         >
>> >         > On Sun, Feb 2, 2020 at 7:24 AM Tamer Higazi via
>> >         FreeSWITCH-users
>> >         > <freeswitch-users at lists.freeswitch.org
>> >         <mailto:freeswitch-users at lists.freeswitch.org>
>> >         > <mailto:freeswitch-users at lists.freeswitch.org
>> >         <mailto:freeswitch-users at lists.freeswitch.org>>> wrote:
>> >         >
>> >         >
>> >         >
>> >         >
>> >         >     ---------- Forwarded message ----------
>> >         >     From: Tamer Higazi <th982a at googlemail.com
>> >         <mailto:th982a at googlemail.com>
>> >         >     <mailto:th982a at googlemail.com
>> >         <mailto:th982a at googlemail.com>>>
>> >         >     To: freeswitch-users at lists.freeswitch.org
>> >         <mailto:freeswitch-users at lists.freeswitch.org>
>> >         >     <mailto:freeswitch-users at lists.freeswitch.org
>> >         <mailto:freeswitch-users at lists.freeswitch.org>>
>> >         >     Cc:
>> >         >     Bcc:
>> >         >     Date: Sun, 2 Feb 2020 15:22:31 +0100
>> >         >     Subject: Re: [Freeswitch-users] Stumped by mod_portaudio
>> >         >     permissions issue
>> >         >     Dear Mark,
>> >         >
>> >         >     I tell you exactly why.
>> >         >
>> >         >     That is less a permission issue.
>> >         >
>> >         >     if you open the shell as "root" and type alsamixer you
>> >         won't be
>> >         >     capable
>> >         >     to access the soundcard because "root" is not in the
>> >         1st) sound group
>> >         >     and 2nd) root ha no access to the pulseaudio server
>> >         >
>> >         >     This is why I MUST run freeswitch as the user that is
>> >         currently
>> >         >     logged in.
>> >         >
>> >         >     mod_alsa doesn't work at all. I didn't get it running,
>> only
>> >         >     mod_portaudio....
>> >         >
>> >         >
>> >         >     best, Tamer
>> >         >
>> >         >
>> >         >     On 2020-02-02 07:59, Tom Lynn wrote:
>> >         >     > For what it's worth, I'm running into this very same
>> >         issue over 4
>> >         >     > years after the original poster.  I suspect that
>> >         leaving off the
>> >         >     group
>> >         >     > option is leaving the process running as group root,
>> >         which would
>> >         >     mimic
>> >         >     > my attempt at having the service run as user
>> >         freeswitch/group root,
>> >         >     > which allows mod_portaudio to function.
>> >         >     >
>> >         >     > I've posted here in the mail list, on IRC and in
>> >         Slack, but the
>> >         >     only
>> >         >     > bite was someone hinting about freeswitch user needing
>> >         to be in
>> >         >     group
>> >         >     > audio, which it is.  This is broken. I've looked at
>> >         submitting a
>> >         >     JIRA
>> >         >     > on this, but my login doesn't appear to allow it.
>> >         >     >
>> >         >     > On Fri, Sep 11, 2015 at 9:45 AM Mark Haun
>> >         <haunma at keteu.org <mailto:haunma at keteu.org>
>> >         >     <mailto:haunma at keteu.org <mailto:haunma at keteu.org>>
>> >         >     > <mailto:haunma at keteu.org <mailto:haunma at keteu.org>
>> >         <mailto:haunma at keteu.org <mailto:haunma at keteu.org>>>> wrote:
>> >         >     >
>> >         >     > covici at ccs.covici.com <mailto:covici at ccs.covici.com>
>> >         <mailto:covici at ccs.covici.com <mailto:covici at ccs.covici.com>>
>> >         >     <mailto:covici at ccs.covici.com
>> >         <mailto:covici at ccs.covici.com> <mailto:covici at ccs.covici.com
>> >         <mailto:covici at ccs.covici.com>>>
>> >         >     >     [covici at ccs.covici.com
>> >         <mailto:covici at ccs.covici.com> <mailto:covici at ccs.covici.com
>> >         <mailto:covici at ccs.covici.com>>
>> >         >     <mailto:covici at ccs.covici.com
>> >         <mailto:covici at ccs.covici.com> <mailto:covici at ccs.covici.com
>> >         <mailto:covici at ccs.covici.com>>>] wrote:
>> >         >     >     > If  using alsa, did you check the permission of
>> >         /dev/snd
>> >         >     and its
>> >         >     >     > children?
>> >         >     >
>> >         >     >     Yes.  In fact, both alsa operations (aplay) and
>> >         portaudio
>> >         >     >     enumeration work
>> >         >     >     correctly when running as the freeswitch user.
>> >         All of this is
>> >         >     >     detailed in
>> >         >     >     my initial post, two or three weeks ago.
>> >         >     >
>> >         >     >     Mark
>> >         >     >
>> >         >     >
>> >         >
>> >
>>    _________________________________________________________________________
>> >         >     >     Professional FreeSWITCH Consulting Services:
>> >         >     > consulting at freeswitch.org
>> >         <mailto:consulting at freeswitch.org>
>> >         <mailto:consulting at freeswitch.org
>> >         <mailto:consulting at freeswitch.org>>
>> >         >     <mailto:consulting at freeswitch.org
>> >         <mailto:consulting at freeswitch.org>
>> >         <mailto:consulting at freeswitch.org
>> >         <mailto:consulting at freeswitch.org>>>
>> >         >     > http://www.freeswitchsolutions.com
>> >         >     >
>> >         >     >     Official FreeSWITCH Sites
>> >         >     > http://www.freeswitch.org
>> >         >     > http://confluence.freeswitch.org
>> >         >     > http://www.cluecon.com
>> >         >     >
>> >         >     >     FreeSWITCH-users mailing list
>> >         >     > FreeSWITCH-users at lists.freeswitch.org
>> >         <mailto:FreeSWITCH-users at lists.freeswitch.org>
>> >         >     <mailto:FreeSWITCH-users at lists.freeswitch.org
>> >         <mailto:FreeSWITCH-users at lists.freeswitch.org>>
>> >         >     >     <mailto:FreeSWITCH-users at lists.freeswitch.org
>> >         <mailto:FreeSWITCH-users at lists.freeswitch.org>
>> >         >     <mailto:FreeSWITCH-users at lists.freeswitch.org
>> >         <mailto:FreeSWITCH-users at lists.freeswitch.org>>>
>> >         >     >
>> >         http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> >         >     >
>> >         >
>> >           UNSUBSCRIBE:
>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>> >         >     > http://www.freeswitch.org
>> >         >     >
>> >         >     >
>> >         >     >
>> >         >
>> >
>>   _________________________________________________________________________
>> >         >     >
>> >         >     > The FreeSWITCH project is sponsored by SignalWire
>> >         > https://signalwire.com
>> >         >     > Enhance your FreeSWITCH install with disruptive priced
>> >         SMS and
>> >         >     PSTN services.
>> >         >     > Build your next product on our scalable cloud platform.
>> >         >     >
>> >         >     > Join our online community to chat in real time
>> >         > https://signalwire.community
>> >         >     >
>> >         >     > Professional FreeSWITCH Services
>> >         >     > sales at freeswitch.com <mailto:sales at freeswitch.com>
>> >         <mailto:sales at freeswitch.com <mailto:sales at freeswitch.com>>
>> >         >     > https://freeswitch.com
>> >         >     >
>> >         >     > Official FreeSWITCH Sites
>> >         >     > https://freeswitch.com/oss
>> >         >     > https://freeswitch.org/confluence
>> >         >     > https://cluecon.com
>> >         >     >
>> >         >     > FreeSWITCH-users mailing list
>> >         >     > FreeSWITCH-users at lists.freeswitch.org
>> >         <mailto:FreeSWITCH-users at lists.freeswitch.org>
>> >         >     <mailto:FreeSWITCH-users at lists.freeswitch.org
>> >         <mailto:FreeSWITCH-users at lists.freeswitch.org>>
>> >         >     >
>> >         http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> >         >     >
>> >         >
>> >          UNSUBSCRIBE:
>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>> >         >     > https://freeswitch.com
>> >         >
>> >         >
>> >         >
>> >         >
>> >         >     ---------- Forwarded message ----------
>> >         >     From: Tamer Higazi via FreeSWITCH-users
>> >         >     <freeswitch-users at lists.freeswitch.org
>> >         <mailto:freeswitch-users at lists.freeswitch.org>
>> >         >     <mailto:freeswitch-users at lists.freeswitch.org
>> >         <mailto:freeswitch-users at lists.freeswitch.org>>>
>> >         >     To: freeswitch-users at lists.freeswitch.org
>> >         <mailto:freeswitch-users at lists.freeswitch.org>
>> >         >     <mailto:freeswitch-users at lists.freeswitch.org
>> >         <mailto:freeswitch-users at lists.freeswitch.org>>
>> >         >     Cc:
>> >         >     Bcc:
>> >         >     Date: Sun, 02 Feb 2020 07:24:11 -0800 (PST)
>> >         >     Subject: Re: [Freeswitch-users] Stumped by mod_portaudio
>> >         >     permissions issue
>> >         >
>> >
>>   _________________________________________________________________________
>> >         >
>> >         >     The FreeSWITCH project is sponsored by SignalWire
>> >         > https://signalwire.com
>> >         >     Enhance your FreeSWITCH install with disruptive priced
>> >         SMS and
>> >         >     PSTN services.
>> >         >     Build your next product on our scalable cloud platform.
>> >         >
>> >         >     Join our online community to chat in real time
>> >         > https://signalwire.community
>> >         >
>> >         >     Professional FreeSWITCH Services
>> >         > sales at freeswitch.com <mailto:sales at freeswitch.com>
>> >         <mailto:sales at freeswitch.com <mailto:sales at freeswitch.com>>
>> >         > https://freeswitch.com
>> >         >
>> >         >     Official FreeSWITCH Sites
>> >         > https://freeswitch.com/oss
>> >         > https://freeswitch.org/confluence
>> >         > https://cluecon.com
>> >         >
>> >         >     FreeSWITCH-users mailing list
>> >         > FreeSWITCH-users at lists.freeswitch.org
>> >         <mailto:FreeSWITCH-users at lists.freeswitch.org>
>> >         >     <mailto:FreeSWITCH-users at lists.freeswitch.org
>> >         <mailto:FreeSWITCH-users at lists.freeswitch.org>>
>> >         > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> >         >
>> >          UNSUBSCRIBE:
>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>> >         > https://freeswitch.com
>> >         >
>> >         >
>> >         >
>> >
>>  _________________________________________________________________________
>> >         >
>> >         > The FreeSWITCH project is sponsored by SignalWire
>> >         https://signalwire.com
>> >         > Enhance your FreeSWITCH install with disruptive priced SMS
>> >         and PSTN services.
>> >         > Build your next product on our scalable cloud platform.
>> >         >
>> >         > Join our online community to chat in real time
>> >         https://signalwire.community
>> >         >
>> >         > Professional FreeSWITCH Services
>> >         > sales at freeswitch.com <mailto:sales at freeswitch.com>
>> >         > https://freeswitch.com
>> >         >
>> >         > Official FreeSWITCH Sites
>> >         > https://freeswitch.com/oss
>> >         > https://freeswitch.org/confluence
>> >         > https://cluecon.com
>> >         >
>> >         > FreeSWITCH-users mailing list
>> >         > FreeSWITCH-users at lists.freeswitch.org
>> >         <mailto:FreeSWITCH-users at lists.freeswitch.org>
>> >         > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> >         >
>> >         UNSUBSCRIBE:
>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>> >         > https://freeswitch.com
>> >
>> >
>> >
>> >
>> >         ---------- Forwarded message ----------
>> >         From: Tamer Higazi via FreeSWITCH-users
>> >         <freeswitch-users at lists.freeswitch.org
>> >         <mailto:freeswitch-users at lists.freeswitch.org>>
>> >         To: freeswitch-users at lists.freeswitch.org
>> >         <mailto:freeswitch-users at lists.freeswitch.org>
>> >         Cc:
>> >         Bcc:
>> >         Date: Sun, 02 Feb 2020 09:02:50 -0800 (PST)
>> >         Subject: Re: [Freeswitch-users] Stumped by mod_portaudio
>> >         permissions issue
>> >
>>  _________________________________________________________________________
>> >
>> >         The FreeSWITCH project is sponsored by SignalWire
>> >         https://signalwire.com
>> >         Enhance your FreeSWITCH install with disruptive priced SMS and
>> >         PSTN services.
>> >         Build your next product on our scalable cloud platform.
>> >
>> >         Join our online community to chat in real time
>> >         https://signalwire.community
>> >
>> >         Professional FreeSWITCH Services
>> >         sales at freeswitch.com <mailto:sales at freeswitch.com>
>> >         https://freeswitch.com
>> >
>> >         Official FreeSWITCH Sites
>> >         https://freeswitch.com/oss
>> >         https://freeswitch.org/confluence
>> >         https://cluecon.com
>> >
>> >         FreeSWITCH-users mailing list
>> >         FreeSWITCH-users at lists.freeswitch.org
>> >         <mailto:FreeSWITCH-users at lists.freeswitch.org>
>> >         http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> >         UNSUBSCRIBE:
>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>> >         https://freeswitch.com
>> >
>> >
>> >
>> _________________________________________________________________________
>> >
>> > The FreeSWITCH project is sponsored by SignalWire
>> https://signalwire.com
>> > Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
>> services.
>> > Build your next product on our scalable cloud platform.
>> >
>> > Join our online community to chat in real time
>> https://signalwire.community
>> >
>> > Professional FreeSWITCH Services
>> > sales at freeswitch.com
>> > https://freeswitch.com
>> >
>> > Official FreeSWITCH Sites
>> > https://freeswitch.com/oss
>> > https://freeswitch.org/confluence
>> > https://cluecon.com
>> >
>> > FreeSWITCH-users mailing list
>> > FreeSWITCH-users at lists.freeswitch.org
>> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> > UNSUBSCRIBE:
>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>> > https://freeswitch.com
>>
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Tamer Higazi via FreeSWITCH-users <
>> freeswitch-users at lists.freeswitch.org>
>> To: freeswitch-users at lists.freeswitch.org
>> Cc:
>> Bcc:
>> Date: Sun, 02 Feb 2020 19:58:09 -0800 (PST)
>> Subject: Re: [Freeswitch-users] Stumped by mod_portaudio permissions issue
>> _________________________________________________________________________
>>
>> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
>> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
>> services.
>> Build your next product on our scalable cloud platform.
>>
>> Join our online community to chat in real time
>> https://signalwire.community
>>
>> Professional FreeSWITCH Services
>> sales at freeswitch.com
>> https://freeswitch.com
>>
>> Official FreeSWITCH Sites
>> https://freeswitch.com/oss
>> https://freeswitch.org/confluence
>> https://cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> https://freeswitch.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20200215/ac8d932e/attachment-0001.html>


More information about the FreeSWITCH-users mailing list