It is currently Mon Dec 11, 2017 7:20 pm

rSAP for Android Forum

Support forum for Android rSAP App

LG G3 D855 - VW Passat - RCD310 broken after ChupaChups Mod

Discussions about running the rSAP app on the LG G2/G3
 
Posts: 5
Joined: Sat Feb 28, 2015 5:30 pm

LG G3 D855 - VW Passat - RCD310 broken after ChupaChups Mod

Post by JoeD » Sat Feb 28, 2015 5:54 pm

Hi,

I'm not using your app, but maybe you could help me restoring my rSAP functionality?

I have a LG G3 D855 and a VW Passat with a RCD310.

In the beginning evrything worked fine, the phone connected to the car in rSAP mode.
But after I rooted my phone and installed Chupa Chups Mod I never got rSAP to work again.
Since then the Phone never asked again for permission to access the SIM.

I restored the G3 back to Stock V10J. But still no luck.

Maybe you can point me in a direction why rSAP does not work anymore?

Best regards
JoeD

 
Posts: 4043
Joined: Wed Mar 23, 2011 4:12 pm

Re: LG G3 D855 - VW Passat - RCD310 broken after ChupaChups

Post by admin » Sat Feb 28, 2015 9:55 pm

I must confess that I never verified this on the G3, but usually Qualcomm phones use the executable 'sapd' for rSAP. If this is not running, rSAP won't work. But I also must confess that I did not yet find out where sapd is started. If you find out please let me know ;)

 
Posts: 5
Joined: Sat Feb 28, 2015 5:30 pm

Re: LG G3 D855 - VW Passat - RCD310 broken after ChupaChups

Post by JoeD » Sun Mar 01, 2015 10:37 pm

So I searched for the "sapd" process with
Code: Select all
ps | grep sapd

It returned nothing.

The sapd executable lies under /system/bin/sapd
When I start it by hand, it returns 255 directly.
I will search for a call to this executable tomorrow. And maybe try to find something in logcat.
I guess I have to go to the car for a connection. Or can I emulate a rSAP profile connection with my laptop?

In /system/etc/ I found the file init galbi.bt.sh which sets the property "ro.qualcomm.bluetooth.sap" true or false.

Code: Select all
shell@g3:/system/etc $ cat init.galbi.bt.sh
#!/system/bin/sh
# Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the name of The Linux Foundation nor
#       the names of its contributors may be used to endorse or promote
#       products derived from this software without specific prior written
#       permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

#Read the arguments passed to the script
config="$1"

BLUETOOTH_SLEEP_PATH=/proc/bluetooth/sleep/proto
LOG_TAG="qcom-bluetooth"
LOG_NAME="${0}:"

hciattach_pid=""

loge ()
{
  /system/bin/log -t $LOG_TAG -p e "$LOG_NAME $@"
}

logi ()
{
  /system/bin/log -t $LOG_TAG -p i "$LOG_NAME $@"
}

failed ()
{
  loge "$1: exit code $2"
  exit $2
}

program_bdaddr ()
{
  /system/bin/btnvtool -O
  logi "Bluetooth Address programmed successfully"
}

