File: q6voiced

package info (click to toggle)
qcom-phone-utils 0.4.4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 212 kB
  • sloc: sh: 441; ansic: 123; makefile: 14
file content (28 lines) | stat: -rwxr-xr-x 873 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# Wrapper script for q6voiced: this tries to guess the correct ALSA card and
# device IDs based on the main device-tree "compatible"

# shellcheck disable=SC2198
# This works as $@ is converted to a string by concatenating its components
if [ -z "$@" ]; then
    # Most devices use hw:0,4 for the voice call interface
    q6voice_card=0
    q6voice_device=4

    for _dt_compatible in $(tr '\0' ' ' < /proc/device-tree/compatible); do
        # Override the device ID only if/when needed
        case "$_dt_compatible" in
            "shift,axolotl")
                q6voice_device=12
                ;;
            "oneplus,enchilada"|"oneplus,fajita")
                q6voice_device=6
                ;;
        esac
    done

    /usr/libexec/q6voiced "hw:${q6voice_card},${q6voice_device}"
else
    # shellcheck disable=SC2068
    /usr/libexec/q6voiced $@
fi