From 903ffa02dc015e3d4bf944246a9b472af5dd832f Mon Sep 17 00:00:00 2001 From: Ian Date: Thu, 1 Feb 2024 14:11:20 -0800 Subject: [PATCH 1/2] node --- .github/workflows/nodejs-codestyle.yml | 3 --- .github/workflows/nodejs-demos.yml | 18 +++++++++++++----- .github/workflows/nodejs-perf.yml | 11 ++++------- .github/workflows/nodejs.yml | 8 +------- binding/nodejs/README.md | 2 +- binding/nodejs/package.json | 4 ++-- binding/nodejs/src/platforms.ts | 14 +++++++++++++- demo/nodejs/README.md | 4 ++-- demo/nodejs/package.json | 6 +++--- 9 files changed, 39 insertions(+), 31 deletions(-) diff --git a/.github/workflows/nodejs-codestyle.yml b/.github/workflows/nodejs-codestyle.yml index 5c7520a78..1c3d08e36 100644 --- a/.github/workflows/nodejs-codestyle.yml +++ b/.github/workflows/nodejs-codestyle.yml @@ -27,9 +27,6 @@ jobs: with: node-version: lts/* - - name: Pre-build dependencies - run: npm install yarn - - name: Run Binding Linter run: yarn && yarn lint working-directory: binding/nodejs diff --git a/.github/workflows/nodejs-demos.yml b/.github/workflows/nodejs-demos.yml index 8067022c6..6b1649cec 100644 --- a/.github/workflows/nodejs-demos.yml +++ b/.github/workflows/nodejs-demos.yml @@ -46,8 +46,11 @@ jobs: with: node-version: ${{ matrix.node-version }} - - name: Pre-build dependencies - run: npm install yarn + # ************** REMOVE AFTER RELEASE ******************** + - name: Build Node.js SDK + run: yarn && yarn build + working-directory: binding/nodejs + # ******************************************************** - name: Install dependencies run: yarn install @@ -60,7 +63,7 @@ jobs: strategy: matrix: - machine: [rpi2, rpi3-32, rpi3-64, rpi4-32, rpi4-64, jetson, beaglebone] + machine: [rpi2, rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, jetson, beaglebone] include: - machine: rpi2 platform: raspberry-pi @@ -72,6 +75,8 @@ jobs: platform: raspberry-pi - machine: rpi4-64 platform: raspberry-pi + - machine: rpi5-64 + platform: raspberry-pi - machine: jetson platform: jetson - machine: beaglebone @@ -80,8 +85,11 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Pre-build dependencies - run: npm install --global yarn + # ************** REMOVE AFTER RELEASE ******************** + - name: Build Node.js SDK + run: yarn && yarn build + working-directory: binding/nodejs + # ******************************************************** - name: Install dependencies run: yarn install diff --git a/.github/workflows/nodejs-perf.yml b/.github/workflows/nodejs-perf.yml index eea3ffee6..77d468574 100644 --- a/.github/workflows/nodejs-perf.yml +++ b/.github/workflows/nodejs-perf.yml @@ -54,9 +54,6 @@ jobs: with: node-version: 18.x - - name: Pre-build dependencies - run: npm install yarn - - name: Install dependencies run: yarn install @@ -68,7 +65,7 @@ jobs: strategy: matrix: - machine: [rpi2, rpi3-32, rpi3-64, rpi4-32, rpi4-64, jetson, beaglebone] + machine: [rpi2, rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, jetson, beaglebone] include: - machine: rpi2 num_test_iterations: 20 @@ -85,6 +82,9 @@ jobs: - machine: rpi4-64 num_test_iterations: 50 performance_threshold_sec: 0.32 + - machine: rpi5-64 + num_test_iterations: 50 + performance_threshold_sec: 0.16 - machine: jetson num_test_iterations: 50 performance_threshold_sec: 0.42 @@ -95,9 +95,6 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Pre-build dependencies - run: npm install --global yarn - - name: Install dependencies run: yarn install diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 632e991fd..f467c1664 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -56,9 +56,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - - name: Pre-build dependencies - run: npm install yarn - - name: Install dependencies run: yarn install @@ -70,14 +67,11 @@ jobs: strategy: matrix: - machine: [rpi2, rpi3-32, rpi3-64, rpi4-32, rpi4-64, jetson, beaglebone] + machine: [rpi2, rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, jetson, beaglebone] steps: - uses: actions/checkout@v3 - - name: Pre-build dependencies - run: npm install --global yarn - - name: Install dependencies run: yarn install diff --git a/binding/nodejs/README.md b/binding/nodejs/README.md index 17c77b862..34657028c 100644 --- a/binding/nodejs/README.md +++ b/binding/nodejs/README.md @@ -34,7 +34,7 @@ This binding is for running Rhino on **NodeJS 12+** on the following platforms: - Windows (x86_64) - Linux (x86_64) - macOS (x86_64, arm64) -- Raspberry Pi (2,3,4) +- Raspberry Pi (2, 3, 4, 5) - NVIDIA Jetson (Nano) - BeagleBone diff --git a/binding/nodejs/package.json b/binding/nodejs/package.json index 494d01bd9..b35dc3ace 100644 --- a/binding/nodejs/package.json +++ b/binding/nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@picovoice/rhino-node", - "version": "3.0.2", + "version": "3.0.3", "description": "Picovoice Rhino Node.js binding", "main": "dist/index.js", "types": "dist/types/index.d.ts", @@ -43,7 +43,7 @@ "@typescript-eslint/parser": "^5.19.0", "eslint": "^8.13.0", "eslint-plugin-jest": "^27.1.6", - "jest": "^27.5.1", + "jest": "^27.5.1", "mkdirp": "^3.0.1", "ncp": "^2.0.0", "npm-run-all": "^4.1.5", diff --git a/binding/nodejs/src/platforms.ts b/binding/nodejs/src/platforms.ts index 9ab9f25cc..71b8b3b09 100644 --- a/binding/nodejs/src/platforms.ts +++ b/binding/nodejs/src/platforms.ts @@ -1,5 +1,5 @@ // -// Copyright 2020-2023 Picovoice Inc. +// Copyright 2020-2024 Picovoice Inc. // // You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" // file accompanying this source. @@ -36,6 +36,7 @@ const ARM_CPU_CORTEX_A7 = 'cortex-a7'; const ARM_CPU_CORTEX_A53 = 'cortex-a53'; const ARM_CPU_CORTEX_A57 = 'cortex-a57'; const ARM_CPU_CORTEX_A72 = 'cortex-a72'; +const ARM_CPU_CORTEX_A76 = 'cortex-a76'; const SUPPORTED_NODEJS_SYSTEMS = new Set([ SYSTEM_LINUX, @@ -77,6 +78,14 @@ SYSTEM_TO_LIBRARY_PATH.set( `${SYSTEM_LINUX}/${ARM_CPU_CORTEX_A72}${ARM_CPU_64}`, `${PLATFORM_RASPBERRY_PI}/${ARM_CPU_CORTEX_A72}${ARM_CPU_64}/pv_rhino.node` ); +SYSTEM_TO_LIBRARY_PATH.set( + `${SYSTEM_LINUX}/${ARM_CPU_CORTEX_A76}`, + `${PLATFORM_RASPBERRY_PI}/${ARM_CPU_CORTEX_A76}/pv_rhino.node` +); +SYSTEM_TO_LIBRARY_PATH.set( + `${SYSTEM_LINUX}/${ARM_CPU_CORTEX_A76}${ARM_CPU_64}`, + `${PLATFORM_RASPBERRY_PI}/${ARM_CPU_CORTEX_A76}${ARM_CPU_64}/pv_rhino.node` +); SYSTEM_TO_LIBRARY_PATH.set( `${SYSTEM_LINUX}/${ARM_CPU_CORTEX_A57}${ARM_CPU_64}`, `${PLATFORM_JETSON}/${ARM_CPU_CORTEX_A57}${ARM_CPU_64}/pv_rhino.node` @@ -111,6 +120,7 @@ function getLinuxPlatform(): string { case '0xc07': case '0xd03': case '0xd08': + case '0xd0b': return PLATFORM_RASPBERRY_PI; case '0xd07': return PLATFORM_JETSON; @@ -137,6 +147,8 @@ function getLinuxMachine(arch: string): string { return ARM_CPU_CORTEX_A57 + archInfo; case '0xd08': return ARM_CPU_CORTEX_A72 + archInfo; + case '0xd0b': + return ARM_CPU_CORTEX_A76 + archInfo; case '0xc08': return PLATFORM_BEAGLEBONE; default: diff --git a/demo/nodejs/README.md b/demo/nodejs/README.md index 7ad5b6c29..7ae379cab 100644 --- a/demo/nodejs/README.md +++ b/demo/nodejs/README.md @@ -33,12 +33,12 @@ To learn more about Rhino, see the [product](https://picovoice.ai/products/rhino ## Compatibility -These demos run Rhino on **NodeJS 12+** on the following platforms: +These demos run Rhino on **NodeJS 16+** on the following platforms: - Windows (x86_64) - Linux (x86_64) - macOS (x86_64, arm64) -- Raspberry Pi (2,3,4) +- Raspberry Pi (2, 3, 4, 5) - NVIDIA Jetson (Nano) - BeagleBone diff --git a/demo/nodejs/package.json b/demo/nodejs/package.json index b3c5f68eb..024403150 100644 --- a/demo/nodejs/package.json +++ b/demo/nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@picovoice/rhino-node-demo", - "version": "3.0.1", + "version": "3.0.2", "description": "Picovoice Rhino NodeJS file-based and microphone demos", "scripts": { "file": "node file.js", @@ -16,8 +16,8 @@ "author": "Picovoice Inc.", "license": "Apache-2.0", "dependencies": { - "@picovoice/pvrecorder-node": "~1.2.1", - "@picovoice/rhino-node": "~3.0.2", + "@picovoice/pvrecorder-node": "~1.2.2", + "@picovoice/rhino-node": "file:../../binding/nodejs", "commander": "^6.1.0", "wavefile": "^11.0.0" }, From 6abce997e46183f49da1a084c15142e7f2664729 Mon Sep 17 00:00:00 2001 From: Ian Date: Thu, 1 Feb 2024 14:19:03 -0800 Subject: [PATCH 2/2] release --- .github/workflows/nodejs-demos.yml | 12 ------------ demo/nodejs/package.json | 2 +- demo/nodejs/yarn.lock | 16 ++++++++-------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/nodejs-demos.yml b/.github/workflows/nodejs-demos.yml index 6b1649cec..9a646bc8e 100644 --- a/.github/workflows/nodejs-demos.yml +++ b/.github/workflows/nodejs-demos.yml @@ -46,12 +46,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - # ************** REMOVE AFTER RELEASE ******************** - - name: Build Node.js SDK - run: yarn && yarn build - working-directory: binding/nodejs - # ******************************************************** - - name: Install dependencies run: yarn install @@ -85,12 +79,6 @@ jobs: steps: - uses: actions/checkout@v3 - # ************** REMOVE AFTER RELEASE ******************** - - name: Build Node.js SDK - run: yarn && yarn build - working-directory: binding/nodejs - # ******************************************************** - - name: Install dependencies run: yarn install diff --git a/demo/nodejs/package.json b/demo/nodejs/package.json index 024403150..96d392b51 100644 --- a/demo/nodejs/package.json +++ b/demo/nodejs/package.json @@ -17,7 +17,7 @@ "license": "Apache-2.0", "dependencies": { "@picovoice/pvrecorder-node": "~1.2.2", - "@picovoice/rhino-node": "file:../../binding/nodejs", + "@picovoice/rhino-node": "~3.0.3", "commander": "^6.1.0", "wavefile": "^11.0.0" }, diff --git a/demo/nodejs/yarn.lock b/demo/nodejs/yarn.lock index 23e9fd3c6..84a18eea0 100644 --- a/demo/nodejs/yarn.lock +++ b/demo/nodejs/yarn.lock @@ -2,15 +2,15 @@ # yarn lockfile v1 -"@picovoice/pvrecorder-node@~1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@picovoice/pvrecorder-node/-/pvrecorder-node-1.2.1.tgz#8e112ecc7a4836aa4fa92d62ac7942d8a2366db8" - integrity sha512-7TtRMh04PSVn542Oq1v/MGLFuNPdUrrv+f7qbCGOWRc8y6ox+FATigdQqLRbRey4kZWf40dNHQFdVPCk5ZcXnQ== +"@picovoice/pvrecorder-node@~1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@picovoice/pvrecorder-node/-/pvrecorder-node-1.2.2.tgz#41c39719b408e29c581b3094a9ff4c59f282b026" + integrity sha512-GuzZhWslbR4TLE3VxTiqjax8Mc8f1nB69bY5jag4ETlCxo7q/KpeUbWRvojhtNVPvpFLbospZAb6vfgxkEqgJQ== -"@picovoice/rhino-node@~3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@picovoice/rhino-node/-/rhino-node-3.0.2.tgz#9e0b34d97a4eb3550270914f4b564eebe331347d" - integrity sha512-0pFxkFkMHKhFsZ/iIo7fW6zTpQgvLPUn+soGucfzU6Gd3GrAw/7MjqQwpps2c/rW62WFcPBghB7m+fcAe22bmQ== +"@picovoice/rhino-node@~3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@picovoice/rhino-node/-/rhino-node-3.0.3.tgz#3faac1088a6de016c38d9535572c34e497c3ba63" + integrity sha512-a9JyvBggbmhsV8Z5iV6dYlLzhy2ZSR9NNNG/whbK8SnSLSUEjWEkHufVNQTRkOg1BRq1D4OIVPz2kvwJfanYQQ== commander@^6.1.0: version "6.2.1"