Still unsolved for me.
Details (analysis, learning)
- The phone is running pulseaudio in user mode, started via systemd, as seen by
systemctl --user status pulseaudio
.
- The pulseaudio source for regular sound can be found by
pacmd list-sources | grep -A11 'index: 2'
index: 2
name: <source.droid>
driver: <module-droid-card.c>
flags: HARDWARE HW_MUTE_CTRL DECIBEL_VOLUME
state: SUSPENDED
- However during a call all pulseaudio sources are suspended, as verified by
pacmd list-sources | grep 'state:'
- So for a regular run of the Jolla app “Audio recorder”, the source
source.droid
is active and thus command like pacmd set-source-volume source.droid 50000
will work, and will reduce the microphone sensitivity.
- The description of the used pulseaudio module from
https://github.com/mer-hybris/pulseaudio-modules-droid-jb2q
has a hint, it says that
When voicecall virtual profile is enabled, active droid-sink is internally switched to voicecall volume control mode. What this means is changing the sink volume or volume of normal streams connected to the sink do not change active voicecall volume.
- Used version and arguments of the module can be seen by
pacmd list-modules
:
index: 1
name: <module-droid-card>
argument: <rate=48000 quirks=+unload_call_exit,+audio_cal_wait,+no_hw_volume,+speaker_before_voice,+standby_set_route>
used: -1
load once: no
properties:
module.author = "Juho Hämäläinen"
module.description = "Droid card"
module.version = "14.2.94"
- During calls the pulseaudio card is set to profile
voicecall
and there is a virtual sink-input now, detectable with pacmd list-sink-inputs
:
1 sink input(s) available.
index: 17
driver: <module-meego-mainvolume.c>
flags: START_CORKED NO_REMAP NO_REMIX
state: CORKED
sink: 2 <sink.null>
volume: front-left: 48211 / 74% / -8,00 dB, front-right: 48211 / 74% / -8,00 dB
balance 0,00
muted: no
current latency: 0,00 ms
requested latency: n/a
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
resample method: speex-fixed-2
module: 5
properties:
media.name = "Virtual Stream for MainVolume Volume Control"
media.role = "phone"
policy.group = "internal"
policy.stream_flags = hex:00000000
module-stream-restore.id = "sink-input-by-media-role:phone"
- Using the hardware sound volume buttons, I can change the volume of this virtual sink-input, but I have yet to find a way to change the microphone sensitivity, it seems that this has to be done elsewhere and is not done in pulseaudio.
- In a search for where pulseaudio might get its idea of microphone sensitivity, I found the configuration that are read by
module-droid-card
:
- /vendor/etc/audio_policy_configuration.xml
- In a neigbouring file
/vendor/etc/audio_platform_info.xml
there is data about microphone sensitivity, but it is unclear who interprets this file.
- There is an official(?) repo for the Android port to the phone device-sony-pdx201/rootdir/vendor/etc at master · sonyxperiadev/device-sony-pdx201 · GitHub
- There are people developing a LineageOS port, which also have these files like GitHub - lineageos-on-pdx201/android_device_sony_pdx201
hypothesis
(Wild) hypothesis:
- It may make a difference at which sensitivity levels the phone is set to before flashing.
- It may make a difference when the phone is flashed because of the Android version on there. (I did flash the phone late and upgraded a lot of Android versions.)
Both could explain the difference some people are seeing with the same device.
Still puzzled, hints welcome.