Giter VIP home page Giter VIP logo

duhow / xiaoai-patch Goto Github PK

View Code? Open in Web Editor NEW
147.0 13.0 24.0 18.16 MB

Patching for XiaoAi Speakers, add custom binaries and open source software. Tested on LX06, LX01, LX05, L09A

License: GNU General Public License v3.0

Makefile 58.02% Shell 24.01% Python 11.41% Dockerfile 0.30% C 6.25%
xiaoai mico alexa speaker lx06 xiaoai-speaker personal-assistant voice-assistant hardware custom-firmware

xiaoai-patch's Introduction

XiaoAi Speakers


Introduction

This repo contains custom scripts and patches, to make a custom rootfs image free of propietary software, and installing open source programs.
Patches and scripts can be tweaked, so if really want, you can keep the original functions of the Chinese XiaoAi assistant, and install new programs as well.

The main purpose of this toolset is to have your DIY Voice Assistant (Alexa-like) and Smart Speaker, with lots of integrations for music and automation.

By using MPD, Snapcast, Shairport-Sync, Upmpdcli you can make your speaker a full media player compatible with multiple cast protocols, and also have a voice assistant powered by Porcupine and Whisper that can interact with your Home Assistant.
Everything powered by Open Source Software!

Compatibility

Model Name Target version (recommended)
LX06 - supported Xiaoai Speaker Pro (black, infrared) 1.74.10
L06A - supported Xiaoai Speaker (white, no infrared) 1.74.10 (build as LX06)
LX01 - supported Xiaomi Mi AI Speaker Mini 1.32.6
L09A - supported Xiaoai Speaker Art (China, white) 1.76.4
L09B - supported Xiaoai Speaker Art Battery (Black)
L09G - not supported Xiaomi Mi Smart Speaker (Global, Google Assistant)
LX05 - encrypted, supported Xiaoai Speaker Play
L05B - not supported Xiaoai Speaker Play Enhanced Edition, no Clock LED (NuttX) - details
L05C - not supported Xiaoai Speaker Play Enhanced Edition, with Clock LED (NuttX)
L05G - not supported Xiaomi Smart Speaker IR Control (Global, Google Assistant)
L15A - encrypted, not fully supported Xiaomi Mi AI Speaker 2 Gen
L16A - not tested Xiaomi Sound by HARMAN AudioEFX
L07A - not tested Redmi XiaoAI Speaker Play
M03A - not tested Xiaomi Sound Move
MDZ-25-DT - not tested Xiaomi Mi AI Speaker 1 Gen (?) - S12
XMYX01JY - not tested Xiaomi XiaoAI HD
YLAI01YL - blocked (not tested) Yeelight Voice Control Assistant

Tip

Target version is the recommended version to ensure all patches are working, but other versions may be still supported and working.
๐Ÿ”ง This is still Work in Progress.

โš ๏ธ Encrypted speaker partitions

Some new speakers or firmware upgrades change the rootfs partition and include a DER certificate to verify the system. This may block any changes on non-signed squashfs. Recommended to NOT flash, you may have an invalid rootfs and potentially lock yourself! You can check this by running binwalk if it contains a Certificate entry:

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             Squashfs filesystem, little endian, version 4.0, compression:xz, size: 32240378 bytes,
                              2430 inodes, blocksize: 262144 bytes, created: 2021-04-28 06:34:34
32243716      0x1EC0004       Certificate in DER format (x509 v3), header length: 4, sequence length: 830

Requirements

Warning

Supported and Tested setup is Linux OS with amd64 arch. Other hosts (Apple M1, Windows) are not tested nor supported. Feel free to make a PR if you have a fix for this.

Important

If using WSL, be sure to enable setCaseSensitiveInfo.

You will also need the following tools:

  • squashfs-tools, provides unsquashfs and mksquashfs
  • mtd-utils (Only for model S12), provides utils for UBI images
  • make
  • rsync
  • shasum
  • Docker
  • patience - package build takes more than 1 hour. :)

Usage

Get a copy of your rootfs filesystem from your speaker. It can also be from a system upgrade file. It should be something similar as this:

nc -vlp 8888 > $HOME/backup-image
# -----
dd if=/dev/mtd4 of=/tmp/image
nc $IP_ADDR 8888 < /tmp/image

Since the speakers filesystem is read-only format, we have to reflash it to add the new applications and patches. There are three steps to perform this: extract, patch, build.

Optionally but recommended, prepare the packages you want to install by editing the packages.sh script.

Build the docker image and run it to build all the packages. Probably it will take more than an hour.

Caution

Run the build packages.sh process with Docker, since the package build performs some patching to the system, otherwise it could harm your GNU/Linux installation.

docker build -t xiaoai-patch packages
docker run -it -v $PWD:/xiaoai xiaoai-patch

You can now run the commands to prepare the new image.

sudo make clean
sudo make extract FILE=image-mtd4
sudo make patch MODEL=lx06
sudo make build MODEL=lx06

# or all at once :)
sudo make clean all FILE=image-mtd4 MODEL=lx06

Tip

Ensure the image format is correct, by comparing the original and new images. Use file or other commands to check info.

After you have the new image ready, send it to the speaker, and flash the not-in-use rootfs partition, boot it and test.

โš ๏ธ Unbricking

You should have some wires soldered to the board to perform TTL in case it is required.
As long as you perform steps as described and not flashing content in wrong partitions, you can reverse failed boot with Uboot safely.

In order to enable Uboot menu, check in the environment partition that you have the setting bootdelay=3.
If is set to bootdelay=0 then Uboot will continue normal boot process and you won't be able to stop it unless you get into fastboot or recovery mode. (?)
In most cases, binary program is fw_setenv or fw_env and data is set into first partition as string.

Ensure you can access Uboot before writing changes, it is your rescue!

Hit any key to stop autoboot:  0

DISCLAIMER

YOU are responsible for any use or damage this software may cause. This repo and its content is intended for educational purposes only. Use at your own risk.

xiaoai-patch's People

Contributors

danielk117 avatar duhow avatar hillbicks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xiaoai-patch's Issues

AS05G

I recently bought the new xioami smart speaker with ir controll, which is a google home device, features the same clock as the L05C(?).
I couldn't make out any uart rx/tx pads. The processor is a Amlogic A113X Quad-core ARM Cortex-A53. My guess it's running some version of android and the desoldered micro-usb plug could be used to get adb running, this being only whild guesses as the echo 2nd gen is featuring a similar amlogic processor running android 5/6. Has anyone else taken a look at it yet?

