Linphone GUI for SailfishOS

Dear all,

I’ve successfully compiled console linphone client (5.2 release branch) for SFOS and It works fine.

Now I’m working on python daemon for linphone and GUI on QML for visualization. Already done catching incoming calls, answering, terminating and making calls. As well as there is DBus commutation between GUI and daemon.

There is some questions about sound switching. At present in my version there are same problems like in s1p: calling and voice volume is according “music" volume of the system. As far as I understood the native voicecall-ui uses pulseaudio card profile or something like this for sound switching. But I absolutely josser in pulseaudio. Could somebody tell me more about this and the Jolla realization? And more one how I can use “call” volume of the system?

I think, the best way is incorporate linphonec directly to Jolla way. I understood how I can do muting all other programs via pulseaudio sink commutation, but I don’t understood how I can do it via profiles as well as use “call” volume instead “music”.

13 Likes

Amazing news! Thanks for your contribution :slight_smile:
If you need someone to test or help with UI/UX, I’ll be glad to help you!

I’ll have to look it up but I think it may be sufficient to set a env variable, or a pulse property to get it use the right audio profile.

At least with many games (mainly SDL) that works.

EDIT:

# C++
setenv("PULSE_PROP_media.role", "x-maemo", 1);
# or on shell
export PULSE_PROP_media_role="x-maemo"

That’s what makes volume controls behave with SDL apps, probably something similar exists for calls.

Look at /etc/pulse/xpolicy.conf and similar config files. It has something called ‘ipcall’, sounds like it would be appropriate for SIP.

5 Likes

Thanks for your reply!

I’ve tried to set PULSE_PROP_media.role to x-maemo, phone and voip. It seems that first is a regular role for applications. Them change volume according “music” slider. Phone role is equal to native voicecall (see via pactl list) and this role is really unlinked from “music” slider, but linphonec volume has the biggest level and doesn’t control via sliders and hw buttons. Voip role behaves the same way.

After this I see to “paclt list” during native call and linphonec. There is differs in policy.group. I’ve tyied to use different policies via xpolicy.conf, but right now it has the same behavior like default “othermedia” policy.group.

This is just intermediate state about the problem and I wrote it because the next approach to its solving will not be available before Saturday…

Some more information from “pactl list”.

1_ New Sink input during native call (ringing and active call gives the same)

Sink Input #42
Driver: module-meego-mainvolume.c
Owner Module: 4
Client: n/a
Sink: 2
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Format: pcm, format.sample_format = ““s16le”” format.rate = “44100” format.channels = “2” format.channel_map = ““front-left,front-right””
Corked: yes
Mute: no
Volume: front-left: 32846 / 50% / -18.00 dB, front-right: 32846 / 50% / -18.00 dB
balance 0.00
Buffer Latency: 0 usec
Sink Latency: 0 usec
Resample method: speex-fixed-2
Properties:
media.name = “Virtual Stream for MainVolume Volume Control”
media.role = “phone”
policy.group = “internal”
policy.stream_flags = hex:00000000
module-stream-restore.id = “sink-input-by-media-role:phone”

2_ Linephonec with “phone” role and “internal” group.

Sink Input #7
Driver: protocol-native.c
Owner Module: 14
Client: 11
Sink: 0
Sample Specification: s16le 1ch 48000Hz
Channel Map: mono
Format: pcm, format.sample_format = ““s16le”” format.rate = “48000” format.channels = “1” format.channel_map = ““mono””
Corked: no
Mute: no
Volume: mono: 44649 / 68% / -10.00 dB
balance 0.00
Buffer Latency: 0 usec
Sink Latency: 8000 usec
Resample method: copy
Properties:
media.name = “phone”
application.name = “linphonec”
native-protocol.peer = “UNIX socket client”
native-protocol.version = “34”
policy.application.id = “2dc6383”
media.role = “phone”
policy.group = “internal”
application.process.id = “35352”
application.process.user = “defaultuser”
application.process.host = “Xperia10III”
application.process.binary = “linphonec”
application.language = “C”
application.process.machine_id = “97fd84f026b141f2a5030f9df10eba2e”
application.process.session_id = “c8”
application.process.arg0 = “linphonec”
policy.stream_flags = hex:00000000
module-stream-restore.id = “sink-input-by-media-role:phone”

Source Output #2
Driver: protocol-native.c
Owner Module: 14
Client: 11
Source: 2
Sample Specification: s16le 1ch 8000Hz
Channel Map: mono
Format: pcm, format.sample_format = ““s16le”” format.rate = “8000” format.channels = “1” format.channel_map = ““mono””
Corked: no
Mute: no
Volume: mono: 65536 / 100% / 0.00 dB
balance 0.00
Buffer Latency: 0 usec
Source Latency: 0 usec
Resample method: n/a
Properties:
media.name = “phone”
application.name = “linphonec”
native-protocol.peer = “UNIX socket client”
native-protocol.version = “34”
policy.application.id = “2dc6383”
media.role = “phone”
policy.group = “internal”
application.process.id = “35352”
application.process.user = “defaultuser”
application.process.host = “Xperia10III”
application.process.binary = “linphonec”
application.language = “C”
application.process.machine_id = “97fd84f026b141f2a5030f9df10eba2e”
application.process.session_id = “c8”
application.process.arg0 = “linphonec”
module-stream-restore.id = “source-output-by-media-role:phone”

I found this old TMO post:

Where they recommend:

put the following in /etc/pulse/xpolicy.conf . then systemctl restart pulseaudio.service .

[stream]
exe = voicecall-manager
group = call

So maybe a solution would be to add

[stream]
exe = linphonec
group = call

(You probably can create a new file under /etc/pulse/xpolicy.conf.d/)

Also, settings should probably be different for ringing sound and in-call audio.

Maybe use as an example /etc/pulse/xpolicy.conf.d/appsupportaudio.conf, which has a corresponding entry in /etc/pulse/xpolicy.conf:

[group]
name   = aliencall
flags  = route_audio, limit_volume, mute_by_route
[...]

[group]
name   = ringtone
flags  = set_sink, limit_volume, mute_by_route, cork_stream, media_notify
sink   = droid.output.media_latency@equals:"true"

… and then defines different behavior in that separate conf file like:

[stream]
exe             = appsupportaudio
property        = media.name@equals:"voice"
group           = aliencall

[stream]
exe             = appsupportaudio
property        = media.name@equals:"ring"
group           = ringtone

As linphone seems to use media.name = phone that would be:

/etc/pulse/xpolicy.conf.d/linphone.conf,

[stream]
exe             = linphonec
property        = media.name@equals:"phone"
group           = ipcall

[stream]
exe             = libphonec
property        = media.name@equals:"ringing"
group           = ringtone

(assuming when it rings, media.name is ringing)

2 Likes