Exemple #1
0
def sound_card(serial):
    try:
        adb_connection = Adb(serial=serial)
        api_level = adb_connection.get_prop(prop="ro.build.version.sdk")
        if (api_level < 26):
            card = adb_connection.parse_cmd_output("alsa_aplay_32 -l ")
        else:
            card = adb_connection.parse_cmd_output("alsa_aplay -l ")

        for line in card.splitlines():
            #print line
            search_obj = re.search("(.+): Speaker", line)
            if search_obj:
                rest, device = search_obj.group(1).split(",")
                device_name = re.search("\[(.+)\]", rest).group(1)
                print "Sound card present at", device, device_name
                return True
        else:
            raise Exception
    except Exception as e:
        print "[{0}] Failed to list sound card".format(serial)
        print e.message
        return False
Exemple #2
0
def check_avb_service(serial):
    adb_connection = Adb(serial=serial)
    return adb_connection.get_prop("init.svc.avbstreamhandler")
Exemple #3
0
def check_gptp_service(serial):
    adb_connection = Adb(serial=serial)
    if check_eavb_mode(serial=serial) == "m":
        return adb_connection.get_prop("init.svc.gptp_a")
    else:
        return adb_connection.get_prop("init.svc.gptp_as")
Exemple #4
0
def check_gptp_automotive_profile(serial):
    adb_connection = Adb(serial=serial)
    return adb_connection.get_prop("persist.gptp.automotive_profile")
Exemple #5
0
def check_eavb_mode(serial):
    adb_connection = Adb(serial=serial)
    return adb_connection.get_prop("persist.eavb.mode")