L09A - Xiaoai Speaker Art

To add more details on L09A Xiaoai Speaker Art which speaks in chinese.
Model number: L09A
Firmware Version: 1.64.4 updated to 1.68.1
Boot:
boot.txt
If failed to boot several times rolls back to 1.64.4 which doesn't need magic number to log in

Question about the fallback partition on LX06

Hey guys,

since I was not successful with the L09, I got my hands on an LX06. With the LX06 I was able to solder the UART, get the shell working, generate the root password from S/N with the help of the html file. So far so good. Here is where it gets interesting though.

default boot_part is boot0, using mtdblock2 and mtdblock4 for system0. But both mtdblock3 for boot1 and mtdblock5 for system1 were completely empty. I confirmed it via xxd, but images only contained FF. So before flashing the patched image I thought I would clone mtd2 to mtd3 and mtd4 to mtd5 and see if I can boot from the other partition. Unfortunately, this doesn't work. If I stop uboot, set boot_part to boot1, I can see this error message and mtd4 is booted again.

NAND bbt detect factory Bad block at 6000000
aml_nand_add_partition:1794 factory bad addr=300
ERROR: image is not a fdt - must RESET the board to recover.

I used dd to clone both mtd2 and mtd4 to their respective counterparts via dd with bs=4096. I was expecting this to work and am currently struggling to understand what exactly is wrong here. What I also don't get: Why were both fallback partitions empty to begin with. I also tried a factory reset in between, the error message remains.

Anybody got an idea what the problem is? Any hints would be appreciated. I can provide the full boot log if needed, for some reason github doesn't want to format it.

Thanks!

Trying on L09b Xiaoai Art Battery

Hello everyone,

I bought a l09b (Think thats the second version of L09a) and managed to get into the speaker over serial and flashed the firmware of the l09a. The Firmwareversion is 1.48.10.

With only ssh patch activated I get into it with ssh over the created hotspot of the speaker.

When using 96_compact_libs.sh or some of the other lib scripts, wifi stop working and bluetooth gets me an error.

Wifi:

error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
micocfg_default_volume_absolute: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
wpa_cli
wpa_cli v2.7-devel
Copyright (c) 2004-2017, Jouni Malinen <[email protected]> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.



Interactive mode

Could not connect to wpa_supplicant: (nil) - re-trying

Bluetooth:

bluetoothctl: error while loading shared libraries: libgthread-2.0.so.0: cannot open shared object file: No such file or directory

Without the lib scripts wifi is working. Bluetooth not, but then without error.
The Buttons on the top also didnt work for me.

Tried the 1.69.54 which is the newest firmware, but this also didnt work for me. You can download the firmware here: https://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/l09b/mico_firmware_8cdd1_1.69.54.bin

I hope someone can help :)

l09b_board

monitor.sh install is broken

While going through the packages, I saw that you already build monitor.sh as one of the packages. Unfortunately, this script currently doesn't work.

  1. The symlinks for /usr/bin/monitor.sh /usr/share/monitor.sh both point to /usr/share/monitor/monitor.sh, but the actual script resides in /usr/share/monitor.sh/monitor.sh. The directory is missing the .sh

I would have created a pull request for this, but even with this fix, this script needs a lot of overhaul to work. A lot of binaries missing, invalid options, errors due to ro FS

Couple of things that are obvious and can be removed immediately, but it wouldn't be compatible with upstream anymore. (not without major checks at least). I'll have a look over the weekeend and see if I make some dirty changes to get it running on my box at least, no promises though.

/usr/share/monitor.sh/monitor.sh: line 49: git: command not found
/usr/share/monitor.sh/monitor.sh: line 64: ./support/argv: No such file or directory
/usr/share/monitor.sh/monitor.sh: line 65: ./support/init: No such file or directory
/usr/share/monitor.sh/monitor.sh: line 68: ./support/mqtt: No such file or directory
/usr/share/monitor.sh/monitor.sh: line 69: ./support/log: No such file or directory
/usr/share/monitor.sh/monitor.sh: line 70: ./support/data: No such file or directory
/usr/share/monitor.sh/monitor.sh: line 71: ./support/btle: No such file or directory
/usr/share/monitor.sh/monitor.sh: line 72: ./support/time: No such file or directory
pidof: invalid option -- 'x'
BusyBox v1.32.1 (2021-07-20 11:36:17 CEST) multi-call binary.

Usage: pidof [OPTIONS] [NAME]...

List PIDs of all processes with names that match NAMEs

        -s      Show only one PID
        -o PID  Omit given pid
                Use %PPID to omit pid of pidof's parent