#
# enable bluetooth profiles dynamically
#
config_bt ()
{
  baseband=`getprop ro.baseband`
  target=`getprop ro.board.platform`
  soc_hwid=`cat /sys/devices/system/soc/soc0/id`
  btsoc=`getprop qcom.bluetooth.soc`

  case $baseband in
    "apq")
        setprop ro.qualcomm.bluetooth.opp true
        setprop ro.qualcomm.bluetooth.ftp true
        setprop ro.qualcomm.bluetooth.nap false
        setprop ro.qualcomm.bluetooth.sap false
        setprop ro.qualcomm.bluetooth.dun false
        # For MPQ as baseband is same for both
        case $soc_hwid in
          "130")
              setprop ro.qualcomm.bluetooth.hsp true
              setprop ro.qualcomm.bluetooth.hfp true
              setprop ro.qualcomm.bluetooth.pbap false
              setprop ro.qualcomm.bluetooth.map false
              ;;
          *)
              setprop ro.qualcomm.bluetooth.hsp false
              setprop ro.qualcomm.bluetooth.hfp false
              setprop ro.qualcomm.bluetooth.pbap true
              setprop ro.qualcomm.bluetooth.map true
              ;;
        esac
        ;;
    "mdm" | "svlte2a" | "svlte1" | "csfb")
        setprop ro.qualcomm.bluetooth.opp true
        setprop ro.qualcomm.bluetooth.hfp true
        setprop ro.qualcomm.bluetooth.hsp true
        setprop ro.qualcomm.bluetooth.pbap true
        setprop ro.qualcomm.bluetooth.ftp true
        setprop ro.qualcomm.bluetooth.map true
        setprop ro.qualcomm.bluetooth.nap true
        setprop ro.qualcomm.bluetooth.sap true
        setprop ro.qualcomm.bluetooth.dun false
        ;;
    "msm")
        setprop ro.qualcomm.bluetooth.opp true
        setprop ro.qualcomm.bluetooth.hfp true
        setprop ro.qualcomm.bluetooth.hsp true
        setprop ro.qualcomm.bluetooth.pbap true
        setprop ro.qualcomm.bluetooth.ftp true
        setprop ro.qualcomm.bluetooth.nap true
        setprop ro.qualcomm.bluetooth.sap true
        setprop ro.qualcomm.bluetooth.dun true
        case $btsoc in
          "ath3k")
              setprop ro.qualcomm.bluetooth.map false
              ;;
          *)
              setprop ro.qualcomm.bluetooth.map true
              ;;
        esac
        ;;
    *)
        setprop ro.qualcomm.bluetooth.opp true
        setprop ro.qualcomm.bluetooth.hfp true
        setprop ro.qualcomm.bluetooth.hsp true
        setprop ro.qualcomm.bluetooth.pbap true
        setprop ro.qualcomm.bluetooth.ftp true
        setprop ro.qualcomm.bluetooth.map true
        setprop ro.qualcomm.bluetooth.nap true
        setprop ro.qualcomm.bluetooth.sap true
        setprop ro.qualcomm.bluetooth.dun true
        ;;
  esac

  #Enable Bluetooth Profiles specific to target Dynamically
  case $target in
    "msm8960")
       if [ "$btsoc" != "ath3k" ] && [ "$soc_hwid" != "130" ]
       then
           setprop ro.bluetooth.hfp.ver 1.6
           setprop ro.qualcomm.bt.hci_transport smd
       fi
       ;;
    "msm8974" | "msm8226" | "msm8610" )
       if [ "$btsoc" != "ath3k" ]
       then
           setprop ro.bluetooth.hfp.ver 1.6
           setprop ro.qualcomm.bt.hci_transport smd
       fi
       ;;
    *)
       ;;
  esac

if [ -f /system/etc/bluetooth/stack.conf ]; then
stack=`cat /system/etc/bluetooth/stack.conf`
fi

case "$stack" in
    "bluez")
           logi "Bluetooth stack is $stack"
           setprop ro.qc.bluetooth.stack $stack
           reason=`getprop vold.decrypt`
           case "$reason" in
               "trigger_restart_framework")
                   start dbus
                   ;;
           esac
        ;;
    *)
           logi "Bluetooth stack is Bluedroid"
        ;;
esac

}

start_hciattach ()
{
  /system/bin/hciattach -n $BTS_DEVICE $BTS_TYPE $BTS_BAUD &
  hciattach_pid=$!
  logi "start_hciattach: pid = $hciattach_pid"
  echo 1 > $BLUETOOTH_SLEEP_PATH
}

kill_hciattach ()
{
  echo 0 > $BLUETOOTH_SLEEP_PATH
  logi "kill_hciattach: pid = $hciattach_pid"
  ## careful not to kill zero or null!
  kill -TERM $hciattach_pid
  # this shell doesn't exit now -- wait returns for normal exit
}

