Comments (3)
Finally! I have a fix for this!
I was testing mic functionality on sturgeon
and noticed that the logcat
shows some info regarding the audio hardware. Looking back at this issue I noticed that I didn't look into the logcat
output. Looking at this again, revealed that nothing related to audio hardware was showing up!
This made me think that the audio backend is using the default
libraries. On hybris devices the *.smelt.so
is preferred over *.default.so
. *.msm8226.so
is generally ignored. Looking at the libraries we can see that there are indeed two different audio.primary and audio.a2dp libraries.
root@smelt:/system/lib/hw# ls -la
drwxr-xr-x 2 root root 4096 Jan 31 13:59 .
drwxr-xr-x 4 root root 12288 Jan 23 18:29 ..
-rw-r--r-- 1 root root 22144 Jan 23 18:29 audio.a2dp.default.so
-rw-r--r-- 1 root root 34472 Jan 23 18:29 audio.a2dp.msm8226.so
-rw-r--r-- 1 root root 18048 Jan 23 18:29 audio.primary.default.so
-rw-r--r-- 1 root root 75012 Jan 23 18:29 audio.primary.msm8226.so
-rw-r--r-- 1 root root 91952 Jan 23 18:29 audio_policy.default.so
-rw-r--r-- 1 root root 1329828 Jan 23 18:29 bluetooth.default.so
-rw-r--r-- 1 root root 30336 Jan 23 18:29 copybit.msm8226.so
-rw-r--r-- 1 root root 22476 Jan 23 18:29 gralloc.default.so
-rw-r--r-- 1 root root 26772 Jan 23 18:29 gralloc.msm8226.so
lrwxrwxrwx 1 root root 55 Jan 23 18:29 gralloc.smelt.so -> /usr/libexec/hal-droid/system/lib/hw/gralloc.msm8226.so
-rw-r--r-- 1 root root 132816 Jan 23 18:29 hwcomposer.msm8226.so
lrwxrwxrwx 1 root root 58 Jan 23 18:29 hwcomposer.smelt.so -> /usr/libexec/hal-droid/system/lib/hw/hwcomposer.msm8226.so
-rw-r--r-- 1 root root 13872 Jan 23 18:29 keystore.default.so
-rw-r--r-- 1 root root 18048 Jan 23 18:29 lights.msm8226.so
-rw-r--r-- 1 root root 13952 Jan 23 18:29 local_time.default.so
-rw-r--r-- 1 root root 13972 Jan 23 18:29 memtrack.msm8226.so
lrwxrwxrwx 1 root root 56 Jan 23 18:29 memtrack.smelt.so -> /usr/libexec/hal-droid/system/lib/hw/memtrack.msm8226.so
-rw-r--r-- 1 root root 13964 Jan 23 18:29 power.default.so
-rw-r--r-- 1 root root 13964 Jan 23 18:29 power.smelt.so
-rw-r--r-- 1 root root 71360 Jan 23 18:29 sensors.smelt.so
So the first thing to do is symlink the audio.primary.smelt.so to audio.primary.msm8226.so. Followed by the audio.a2dp one.
And now we can see that something is happening in logcat
!
01-31 14:00:56.841 767 767 D audio_hw_primary: adev_open: enter
01-31 14:00:56.852 767 767 V msm8974_platform: platform_init: snd_card_name: msm8226-snd-card
01-31 14:00:56.852 767 767 V msm8974_platform: platform_is_i2s_ext_modem, is_i2s_ext_modem:0
01-31 14:00:56.874 767 767 D msm8974_platform: platform_init: Opened sound card:0
01-31 14:00:56.878 767 767 V msm8974_platform: platform_init: DLOPEN successful for libacdbloader.so
01-31 14:00:56.880 767 767 E ACDB-LOADER: ACDB -> No .acdb files found in /etc!
01-31 14:00:56.880 767 767 E ACDB-LOADER: ACDB -> Error: Could not open any directory! Failed for /etc
01-31 14:00:56.880 767 767 E ACDB-LOADER: ACDB -> Could not load .acdb files!
01-31 14:00:56.880 767 767 D platform_info: platform_info_init: Failed to open /system/etc/audio_platform_info.xml, using defaults.
01-31 14:00:56.880 767 767 V msm8974_platform: platform_send_audio_calibration: sending audio calibration for snd_device(65) acdb_id(34)
01-31 14:00:56.880 767 767 E ACDB-LOADER: ACDB -> Not correctly initialized!
01-31 14:00:56.901 767 767 D audio_hw_primary: out_set_parameters: enter: usecase(0: deep-buffer-playback) kvpairs: routing=2;
Though when recording still no sound is actually recorded, only complete silence. Now looking back into the pulseaudio
logs. The following line appears:
I: [pulseaudio] droid-source.c: Create new droid-source
I: [pulseaudio] droid-source.c: FIXME: Setting AUDIO_DEVICE_IN_BUILTIN_MIC as initial device.
D: [pulseaudio] droid-util.c: Set global input to AUDIO_DEVICE_IN_BUILTIN_MIC (0x80000004)
D: [pulseaudio] droid-util.c: set global audio source to mic (0x00000001)
D: [pulseaudio] droid-util.c: Fill config: Try to use format AUDIO_FORMAT_PCM_16_BIT, sample rate 44100
D: [pulseaudio] droid-util.c: Destroy input stream 0x9bb258
E: [pulseaudio] droid-source.c: Failed to open input stream.
I: [pulseaudio] card.c: Created 0 "droid_card.primary"
Failed to open input stream! pulse-audio-droid
actually configures the audio routing using a audio_policy.conf
config file:
D: [pulseaudio] config-parser-legacy.c: config: New module: primary
D: [pulseaudio] config-parser-legacy.c: config: primary: New output: primary
D: [pulseaudio] config-parser-legacy.c: config: primary: New input: primary
D: [pulseaudio] config-parser-legacy.c: config: New module: a2dp
D: [pulseaudio] config-parser-legacy.c: config: a2dp: New output: a2dp_primary
D: [pulseaudio] config-parser-legacy.c: config: a2dp: New output: a2dp_offload
I: [pulseaudio] config-parser-legacy.c: Parsed config file (/system/etc/audio_policy.conf): 2 modules.
I know that sturgeon
and smelt
are similar in hardware, so I just copied the audio_policy.conf
file from sturgeon
to smelt
. The log is different now:
I: [pulseaudio] droid-source.c: Create new droid-source
I: [pulseaudio] droid-source.c: FIXME: Setting AUDIO_DEVICE_IN_BUILTIN_MIC as initial device.
D: [pulseaudio] droid-util.c: Set global input to AUDIO_DEVICE_IN_BUILTIN_MIC (0x80000004)
D: [pulseaudio] droid-util.c: set global audio source to mic (0x00000001)
D: [pulseaudio] droid-util.c: Fill config: Try to use format AUDIO_FORMAT_PCM_16_BIT, sample rate 44100
I: [pulseaudio] droid-util.c: Trying to open input stream with device: 0x80000004 source: 0x00000001 flags: 0000000000 sample rate: 44100 (44100) channels: 1 (0x00000010) format: 3 (0x00000001) (return code 0)
I: [pulseaudio] droid-util.c: Opened input stream with device: 0x80000004 source: 0x00000001 flags: 0000000000 sample rate: 44100 (44100) channels: 1 (0x00000010) format: 3 (0x00000001) (return code 0)
D: [pulseaudio] droid-util.c: input stream 0x10593e0 set_parameters(routing=-2147483644;input_source=1) 0x80000004 ; 0x00000001
D: [pulseaudio] droid-util.c: Opened input stream 0x10593e0
I: [pulseaudio] droid-util.c: Set active input to 0x10593e0
D: [pulseaudio] droid-util.c: Ports for input: droid
D: [pulseaudio] droid-util.c: Port input-builtin_mic from cache
D: [pulseaudio] droid-util.c: Port input-default from cache
D: [pulseaudio] droid-util.c: Port input-parking from cache
I: [pulseaudio] source.c: Created source 1 "source.droid" with sample spec s16le 1ch 44100Hz and channel map mono
I: [pulseaudio] source.c: device.description = "Droid source droid"
I: [pulseaudio] source.c: device.class = "sound"
I: [pulseaudio] source.c: device.api = "droid-hal"
I: [pulseaudio] source.c: droid.input.external = "true"
I: [pulseaudio] source.c: droid.input.builtin = "true"
I: [pulseaudio] source.c: droid.hw_module = "primary"
I: [pulseaudio] source.c: device.icon_name = "audio-card"
I: [pulseaudio] droid-util.c: Module has HAL mic mute control.
I: [pulseaudio] droid-source.c: Using buffer size 1792.
D: [pulseaudio] droid-source.c: Set fixed latency 20317 usec
D: [pulseaudio] droid-source.c: Source set port 0x80000004
D: [pulseaudio] droid-util.c: input stream 0x10593e0 set_parameters(routing=-2147483644;input_source=1) 0x80000004 ; 0x00000001
I: [pulseaudio] droid-util.c: Set active input to (nil)
No more input stream failures. Testing the recording again confirms this, the microphone now works!
from meta-smartwatch.
ok, some more testing reveals that the reason it fails to open an input stream is due to a missing sample rate. Pulseaudio requests a sample rate of 44100, which doesn't exist in the factory images only 16000, 32000, 48000 are supported.
Adding the sample rates that sturgeon
provides fixes this issue (add 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000).
from meta-smartwatch.
Nice :)
from meta-smartwatch.
Related Issues (20)
- Change button mappings
- [pike] ADB/SSH do not work HOT 1
- [lenok] Watch wakes up on palm detect sensor HOT 2
- [sparrow] BT HCI device not showing - nightly possibly missing firmware? HOT 3
- [skipjack] WiFi needs a patch to run HOT 1
- [beluga] screen flickering HOT 7
- [sturgeon] Major lag all over the UI in 20230730 build HOT 2
- [harmony] touch input on homescreen is inverted and apps upside-down HOT 1
- [harmony] Stuck on reboot and power off.
- Support 64bit platforms with 32bit userspace HOT 1
- [anthias] Sensors do not work
- [anthias] Apps crash HOT 1
- [hoki] wifi support HOT 2
- [beluga] Incorrect device codename designation on web HOT 4
- [beluga] Documentation: Discrepancy between Hardware Support page and other sources regarding NFC support.
- [dace] TicWatch Pro 5 support HOT 2
- [Beluga/OW19W8] Oppo Watch Found Bugs/issues/missing software features on clean/default install HOT 6
- Confused with de-installation on Beluga / OW19W8 / Oppo Watch
- [lenok] Nightlies stuck at boot since 2024-02-16 HOT 1
- fastboot flash userdata failing with C++ error on asus zenwatch 2 sparrow HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meta-smartwatch.