mkfifo: main_pipe: Read-only file system
mkfifo: log_pipe: Read-only file system
mkfifo: packet_pipe: Read-only file system
/usr/share/monitor.sh/monitor.sh: line 150: /dev/fd/63: No such file or directory
/usr/share/monitor.sh/monitor.sh: line 151: /dev/fd/63: No such file or directory
/usr/share/monitor.sh/monitor.sh: line 150: : No such file or directory
/usr/share/monitor.sh/monitor.sh: line 152: /dev/fd/63: No such file or directory
/usr/share/monitor.sh/monitor.sh: line 151: : No such file or directory
/usr/share/monitor.sh/monitor.sh: line 152: : No such file or directory
rm: can't remove '.pids': No such file or directory
/usr/share/monitor.sh/monitor.sh: line 821: log_listener: command not found
/usr/share/monitor.sh/monitor.sh: line 823: .pids: Read-only file system
> log listener pid = 2001
/usr/share/monitor.sh/monitor.sh: line 827: btle_scanner: command not found
/usr/share/monitor.sh/monitor.sh: line 829: .pids: Read-only file system
> btle scan pid = 2002
/usr/share/monitor.sh/monitor.sh: line 833: btle_text_listener: command not found
/usr/share/monitor.sh/monitor.sh: line 835: .pids: Read-only file system
> btle text pid = 2003
/usr/share/monitor.sh/monitor.sh: line 839: btle_listener: command not found
/usr/share/monitor.sh/monitor.sh: line 841: .pids: Read-only file system
> btle listener pid = 2004
/usr/share/monitor.sh/monitor.sh: line 847: .pids: Read-only file system
/usr/share/monitor.sh/monitor.sh: line 845: mqtt_listener: command not found
> mqtt listener pid = 2005
/usr/share/monitor.sh/monitor.sh: line 853: .pids: Read-only file system
/usr/share/monitor.sh/monitor.sh: line 851: btle_packet_listener: command not found
> packet listener pid = 2006
/usr/share/monitor.sh/monitor.sh: line 859: .pids: Read-only file system
/usr/share/monitor.sh/monitor.sh: line 857: beacon_database_expiration_trigger: command not found
> beacon database time trigger pid = 2007
/usr/share/monitor.sh/monitor.sh: line 1990: main_pipe: No such file or directory
/usr/share/monitor.sh/monitor.sh: line 1987: [: : integer expression expected

support on arm64 host?

Thanks for the creative project!

Would you please also support the building env on arm64 machine? for instance I'd like to do the patch in a virtual machine of macOS M1. seems the host toolchain is for x86_64 only, it would be nice if aarch64 host is supported too.

Requirements for new packages

Since I ordered a couple more smart speakers for around the house, it was time for me to look at the multiroom audio solution again. Currently I'm using snapcast for two speakers and while the sync is fantastic, the usability and compatibility with home assistant and automations leaves a lot to desire imho. I want to test out Logitech media server again. The sync is not as perfect as snapcast, but it is way easier to handle I think.

For that, I would need to build the squeezelite package into the image of course and if I'm doing that, it would make sense to provide the package.mk file to this project. Dependency wise it seems we're only missing libsoxr, everything else is already there judging from the AUR package from arch

I would probably use the snapcast package as a template and modify it for the squeezelite packages. I haven't looked at the contents for libsoxr yet, but one the other lib* packages should be provide a template as well.

Any requirements from your side for the do's and don'ts of a new package? Could be a good exercise for any additional packages that might come in the future.

[Workaround] hardcoded wifi mac address is used for LX01

The image for the LX01 includes the firmware files nv_43436p.txt and nv_43438a1.txt. These include a hardcoded mac address for wifi, not sure what the reason is for that. I haven't looked that much into it, just encountered the behavior yesterday and thought I share my findings. Both files include

macaddr=00:90:4c:c5:12:38
il0macaddr=00:90:4c:c5:12:38

If you search the internet for this mac address, there are a quite a few results for it. Anyway, using the hardcoded mac of course leads to problems when you have more than one LX01 in your network. (duplicate IP address for all devices with this mac).

I created a script, well adapted really, from this site, which changes the mac address in both files to a random one. Thought I'd share in case anyone else runs into the same problem.

28_generate_wifi_mac.sh in scripts

#!/bin/sh

nv_43438a1=$ROOTFS/lib/firmware/nv_43438a1.txt
nv_43436p=$ROOTFS/lib/firmware/nv_43436p.txt
echo "[*] Updating wifi mac address"
new_mac=$(printf '00:90:4c:%02x:%02x:%02x\n' $[RANDOM%256] $[RANDOM%256] $[RANDOM%256])

sed -i "s/macaddr=.*/macaddr=${new_mac}/" ${nv_43438a1}
sed -i "s/macaddr=.*/macaddr=${new_mac}/" ${nv_43436p}

sed -i "s/il0macaddr=.*/il0macaddr=${new_mac}/" ${nv_43438a1}
sed -i "s/il0macaddr=.*/il0macaddr=${new_mac}/" ${nv_43436p}

chmod 755 $nv_43438a1 $nv_43436p
chown root:root $nv_43438a1 $nv_43436p

Does it add snapcast functionality for Xioai device?

Hey David,

hope you don't mind that I open an issue to ask you question. I saw your comment on one of the snapcast issues.

I wasn't sure whether I understood your comment correctly. Is this patch really adding snapcast functionality (amongst other things) to the xioaAI device? Meaning, a standalone speaker that can act as a snapcast client? I would appreciate it, if you can elaborate a bit.

If that is really the case, that would be huge imho. Looking forward to your answer!

Thanks and BR

`porcupine_launcher` does not work with recent Home Assistant

Issue

porcupine_launcher does not play well with recent Home Assistant.

Environment

  • Home Assistant 2023.9.0
  • Xiaomi LX06 1.74.10

Expected behavior

porcupine_launcher listens to my command and plays command response from Home Assistant via TTS

Actual behavior

porcupine_launcher repeats my voice command and command does not execute at all.

Proposed fix

diff --git a/packages/porcupine/config/launcher b/packages/porcupine/config/launcher
index 935d168..85be56b 100755
--- a/packages/porcupine/config/launcher
+++ b/packages/porcupine/config/launcher
@@ -107,12 +107,13 @@ if [ -n "${STT_SUCCESS}" ]; then
   # cleanup text before sending
   STT_TEXT=$(jq -r .text ${DATA_STT} | tr -d '.' | awk '{$1=$1;print}')
   log "$STT_TEXT"
-  curl \
+  PROCESS_RESULT=$(curl \
      -H "Authorization: Bearer ${HA_TOKEN}" \
      -H "Content-Type: application/json" \
      -d "{\"language\": \"${STT_LANGUAGE}\", \"text\": \"${STT_TEXT}\"}" \
-     -XPOST ${HA_URL}/api/services/conversation/process
-  ${SPEAK} "${STT_TEXT}"
+     -XPOST ${HA_URL}/api/conversation/process)
+  TTS_TEXT=$(echo "${PROCESS_RESULT}" | jq -r .response.speech.plain.speech)
+  ${SPEAK} "${TTS_TEXT}"
 else
   log "error"
   ${SPEAK} error

wget2: certificate verify failed

wget2 throws some errors about unknown config keys and certificate verify failed. I'm not able to download files over https.

In the docker package installation, I've changed the build for wget2 from latest to 1.99.2 (because of an build error). Might be a reason for the following error.

root@LX06-9341:/tmp# date
Sun Jan 16 22:17:41 +01 2022
root@LX06-9341:/tmp# wget https://www.dreamweaver.at/music-free/dreamweaver_-_Inspiring-Guitar-Song_01.mp3
Unknown configuration key 22 (maybe this config value should be of another type?)
Unknown configuration key 21 (maybe this config value should be of another type?)
Could not complete TLS handshake: certificate verify failed
Failed to connect: Certificate error
Failed to open tmpfile '/root/.local/share/wget/.wget-ocsp_hostsAMiolM' (2)
Failed to write to OCSP hosts to '/root/.local/share/wget/.wget-ocsp_hosts'
Failed to open tmpfile '/root/.local/share/wget/.wget-ocspGOxKvo' (2)
Failed to write to OCSP fingerprints to '/root/.local/share/wget/.wget-ocsp'

details on #20 (comment)

toolchain might be better to use armv8l instead of armv7a

As I knew, on the same armv8 hardware, it'd be armv8l if kernel running in 64bit with 32bit sysroot(for userspace), and be armv7l if kernel in 32bit with 32bit sysroot.

Maybe I was wrong, but I checked in rokid projects for Amlogic a113x it was using armv8l gcc. btw, take a look on rokid yodaos, really interesting..

L09G

Hi,

I recently got my hands on a L09G and started poking around using the informations available in issue #1 and the research folder.

I managed to connect an USB stick to the board by soldering to the test pins on the underside of the board. Running usb start recognises the connected usb stick:

axg_s420_v1_gva#usb start
(Re)start USB...
USB0:   USB3.0 XHCI init start
Register 1000140 NbrPorts 1
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... init_part() 282: PART_TYPE_DOS
1 Storage Device(s) found

I tried both fatinfo and fatls to confirm, that the USB stick can be accessed correcty:

axg_s420_v1_gva#fatinfo usb 0
Interface:  USB
  Device 0: Vendor: VendorCo Rev: 2.00 Prod: ProductCode
            Type: Removable Hard Disk
            Capacity: 3840.0 MB = 3.7 GB (7864320 x 512)
Filesystem: FAT32 "NO NAME    "
axg_s420_v1_gva#
axg_s420_v1_gva#
axg_s420_v1_gva#
axg_s420_v1_gva#fatls usb 0
  5570560   DSC02072.JPG
            System Volume Information/

1 file(s), 1 dir(s)

But now I have no idea how to continue. Can I dump the flash to the USB stick? Or can I flash a modified firmware from the USB stick?

KInd regards
Mario

libmad build fails

While trying to get the squeezelite package to build, I saw that libmad is not actually build with the default packages. Trying to build it, fails at the moment. It seems the libmad package doesn't have support for newer arm architecture (no surprise there I guess).

/tmp/ccAIzqCy.s: Assembler messages:
/tmp/ccAIzqCy.s:1378: Error: selected processor does not support `rsc lr,lr,#0' in Thumb mode
/tmp/ccAIzqCy.s:1546: Error: selected processor does not support `rsc r9,r9,#0' in Thumb mode
/tmp/ccAIzqCy.s:2044: Error: selected processor does not support `rsc lr,lr,#0' in Thumb mode
/tmp/ccAIzqCy.s:2206: Error: selected processor does not support `rsc lr,lr,#0' in Thumb mode

There are patches available for arch arm arch arm and debian

I haven't been able to successfully apply the arch arm patch yet (or rather successfully build libmad), I'll give it another shot later. Also, I'm not entirely sure how to best proceed here. Might be easier to use the arch arm package as the source directly instead of the sourceforge one.

Build for package 'sndio' not completed

I try to run docker, wait for a long time. Then got this error...
Seems https://github.com/ratchov/sndio/archive/refs/tags/release_1_8_1.tar.gz is unavailable any more.
Is there any alternative link? Thank you.

Entering build for package 'sndio'
Entering directory /xiaoai/build-packages/src/sndio...
Downloading package source...
--2022-10-18 16:02:59-- https://github.com/ratchov/sndio/archive/refs/tags/release_1_8_1.tar.gz
Resolving github.com (github.com)... 20.27.177.113
Connecting to github.com (github.com)|20.27.177.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/ratchov/sndio/tar.gz/refs/tags/release_1_8_1 [following]
--2022-10-18 16:03:00-- https://codeload.github.com/ratchov/sndio/tar.gz/refs/tags/release_1_8_1
Resolving codeload.github.com (codeload.github.com)... 20.27.177.114
Connecting to codeload.github.com (codeload.github.com)|20.27.177.114|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-10-18 16:03:00 ERROR 404: Not Found.

Build for package 'sndio' not completed

LX06 network configuration

does anybody knows how to connect to my network via cli on LX06? i cant configure it via official app Mi Home do i need to use chines version?

Best Regards,
Kristijan

Docker container exits with error "Build for package 'glibc' not completed"

Thanks a lot David for this awesome project!

I am trying to create an image now for my L09A and am runnining in to the following issue. I have downloaded the git structure to my windows computer and created a docker image and a container with Docker Desktop. When I try to run the container it exits after about 20 mins with the error in the issue title. I have included an excerpt from the logs that might help narrowing down the issue:

2023-02-10 15:54:12
2023-02-10 15:54:12 Host arch : x86_64
2023-02-10 15:54:12 Target arch : armv7
2023-02-10 15:54:12 Model detected :
2023-02-10 15:54:12 Prefix : /usr
2023-02-10 15:54:12 Make concurrency : 8
2023-02-10 15:54:12
2023-02-10 15:54:12 Note: Prefix will be the path to all binaries in target device
2023-02-10 15:54:12
2023-02-10 15:54:12 tput: No value for $TERM and no -T specified
2023-02-10 15:54:12 tput: No value for $TERM and no -T specified
2023-02-10 15:54:12 Try 'timeout --help' for more information.
2023-02-10 15:54:13 Entering build for package 'toolchain'
2023-02-10 15:54:13 Entering directory /xiaoai/build-packages/src/toolchain...
2023-02-10 15:54:13 Entering directory /xiaoai/build-packages/build/armv7/toolchain...
2023-02-10 15:54:14 Generated: /xiaoai/build-packages/build/armv7/toolchain/config/cmake-toolchain.txt
2023-02-10 15:54:14 Generated: /xiaoai/build-packages/build/armv7/toolchain/config/cmake-toolchain-sysroot.txt
2023-02-10 15:54:14 Generated: /xiaoai/build-packages/build/armv7/toolchain/config/meson-cross-file.txt
2023-02-10 15:54:14 tput: No value for $TERM and no -T specified
2023-02-10 15:54:14
2023-02-10 15:54:14 TOOLCHAIN_DIR="/xiaoai/build-packages/build/armv7/toolchain"
2023-02-10 15:54:14 BUILD_TARGET="arm-linux-gnueabihf"
2023-02-10 15:54:14 BUILD_CC="/xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-gcc"
2023-02-10 15:54:14 BUILD_CXX="/xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-g++"
2023-02-10 15:54:14 BUILD_AR="/xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-ar"
2023-02-10 15:54:14 BUILD_RANLIB="/xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-ranlib"
2023-02-10 15:54:14 BUILD_OBJCOPY="/xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-objcopy"
2023-02-10 15:54:14 BUILD_STRIP="/xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-strip"
2023-02-10 15:54:14 BUILD_CFLAGS="-I/xiaoai/build-packages/staging/armv7//usr/include -Os"
2023-02-10 15:54:14 BUILD_LDFLAGS="-L/xiaoai/build-packages/staging/armv7/lib -L/xiaoai/build-packages/staging/armv7//usr/lib -Wl,--rpath-link=/xiaoai/build-packages/staging/armv7//usr/lib -Wl,--rpath-link=/xiaoai/build-packages/staging/armv7//usr/lib/pulseaudio -Wl,--rpath-link=/xiaoai/build-packages/staging/armv7//usr/lib/private -Wl,--rpath=/usr/arm-linux-gnueabihf/lib -Wl,--rpath=/usr/lib -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3 -Os"
2023-02-10 15:54:14 BUILD_PKG_CONFIG_LIBDIR="/xiaoai/build-packages/staging/armv7//usr/lib/pkgconfig"
2023-02-10 15:54:14 BUILD_PKG_CONFIG_SYSROOT_DIR="/xiaoai/build-packages/staging/armv7"
2023-02-10 15:54:14 PATH="/xiaoai/build-packages/build/armv7/toolchain/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
2023-02-10 15:54:14 TOOLCHAIN_CMAKE="/xiaoai/build-packages/build/armv7/toolchain/config/cmake-toolchain.txt"
2023-02-10 15:54:14
2023-02-10 15:54:14 tput: No value for $TERM and no -T specified
2023-02-10 15:54:14 Leaving build for package 'toolchain'
2023-02-10 15:54:14 Entering build for package 'glibc'
2023-02-10 15:54:14 Entering directory /xiaoai/build-packages/src/glibc...
2023-02-10 15:55:18 Using cached download
2023-02-10 15:55:18 Unpacking /xiaoai/build-packages/src/glibc/glibc-2.27.tar.gz...
2023-02-10 15:56:58 Entering directory /xiaoai/build-packages/build/armv7/glibc-build...
2023-02-10 15:56:58 Entering configure_package...
2023-02-10 15:56:59 checking build system type... x86_64-pc-linux-gnu
2023-02-10 15:56:59 checking host system type... arm-unknown-linux-gnueabihf
2023-02-10 15:56:59 checking for arm-linux-gnueabihf-gcc... /xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-gcc
2023-02-10 15:57:06 checking for suffix of object files... o
2023-02-10 15:57:07 checking whether we are using the GNU C compiler... yes
2023-02-10 15:57:08 checking whether /xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-gcc accepts -g... yes
2023-02-10 15:57:08 checking for gcc... gcc
2023-02-10 15:57:08 checking for arm-linux-gnueabihf-readelf... arm-linux-gnueabihf-readelf
2023-02-10 15:57:08 checking for arm-linux-gnueabihf-g++... arm-linux-gnueabihf-g++
2023-02-10 15:57:12 checking whether we are using the GNU C++ compiler... yes
2023-02-10 15:57:12 checking whether arm-linux-gnueabihf-g++ accepts -g... yes
2023-02-10 15:57:38 checking whether arm-linux-gnueabihf-g++ can link programs... yes
2023-02-10 15:57:38 checking for sysdeps preconfigure fragments... aarch64 alpha arm configure: Found compiler is configured for armv7
2023-02-10 15:57:38 hppa i386 m68k microblaze mips nios2 powerpc riscv s390 sh sparc tile x86_64
2023-02-10 15:57:39 checking for use of fpu sysdeps directories... yes
2023-02-10 15:57:39 checking for -fstack-protector... yes
2023-02-10 15:57:40 checking for -fstack-protector-strong... yes
2023-02-10 15:57:40 checking for -fstack-protector-all... yes
2023-02-10 15:57:41 checking for assembler and linker STT_GNU_IFUNC support... yes
2023-02-10 15:57:42 checking for gcc attribute ifunc support... yes
2023-02-10 15:57:43 checking if compiler warns about alias for function with incompatible types... no
2023-02-10 15:57:44 checking sysdep dirs... sysdeps/unix/sysv/linux/arm sysdeps/arm/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/arm sysdeps/unix sysdeps/posix sysdeps/arm/armv7/multiarch sysdeps/arm/armv7 sysdeps/arm/armv6t2 sysdeps/arm/armv6 sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic
2023-02-10 15:57:44 checking for a BSD-compatible install... /usr/bin/install -c
2023-02-10 15:57:44 checking whether ln -s works... yes
2023-02-10 15:57:45 checking whether /xiaoai/build-packages/build/armv7/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/bin/as is GNU as... yes
2023-02-10 15:57:45 checking whether /xiaoai/build-packages/build/armv7/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/bin/ld is GNU ld... yes
2023-02-10 15:57:45 checking for /xiaoai/build-packages/build/armv7/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/bin/as... /xiaoai/build-packages/build/armv7/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/bin/as
2023-02-10 15:57:45 checking version of /xiaoai/build-packages/build/armv7/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/bin/as... 2.28.2.20170706, ok
2023-02-10 15:57:45 checking for /xiaoai/build-packages/build/armv7/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/bin/ld... /xiaoai/build-packages/build/armv7/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/bin/ld
2023-02-10 15:57:45 checking version of /xiaoai/build-packages/build/armv7/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/../../../../arm-linux-gnueabihf/bin/ld... 2.28.2.20170706, ok
2023-02-10 15:57:45 checking for gnumake... no
2023-02-10 15:57:45 checking for gmake... no
2023-02-10 15:57:45 checking for make... make
2023-02-10 15:57:45 checking version of make... 4.2.1, ok
2023-02-10 15:57:45 checking for gnumsgfmt... no
2023-02-10 15:57:45 checking for gmsgfmt... no
2023-02-10 15:57:45 checking for msgfmt... msgfmt
2023-02-10 15:57:45 checking version of msgfmt... 0.19.8.1, ok
2023-02-10 15:57:45 checking for makeinfo... makeinfo
2023-02-10 15:57:45 checking version of makeinfo... 6.7, ok
2023-02-10 15:57:45 checking for sed... sed
2023-02-10 15:57:45 checking version of sed... 4.7, ok
2023-02-10 15:57:45 checking for gawk... gawk
2023-02-10 15:57:45 checking version of gawk... 5.0.1, ok
2023-02-10 15:57:45 checking for bison... bison
2023-02-10 15:57:45 checking version of bison... 3.5.1, ok
2023-02-10 15:57:46 checking if /xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-gcc is sufficient to build libc... yes
2023-02-10 15:57:46 checking for arm-linux-gnueabihf-nm... arm-linux-gnueabihf-nm
2023-02-10 15:57:46 checking for python3... python3
2023-02-10 15:58:04 checking LD_LIBRARY_PATH variable... ok
2023-02-10 15:58:04 checking for bash... /usr/bin/bash
2023-02-10 15:58:04 checking for perl... /usr/bin/perl
2023-02-10 15:58:04 checking for install-info... no
2023-02-10 15:58:05 checking for .set assembler directive... yes
2023-02-10 15:58:07 checking linker support for protected data symbol... yes
2023-02-10 15:58:08 checking linker support for INSERT in linker script... yes
2023-02-10 15:58:08 checking for broken attribute((alias()))... no
2023-02-10 15:58:09 checking whether to put _rtld_local into .sdata section... no
2023-02-10 15:58:10 checking whether to use .ctors/.dtors header and trailer... no
2023-02-10 15:58:13 checking for libunwind-support in compiler... no
2023-02-10 15:58:14 checking whether --noexecstack is desirable for .S files... yes
2023-02-10 15:58:15 checking for -z combreloc... yes
2023-02-10 15:58:16 checking for linker that supports -z execstack... yes
2023-02-10 15:58:17 checking for linker that supports --no-dynamic-linker... yes
2023-02-10 15:58:17 checking for -static-pie... no
2023-02-10 15:58:17 checking for -fpie... yes
2023-02-10 15:58:18 checking for --hash-style option... yes
2023-02-10 15:58:19 checking for sufficient default -shared layout... no
2023-02-10 15:58:19 checking for GLOB_DAT reloc... yes
2023-02-10 15:58:20 checking linker output format... elf32-littlearm
2023-02-10 15:58:20 checking for -fno-toplevel-reorder -fno-section-anchors... yes
2023-02-10 15:58:21 checking for -mtls-dialect=gnu2... yes
2023-02-10 15:58:22 checking whether cc puts quotes around section names... no
2023-02-10 15:58:22 checking for __builtin_memset... no
2023-02-10 15:58:23 checking for redirection of built-in functions... yes
2023-02-10 15:58:23 checking for compiler option to disable generation of FMA instructions... -ffp-contract=off
2023-02-10 15:58:24 checking if /xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-gcc accepts -fno-tree-loop-distribute-patterns with attribute ((optimize))... yes
2023-02-10 15:58:25 checking for libgd... no
2023-02-10 15:58:26 checking for is_selinux_enabled in -lselinux... no
2023-02-10 15:58:26 checking for _FORTIFY_SOURCE predefine... no
2023-02-10 15:58:27 checking whether the linker provides working __ehdr_start... yes
2023-02-10 15:58:28 checking for builtin_trap with no external dependencies... yes
2023-02-10 15:58:40 checking whether the C++ compiler supports thread_local... yes
2023-02-10 15:58:40 running configure fragment for sysdeps/unix/sysv/linux
2023-02-10 15:58:41 checking installed Linux kernel header files... 3.2.0 or later
2023-02-10 15:58:41 checking for kernel header at least 3.2.0... ok
2023-02-10 15:58:41 running configure fragment for sysdeps/gnu
2023-02-10 15:58:41 running configure fragment for sysdeps/unix/inet
2023-02-10 15:58:41 running configure fragment for sysdeps/arm
2023-02-10 15:58:41 checking for grep that handles long lines and -e... /usr/bin/grep
2023-02-10 15:58:41 checking for egrep... /usr/bin/grep -E
2023-02-10 15:58:42 checking whether the compiler is using the ARM hard-float ABI... yes
2023-02-10 15:58:42 checking whether PC-relative relocs in movw/movt work properly... yes
2023-02-10 15:58:43 checking whether TPOFF relocs with addends are assembled correctly... yes
2023-02-10 15:58:43 checking whether -fPIC is default... no
2023-02-10 15:58:44 checking whether -fPIE is default... no
2023-02-10 15:58:44 configure: creating ./config.status
2023-02-10 15:58:44 config.status: creating config.make
2023-02-10 15:58:44 config.status: creating Makefile
2023-02-10 15:58:44 config.status: creating config.h
2023-02-10 15:58:44 config.status: executing default commands
2023-02-10 15:58:44 Entering make_package...
2023-02-10 15:58:44 make -r PARALLELMFLAGS="" -C /xiaoai/build-packages/build/armv7/glibc objdir=pwd all
2023-02-10 15:58:45 make[1]: Entering directory '/xiaoai/build-packages/build/armv7/glibc'
2023-02-10 15:58:45 LC_ALL=C gawk -f scripts/sysd-rules.awk > /xiaoai/build-packages/build/armv7/glibc-build/sysd-rulesT
2023-02-10 15:58:45 -v all_object_suffixes='.o .os .oS'
2023-02-10 15:58:45 -v inhibit_sysdep_asm=''
2023-02-10 15:58:45 -v sysd_rules_patterns='%:% rtld-%:rtld-% rtld-%:% m
%:s
%'
2023-02-10 15:58:45 -v config_sysdirs='sysdeps/unix/sysv/linux/arm sysdeps/arm/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/arm sysdeps/unix sysdeps/posix sysdeps/arm/armv7/multiarch sysdeps/arm/armv7 sysdeps/arm/armv6t2 sysdeps/arm/armv6 sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic'
2023-02-10 15:58:45 mv -f /xiaoai/build-packages/build/armv7/glibc-build/sysd-rulesT /xiaoai/build-packages/build/armv7/glibc-build/sysd-rules
2023-02-10 15:58:45 gawk -f scripts/gen-sorted.awk
2023-02-10 15:58:45 -v subdirs='csu assert ctype locale intl catgets math setjmp signal stdlib stdio-common libio malloc string wcsmbs time dirent grp pwd posix io termios resource misc socket sysvipc gmon gnulib iconv iconvdata wctype manual shadow gshadow po argp crypt localedata timezone rt conform debug mathvec support dlfcn elf'
2023-02-10 15:58:45 -v srcpfx=''
2023-02-10 15:58:45 sysdeps/nptl/Subdirs sysdeps/unix/inet/Subdirs sysdeps/posix/Subdirs assert/Depend catgets/Depend debug/Depend iconvdata/Depend intl/Depend libio/Depend localedata/Depend malloc/Depend mathvec/Depend posix/Depend rt/Depend stdio-common/Depend stdlib/Depend string/Depend time/Depend wcsmbs/Depend > /xiaoai/build-packages/build/armv7/glibc-build/sysd-sorted-tmp
2023-02-10 15:58:45 mv -f /xiaoai/build-packages/build/armv7/glibc-build/sysd-sorted-tmp /xiaoai/build-packages/build/armv7/glibc-build/sysd-sorted
2023-02-10 15:58:46 { echo '#include "posix/bits/posix1_lim.h"';
2023-02-10 15:58:46 } |
2023-02-10 15:58:46 /xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-gcc -E -dM -MD -MP -MF /xiaoai/build-packages/build/armv7/glibc-build/bits/stdio_lim.dT -MT '/xiaoai/build-packages/build/armv7/glibc-build/bits/stdio_lim.h /xiaoai/build-packages/build/armv7/glibc-build/bits/stdio_lim.d' \

[...]

2023-02-10 16:18:02 /xiaoai/build-packages/build/armv7/toolchain/bin/arm-linux-gnueabihf-gcc sdlopen.c -c -std=gnu11 -fgnu89-inline -Os -Wall -Wundef -Wwrite-strings -fmerge-all-constants -fno-stack-protector -frounding-math -Wstrict-prototypes -Wold-style-definition -ftls-model=initial-exec -I../include -I/xiaoai/build-packages/build/armv7/glibc-build/dlfcn -I/xiaoai/build-packages/build/armv7/glibc-build -I../sysdeps/unix/sysv/linux/arm -I../sysdeps/arm/nptl -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux -I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/arm -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/arm/armv7/multiarch -I../sysdeps/arm/armv7 -I../sysdeps/arm/armv6t2 -I../sysdeps/arm/armv6 -I../sysdeps/arm/include -I../sysdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I. -nostdinc -isystem /xiaoai/build-packages/build/armv7/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/include -isystem /xiaoai/build-packages/build/armv7/toolchain/bin/../lib/gcc/arm-linux-gnueabihf/7.4.1/include-fixed -isystem /xiaoai/build-packages/staging/armv7//usr/arm-linux-gnueabihf/include -D_LIBC_REENTRANT -include /xiaoai/build-packages/build/armv7/glibc-build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h -DTOP_NAMESPACE=glibc -o /xiaoai/build-packages/build/armv7/glibc-build/dlfcn/sdlopen.o -MD -MP -MF /xiaoai/build-packages/build/armv7/glibc-build/dlfcn/sdlopen.o.dt -MT /xiaoai/build-packages/build/armv7/glibc-build/dlfcn/sdlopen.o
2023-02-10 16:18:02 mv: cannot stat '/xiaoai/build-packages/build/armv7/glibc-build/dlfcn/stamp.oST': No such file or directory
2023-02-10 16:18:02 make[2]: *** [../o-iterator.mk:9: /xiaoai/build-packages/build/armv7/glibc-build/dlfcn/stamp.oS] Error 1
2023-02-10 16:18:02 make[2]: *** Waiting for unfinished jobs....
2023-02-10 16:18:06 make[2]: Leaving directory '/xiaoai/build-packages/build/armv7/glibc/dlfcn'
2023-02-10 16:18:06 make[1]: *** [Makefile:215: dlfcn/subdir_lib] Error 2
2023-02-10 16:18:06 make[1]: Leaving directory '/xiaoai/build-packages/build/armv7/glibc'
2023-02-10 16:18:06 make: *** [Makefile:9: all] Error 2
2023-02-10 16:18:06 make_package returned error
2023-02-10 16:18:06 Build for package 'glibc' not completed

Any help is greatly appreciated ๐Ÿ™

Information gathering for voice assistant implementation via porcupine and vosk

Another issue from me!

I thought it would be a good idea to gather all the information that is needed for an offline voice assistant with this project using the LX06 as hardware. Information from this issue could then be the basis for a more detailed HowTo guide.

Here is what I figured out so far:

  1. porcupine (wake word) detector is already implemented and working. the script porcupine_launcher is launched as a service. by default, porcupine listens to the wakeword "alexa" and stores the recorded speech in /tmp/stt.wav
  2. notify sound file missing /usr/share/sound/wakeup2.mp3
  3. Mute button already working, stops porcupine and activates/deactivates the LED.
  4. The script uses stt.wav and sends it for STT to home assistant. I guess @duhow has a vosk instance already running as an addon within HA.
  5. the response from the curl POST in 4) is saved asa text file and then played via tts_google on the speaker again. If you sometimes hear a asian sounding voice coming out of the speaker, it is actually tts_google saying the word error. Took to me way to long to figure this out. Basically everytime the wakeword is detected, this will be the response since the response file will be missing.