logi "init.galbi.bt.sh config = $config"
case "$config" in
    "onboot")
        program_bdaddr
        config_bt
        exit 0
        ;;
    *)
        ;;
esac

# mimic hciattach options parsing -- maybe a waste of effort
USAGE="hciattach [-n] [-p] [-b] [-t timeout] [-s initial_speed] <tty> <type | id> [speed] [flow|noflow] [bdaddr]"

while getopts "blnpt:s:" f
do
  case $f in
  b | l | n | p)  opt_flags="$opt_flags -$f" ;;
  t)      timeout=$OPTARG;;
  s)      initial_speed=$OPTARG;;
  \?)     echo $USAGE; exit 1;;
  esac
done
shift $(($OPTIND-1))

# Note that "hci_qcomm_init -e" prints expressions to set the shell variables
# BTS_DEVICE, BTS_TYPE, BTS_BAUD, and BTS_ADDRESS.

#Selectively Disable sleep
BOARD=`getprop ro.board.platform`

# BR/EDR & LE power class configurations
POWER_CLASS=`getprop qcom.bt.dev_power_class`
LE_POWER_CLASS=`getprop qcom.bt.le_dev_pwr_class`

#find the transport type
TRANSPORT=`getprop ro.qualcomm.bt.hci_transport`
logi "Transport : $TRANSPORT"

setprop bluetooth.status off

case $POWER_CLASS in
  1) PWR_CLASS="-p 0" ;
     logi "Power Class: 1";;
  2) PWR_CLASS="-p 1" ;
     logi "Power Class: 2";;
  3) PWR_CLASS="-p 2" ;
     logi "Power Class: CUSTOM";;
  *) PWR_CLASS="";
     logi "Power Class: Ignored. Default(1) used (1-CLASS1/2-CLASS2/3-CUSTOM)";
     logi "Power Class: To override, Before turning BT ON; setprop qcom.bt.dev_power_class <1 or 2 or 3>";;
esac

case $LE_POWER_CLASS in
  1) LE_PWR_CLASS="-P 0" ;
     logi "LE Power Class: 1";;
  2) LE_PWR_CLASS="-P 1" ;
     logi "LE Power Class: 2";;
  3) LE_PWR_CLASS="-P 2" ;
     logi "LE Power Class: CUSTOM";;
  *) LE_PWR_CLASS="-P 1";
     logi "LE Power Class: Ignored. Default(2) used (1-CLASS1/2-CLASS2/3-CUSTOM)";
     logi "LE Power Class: To override, Before turning BT ON; setprop qcom.bt.le_dev_pwr_class <1 or 2 or 3>";;
esac

eval $(/system/bin/hci_qcomm_init -e $PWR_CLASS $LE_PWR_CLASS && echo "exit_code_hci_qcomm_init=0" || echo "exit_code_hci_qcomm_init=1")

case $exit_code_hci_qcomm_init in
  0) logi "Bluetooth QSoC firmware download succeeded, $BTS_DEVICE $BTS_TYPE $BTS_BAUD $BTS_ADDRESS";;
  *) failed "Bluetooth QSoC firmware download failed" $exit_code_hci_qcomm_init;
     setprop bluetooth.status off;
     exit $exit_code_hci_qcomm_init;;
esac

# init does SIGTERM on ctl.stop for service
trap "kill_hciattach" TERM INT

case $TRANSPORT in
    "smd")
        #echo 1 > /sys/module/hci_smd/parameters/hcismd_set
        setprop bluetooth.status on
     ;;
     *)
        logi "start hciattach"
        start_hciattach
        setprop bluetooth.status on

        wait $hciattach_pid
        logi "Bluetooth stopped"
     ;;
esac

exit 0


I found the following code line in/
Code: Select all
init.galbi.rc:service bt-sap /system/bin/sapd 15

 
Posts: 4043
Joined: Wed Mar 23, 2011 4:12 pm

Re: LG G3 D855 - VW Passat - RCD310 broken after ChupaChups

Post by admin » Mon Mar 02, 2015 5:24 pm

