10-13-2020, 03:24 AM
(02-21-2020, 09:56 PM)cmicallef Wrote:(02-21-2020, 06:10 AM)wibble Wrote: The need to manually change audio profiles was the problem running stock SIP clients back in the Openmoko days too. Are you adjusting mixer settings directly, or using some interface to switch audio profiles? I've been looking for a 'standard' way to do this, but haven't found a consistent one. There was the freesmartphone.org dbus interface, but that seems unused now. Alsa has alsaucm and its API equivalents, while PulseAudio has its own profile thing, but neither seem to have the push/pop capability freesmartphone.org had for returning to whatever profile was active before you changed it.
Sorry, this is going to be a quick post because I'm under the pump getting ready for a trial for work.
Presently, I am doing it the worst possible way. I've hooked bash scripts in Baresip. I'm not entirely sure if this is the best spot to handle events. Plus I could probably write a module for Baresip that allows you to call scripts on certain events taking place. The scripts call 'amixer' to mute/unmute etc.
Here's a dump of the scripts and patches. And, again sorry for the brevity as I'm under the pump. Do as you please with them.
BASH SCRIPT DUMPS
Code:pinephone:/mnt/mmcblk2p1/home/phablet$ find . -maxdepth 1 -iname \*.sh -print -exec cat {} \; ./fix-audio.sh #!/bin/bash amixer -c 0 set 'AIF1 Slot 0 Digital DAC' unmute amixer -c 0 set 'Line Out' unmute amixer sset 'Line Out' 100% ./unmute-earpiece.sh #!/bin/bash amixer -c 0 set 'AIF1 Slot 0 Digital DAC' unmute amixer -c 0 set 'Earpiece' unmute amixer sset 'Earpiece' 100% ./mute-loudspeaker.sh #!/bin/bash amixer -c 0 set 'AIF1 Slot 0 Digital DAC' mute amixer -c 0 set 'DAC' mute amixer -c 0 set 'Line Out' mute amixer sset 'Line Out' 0% ./mute-microphone1.sh #!/bin/bash amixer -c 0 sset 'AIF1 Data Digital ADC' nocap amixer -c 0 sset 'Mic1' nocap amixer -c 0 set 'Mic1' mute amixer sset 'Mic1' 0% ./start-call.sh #!/bin/bash echo "STARTING CALL"; bash mute-loudspeaker.sh; bash unmute-earpiece.sh; bash unmute-microphone1.sh ./unmute-loudspeaker.sh #!/bin/bash amixer -c 0 set 'AIF1 Slot 0 Digital DAC' unmute amixer -c 0 set 'DAC' unmute amixer -c 0 set 'Line Out' unmute amixer sset 'Line Out' 100% ./mute-earpiece.sh #!/bin/bash amixer -c 0 set 'AIF1 Slot 0 Digital DAC' unmute amixer -c 0 set 'Earpiece' mute amixer sset 'Earpiece' 0% ./finish-call.sh echo "FINISHING CALL" bash unmute-loudspeaker.sh; bash mute-earpiece.sh; bash mute-microphone1.sh ./unmute-microphone1.sh #!/bin/bash amixer -c 0 sset 'AIF1 Data Digital ADC' cap amixer -c 0 sset 'Mic1' cap
PATCH DUMP
Code:diff -u baresip-0.6.5/src/ua.c baresip-0.6.5/src/ua.c --- baresip-0.6.5/src/ua.c +++ baresip-0.6.5/src/ua.c @@ -9,6 +9,6 @@ #include "core.h" #include <ctype.h> +#include <stdlib.h> - /** Magic number */ #define MAGIC 0x0a0a0a0a @@ -346,5 +346,7 @@ case CALL_EVENT_INCOMING: + ua_printf(ua, "CALL_EVENT_INCOMING\n", peeruri); + if (contact_block_access(baresip_contacts(), peeruri)) { @@ -373,20 +375,26 @@ break; case CALL_EVENT_RINGING: + ua_printf(ua, "CALL_EVENT_RINGING\n", peeruri); ua_event(ua, UA_EVENT_CALL_RINGING, call, peeruri); break; case CALL_EVENT_PROGRESS: + ua_printf(ua, "CALL_EVENT_PROGRESS\n", peeruri); ua_printf(ua, "Call in-progress: %s\n", peeruri); ua_event(ua, UA_EVENT_CALL_PROGRESS, call, peeruri); break; case CALL_EVENT_ESTABLISHED: + ua_printf(ua, "CALL_EVENT_ESTABLISHED\n", peeruri); + system("/bin/bash /home/phablet/start-call.sh"); ua_printf(ua, "Call established: %s\n", peeruri); ua_event(ua, UA_EVENT_CALL_ESTABLISHED, call, peeruri); break; case CALL_EVENT_CLOSED: + ua_printf(ua, "CALL_EVENT_CLOSED\n", peeruri); + system("/bin/bash /home/phablet/finish-call.sh"); ua_event(ua, UA_EVENT_CALL_CLOSED, call, str); mem_deref(call); @@ -394,6 +402,7 @@ break; case CALL_EVENT_TRANSFER: + ua_printf(ua, "CALL_EVENT_TRANSFER\n", peeruri); ua_event(ua, UA_EVENT_CALL_TRANSFER, call, str); break; @@ -402,6 +411,7 @@ break; case CALL_EVENT_MENC: + ua_printf(ua, "CALL_EVENT_MENC\n", peeruri); ua_event(ua, UA_EVENT_CALL_MENC, call, str); break; }
(02-21-2020, 06:04 PM)tahayassen Wrote: On my nexus 5 (not pinephone), linphone in the open store in Ubuntu Touch works excellently.
Yes, I looked at that in the OpenStore. Unfortunately, they don't have a 64-bit build/release at the moment. I understand that a 64-bit build is on their TODO list. I recall seeing it mentioned on gitlab.com (https://gitlab.com/ubports-linphone/linp...ple/issues).
Hi,
can you please provide your baresip config. I tried to get baresip working under mobian but without luck.