Next steps for me:
I already set up a docker instance of vosk-server on a remote host, which is working fine with the test scripts provided by their repo. What I haven't figured out: How I can post the stt.wav file directly to the websocket instance of vosk and generate a text file in response to the posted input wav file. The examples provided by vosk rely on additional packages being installed on the client. In the case of python, we're missing asyncio and websockets. I think using curl would be the solution with the smallest footprint. Using the curl command from porcupine_launcher doesn't generate any output either.

Another thing I haven't quite figured out yet: I was expecting the analysed text response to be visible on the websocket instance of vosk, but so far there is absolute silence going on. Either I'm doing something wrong or I'm stupid. Not to say it can't be both.

That's it for the moment with my rambling thoughts, I'll update here once I make further progress. If anybody has further input, please feel free to contribute to this discussion.

mpd: Input latency for AUX input

Hey @duhow!

Thanks for creating this repo and for all the time and energy you've put into this.
I bought an LX-09 recently and despite a few hiccups (I'll open a PR for those), rooting/build/patch/flash worked as advertised.

I have one tiny issue I'm looking to fix though:

I saw this commit 1773283 that detects when AUX is inserted and starts playing audio from hw0,1. The issue is that there is a 3-4second delay in my case when I run

mpc clean
mpc add alsa://hw:0,1
mpc play

Whereas If I run: arecord -D hw:0,1 -f cd -d2000 | aplay there is no delay at all.
Do you have any ideas as to what I could do to get rid of the annoying delay?

bluealsa-aplay v4 not working

In default /etc/init.d/bluetooth:

root@LX06:~# bluealsa-aplay 00:00:00:00:00:00 -vv -i hci0 -d default --profile-a2dp --stereo-audio
bluealsa-aplay: invalid option -- 'i'
bluealsa-aplay: invalid option -- 'd'
bluealsa-aplay: unrecognized option '--stereo-audio'

Fix:

bluealsa-aplay 00:00:00:00:00:00 -vv -D bluetooth --profile-a2dp

Xiaoai Speaker Play - L05B

Hi,
I just bought a "Xiaoai Speaker Play", but i seems to be a new revision. ๐Ÿ˜ž

The model number (l05b) is different from the one in the readme (lx05).
I found a TX0/RX0 and TX2/RX2. Any idea where i can get GND?

F71D5259-BC2D-41D7-97CB-4539C1F7FEC3
78739ED4-11AE-4309-9F52-8A998B8A751B
0FD4F69A-25B4-48B4-9BCB-A73DE6EDC92B
40716CB1-2309-4D39-8F41-33080508690A

Is this the correct image?

I have a MDZ-25-DT, according to the documentation I exported the image, run binwalk command, and displayed

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             UBI erase count header, version: 1, EC: 0xC, VID header offset: 0x800, data offset: 0x1000 

Is this the correct image? I copy it from /dev/mtd4.

Lx01

hi, I just used the following command to flash lx01:
fastboot flash rootfs1 mico_firmware_7206d_240108_lx01.img

when i reboot, The following information keeps recurring:

[   83.544666] can not support 4 channels 
[   83.549088] ac108 1-003b: can't set ac108-pcm0 hw params: -22
[   85.603248] can not support 4 channels 
[   85.607689] ac108 1-003b: can't set ac108-pcm0 hw params: -22
[   87.661938] can not support 4 channels 
[   87.666368] ac108 1-003b: can't set ac108-pcm0 hw params: -22

remote firmware update

Hi,

is it possible to remotely update the firmware? it yes, how?

Best Regards,
Kristijan

I tried to connect procupine to MQTT, but failed.

I modified the code of Porcupine. When Alexa is awakened, I can hear the sound played of wakeup2.mp3. However, echo command and mosquitto_pub command have no effect. There is no problem when I manually execute the mosquitto_pub command.

#!/bin/sh

# This script will launch Porcupine (hotword detector) on infinite loop.
# Service can be stopped, same as pressing the MUTE button.

MIC="mico_record"

SENSITIVITY="0.6"
WORD=alexa
TIME=5
NOTIFY_SOUND=/usr/share/sound/wakeup2.mp3
PORCUPINE_FOLDER=/usr/share/porcupine
SPEAK=tts_google
LANGUAGE=en

MQTT_HOST=192.168.53.123
MQTT_USER=rhasspy
MQTT_PASS=rhasspy


# import config file if exists
[ -f /data/listener ] && . /data/listener
[ -f /data/tts.conf ] && . /data/tts.conf

WAV_INPUT=/tmp/input.wav
WAV_STT=/tmp/stt.wav
DATA_STT=/tmp/stt.json
RATE=16000
CHANNEL=1

# Set lower rate if cannot convert later
which ffmpeg &>/dev/null || RATE=8000

MODEL=$(uci -c /usr/share/mico get version.version.HARDWARE)

if [ "${MODEL}" = "LX06" ]; then
  amixer sset 'pdm dclk' 'pdm dclk 3.072m, support 8k/16k/32k/48k' &
  amixer sset 'HCIC shift gain from coeff' 'shift with -0x4'
  CHANNEL=8
fi

rm -f $WAV_INPUT $WAV_STT $DATA_STT

while true; do

# program lib model keyword sensitivity ALSA_INPUT
/usr/bin/porcupine /usr/lib/libpv_porcupine.so $PORCUPINE_FOLDER/model.pv $PORCUPINE_FOLDER/keywords/${WORD}_raspberry-pi.ppn $SENSITIVITY $MIC

if [ "$?" -gt 0 ]; then
  sleep 1
  continue
fi

echo "test " >> /data/xiaoai.log

/bin/show_led 1
#aplay -Dnotify $NOTIFY_SOUND &>/dev/null &
mpg123 -a notify -q $NOTIFY_SOUND &>/dev/null &

echo "Debugging information: MQTT_HOST=$MQTT_HOST, MQTT_USER=$MQTT_USER, MQTT_PASS =$MQTT_PASS " >> /data/xiaoai.log

mosquitto_pub -h $MQTT_HOST -p 1883 -u $MQTT_USER -P $MQTT_PASS -i me --qos 1 -t 'xiaoai/debug' -m '{"info": "Xiaoai has been awakened." }'

# Do all at once:
# Start recording user response - tee to input.wav
# convert to PCM_S16_LE 1ch/8000 - tee to stt.wav
# send data chuncked without waiting

# lower volume on the speaker in case anything is currently playing
amixer set mysoftvol 10%
# publish a mqtt message for rhasspy
mosquitto_pub -h $MQTT_HOST -p 1883 -u $MQTT_USER -P $MQTT_PASS -i me --qos 1 -t 'hermes/hotword/default/detected' -m '{"siteId": "default" ,"modelId":"null"}'
# start recording and save the file once the defined time is up
arecord -N -D$MIC -d $TIME -f S16_LE -c $CHANNEL -r $RATE /data/message.wav
# publish the wav file as an mqtt message
mosquitto_pub -h $MQTT_HOST -p 1883 -u $MQTT_USER -P $MQTT_PASS -i me --qos 1 -t 'hermes/audioServer/default/audioFrame' -f /data/message.wav
# set volume on the speaker  to 70%
amixer set mysoftvol 70%

# Start loading
/bin/show_led 2

cat ${DATA_STT}.hdr
cat ${DATA_STT}

# Show speaking LED
# /bin/show_led 3

if [ "$(jq -r .result ${DATA_STT})" = "success" ]; then
  ${SPEAK} $(jq .text ${DATA_STT})
else
  ${SPEAK} error
fi

# last animation fadeout and shut LEDs
/bin/show_led 11
for NUM in 1 2 3; do
  /bin/shut_led ${NUM}
done

done
# end while

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.