I guess you don't need the Bluetooth test. If sapd isn't running, you won't have rSAP. If it is running chances are very high that it will also work in the car. I managed to start sapd manually without any problems on a different phone where it was not started by the system, but I don't remember if it needed any command line parameters.

I don't think the 'ro.qualcomm.bluetooth.sap' property is the problem,

This won't be easy to fix... The best solution may be to compare all files of the system partition of Chupa Chups to the stock ROM which it is based on.

 
Posts: 5
Joined: Sat Feb 28, 2015 5:30 pm

Re: LG G3 D855 - VW Passat - RCD310 broken after ChupaChups

Post by JoeD » Tue Mar 03, 2015 10:57 am

I flashed a complete Stock ROM. There should be no files from ChupaChups Mod anymore.

I started the sapd by issuing as root
Code: Select all
start bt-sap

Then a sapd process can be found with ps.

But still no luck.

I created a logcat while trying to connect to the car. But it is very long and contains a lot of Phone Numbers from the VCards transfered.

There are some Profile Changes when connected to the car.
Changes are to Headset, A2DP and PBAP profile but never to the SAP profile.
Code: Select all
D/BluetoothAdapterService( 2872): [BTUI] processProfileStateChanged : profileId(1) state(2) [1:HEADSET, 2:A2DP, 3:HEALTH, 4:HID, 5:PAN, 6:PBAP, 8:GATT, 9:MAP, 10:FTP, 12:SAP, 20:HFPC]
D/BluetoothAdapterService( 2872): [BTUI] processProfileStateChanged : profileId(2) state(1) [1:HEADSET, 2:A2DP, 3:HEALTH, 4:HID, 5:PAN, 6:PBAP, 8:GATT, 9:MAP, 10:FTP, 12:SAP, 20:HFPC]
D/BluetoothAdapterService( 2872): [BTUI] processProfileStateChanged : profileId(2) state(2) [1:HEADSET, 2:A2DP, 3:HEALTH, 4:HID, 5:PAN, 6:PBAP, 8:GATT, 9:MAP, 10:FTP, 12:SAP, 20:HFPC]
D/BluetoothAdapterService( 2872): [BTUI] processProfileStateChanged : profileId(6) state(2) [1:HEADSET, 2:A2DP, 3:HEALTH, 4:HID, 5:PAN, 6:PBAP, 8:GATT, 9:MAP, 10:FTP, 12:SAP, 20:HFPC]
D/BluetoothAdapterService( 2872): [BTUI] processProfileStateChanged : profileId(6) state(0) [1:HEADSET, 2:A2DP, 3:HEALTH, 4:HID, 5:PAN, 6:PBAP, 8:GATT, 9:MAP, 10:FTP, 12:SAP, 20:HFPC]
D/BluetoothAdapterService( 2872): [BTUI] processProfileStateChanged : profileId(6) state(2) [1:HEADSET, 2:A2DP, 3:HEALTH, 4:HID, 5:PAN, 6:PBAP, 8:GATT, 9:MAP, 10:FTP, 12:SAP, 20:HFPC]


My best guess for now is that the car isn't asking for the SAP profile.

 
Posts: 4043
Joined: Wed Mar 23, 2011 4:12 pm

Re: LG G3 D855 - VW Passat - RCD310 broken after ChupaChups

Post by admin » Wed Mar 04, 2015 8:16 am

Maybe... You do have the VW "Premium" phone? In case of doubt look under the passenger seat - see also http://www.android-rsap.com/faq/107.html.

 
Posts: 5
Joined: Sat Feb 28, 2015 5:30 pm

Re: LG G3 D855 - VW Passat - RCD310 broken after ChupaChups

Post by JoeD » Sat Mar 07, 2015 11:18 am

I have the Premium phone. I also tried to reset it by pulling the connector for a few minutes. But no luck.

I found out my phone isn't advertising the SAP Profile.
I'm now digging through the config files and log's to find any reasons why my phone wont enable the sap profile

