megi's PinePhone Development Log RSS

+972

2021–11–20: Pinephone Pro – audio and modem power up support

I've added Pinephone Pro audio codec support to my kernel and did a quick test that it works. Everything except Bluetooth should work. Modem audio too. Compared to Pinebook Pro's 37 controls, the codec on Pinephone Pro has more than 3 times as many.

One other thing I enabled yesterday is support for powering up the modem using my modem power driver. Powering up the modem on my kernel is now as simple as on the original Pinephone:

echo 1 > /sys/class/modem-power/modem-power/device/powered

And the result will show up in dmesg:

[   87.347227] modem-power serial1-0: powering up
[   87.608383] modem-power serial1-0: wakeup ok
[   90.260373] modem-power serial1-0: status ok
[   90.260584] dw-apb-uart ff1b0000.serial: failed to request DMA
[   99.666364] usb 1-1: new high-speed USB device number 2 using ehci-platform
[   99.804639] usb 1-1: New USB device found, idVendor=2c7c, idProduct=0125, bcdDevice= 3.18
[   99.804662] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   99.804668] usb 1-1: Product: EG25-G
[   99.804673] usb 1-1: Manufacturer: Quectel
[   99.805882] option 1-1:1.0: GSM modem (1-port) converter detected
[   99.806238] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[   99.806602] option 1-1:1.1: GSM modem (1-port) converter detected
[   99.807004] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[   99.807496] option 1-1:1.2: GSM modem (1-port) converter detected
[   99.807836] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[   99.808301] option 1-1:1.3: GSM modem (1-port) converter detected
[   99.808686] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
[  103.302076] modem-power serial1-0: ===================================================
[  103.302099] modem-power serial1-0: Project Name: EG25G
[  103.302104] modem-power serial1-0: Project Rev : EG25GGBR07A08M2G_01.002.07
[  103.302108] modem-power serial1-0: Branch  Name: 9x07_R07_NEW
[  103.302112] modem-power serial1-0: Custom Name : STD
[  103.302116] modem-power serial1-0: Build   Date: 2020-06-13,09:14
[  103.302121] modem-power serial1-0: Version:  SBLR07EG25G01_1:37500: May 30 2
[  103.302125] modem-power serial1-0: Version:  TZR07A03: Dec  2 2019
[  103.302129] modem-power serial1-0: Version:  RPMR07A03_1:37500: Dec  2 2019
[  103.302133] modem-power serial1-0: ===================================================
[  103.326183] modem-power serial1-0: ADB KEY is '24774888' (you can use it to unlock ADB access to the modem, see https://xnux.eu/devices/feature/modem-pp.html)
[  104.358333] modem-power serial1-0: QDAI is '1,1,0,1,0,0,1,1'
[  104.365510] modem-power serial1-0: QCFG 'risignaltype' is '"physical"'
[  104.374031] modem-power serial1-0: QCFG 'urc/ri/ring' is '"pulse",1,1000,5000,"off",1'
[  104.382449] modem-power serial1-0: QCFG 'urc/ri/smsincoming' is '"pulse",1,1'
[  104.389571] modem-power serial1-0: QCFG 'urc/ri/other' is '"off",1,1'
[  104.396175] modem-power serial1-0: QCFG 'urc/ri/pin' is 'uart_ri'
[  104.401964] modem-power serial1-0: QCFG 'urc/delay' is '0'
[  104.408745] modem-power serial1-0: QCFG 'sleepind/level' is '0'
[  104.415852] modem-power serial1-0: QCFG 'wakeupin/level' is '0,0' (changing to '0')
[  104.448347] modem-power serial1-0: QCFG 'ApRstLevel' is '0'
[  104.456210] modem-power serial1-0: QCFG 'ModemRstLevel' is '0'
[  104.462069] modem-power serial1-0: QCFG 'apready' is '0,0,500'
[  104.469190] modem-power serial1-0: QCFG 'airplanecontrol' is '1,1'
[  104.478157] modem-power serial1-0: QCFG 'fast/poweroff' is '1'
[  104.486540] modem-power serial1-0: powered up in 17139 ms

If you want to make sense of the 124 controls that the codec exposes, you'll have to read the datasheet.

Most of the controls are muxes and switches. There are only about 5 volume controls exposed by ALSA.

Main codec is connected via analog path to the modem's external ALC5616 codec. If you want to be able to make calls with the modem, you'll need to configure this codec properly via AT+QDAI command. I have not done that yet, and my kernel still uses the QDAI value that works only on the original Pinephone.

There should be no „robotic voice“ issue while calling with Pinephone Pro, because there's no need to do a sample rate conversion between the modem and the SoC.