Bluetooth Info from my local Bluetooth device as it sees the phone from my wife and mine:
Code: Select all
[bluetooth]# info 50:55:27:6E:78:6C
Device 50:55:27:6E:78:6C
        Name: Andrea
        Alias: Andrea
        Class: 0x5e020c
        Icon: phone
        Paired: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: no
        UUID: OBEX Object Push          (00001105-0000-1000-8000-00805f9b34fb)
        UUID: OBEX File Transfer        (00001106-0000-1000-8000-00805f9b34fb)
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Headset AG                (00001112-0000-1000-8000-00805f9b34fb)
        UUID: PANU                      (00001115-0000-1000-8000-00805f9b34fb)
        UUID: NAP                       (00001116-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
        UUID: SIM Access                (0000112d-0000-1000-8000-00805f9b34fb)
        UUID: Phonebook Access Server   (0000112f-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: Message Access Server     (00001132-0000-1000-8000-00805f9b34fb)
[bluetooth]# info 34:4D:F7:AD:81:94
Device 34:4D:F7:AD:81:94
        Name: Johannes
        Alias: Johannes
        Class: 0x5e020c
        Icon: phone
        Paired: yes
        Trusted: yes
        Blocked: no
        Connected: no
        LegacyPairing: no
        UUID: OBEX Object Push          (00001105-0000-1000-8000-00805f9b34fb)
        UUID: OBEX File Transfer        (00001106-0000-1000-8000-00805f9b34fb)
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Headset AG                (00001112-0000-1000-8000-00805f9b34fb)
        UUID: NAP                       (00001116-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
        UUID: Phonebook Access Server   (0000112f-0000-1000-8000-00805f9b34fb)
        UUID: Message Access Server     (00001132-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        Modalias: bluetooth:v001Dp1200d1436
[bluetooth]#


In the file /init.galbi.bt_vendor.rc I found "on property:bluetooth.sap.status=running" But i don't know what it means.

Code: Select all
root@g3:/ # cat init.galbi.bt_vendor.rc  | grep sap -C10                       
    user root
    oneshot

service hciattach /system/bin/sh /system/etc/init.galbi.bt.sh
    class late_start
    user bluetooth
    group qcom_oncrpc bluetooth net_bt_admin
    disabled
    oneshot

on property:bluetooth.sap.status=running
    start bt-sap

on property:bluetooth.sap.status=stopped
    stop bt-sap

on property:bluetooth.hciattach=true
    start hciattach

on property:bluetooth.hciattach=false
    setprop bluetooth.status off

service hciattach_ath3k /system/bin/sh /system/etc/init.ath3k.bt.sh
     class late_start
     user bluetooth

 
Posts: 4043
Joined: Wed Mar 23, 2011 4:12 pm

Re: LG G3 D855 - VW Passat - RCD310 broken after ChupaChups

Post by admin » Sat Mar 07, 2015 2:29 pm

As far as I remember sapd also handles Bluetooth, so if it still isn't running you won't get rSAP. Sadly I don't understand Linux/Android startup, so I cannot help you.

 
Posts: 5
Joined: Sat Feb 28, 2015 5:30 pm

Re: LG G3 D855 - VW Passat - RCD310 broken after ChupaChups

Post by JoeD » Fri Apr 03, 2015 8:31 am

Hi,

I would like to let you know, I finnaly got rSAP working again.
The problem is, I'm not sure how. :?
In the LG PC Suite I clicked on the menu point to repair a broken update or something like this. This installed a complete Stock firmware. And the rSAP was working again.

I would like to show my gratitude. What would you like? I could buy your app, or do you have some sort of donation, or paypal?

Best regards

 
Posts: 4043
Joined: Wed Mar 23, 2011 4:12 pm

Re: LG G3 D855 - VW Passat - RCD310 broken after ChupaChups

Post by admin » Sun Apr 05, 2015 3:38 pm

If you like you can buy my app, or alternatively send me an Amazon gift card :D


Return to LG G2/G3

Who is online

Users browsing this forum: No registered users and 1 guest