Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node rpi5 support #678

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/nodejs-codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 3 additions & 7 deletions .github/workflows/nodejs-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Pre-build dependencies
run: npm install yarn

- name: Install dependencies
run: yarn install

Expand All @@ -60,7 +57,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
Expand All @@ -72,6 +69,8 @@ jobs:
platform: raspberry-pi
- machine: rpi4-64
platform: raspberry-pi
- machine: rpi5-64
platform: raspberry-pi
- machine: jetson
platform: jetson
- machine: beaglebone
Expand All @@ -80,9 +79,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Pre-build dependencies
run: npm install --global yarn

- name: Install dependencies
run: yarn install

Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/nodejs-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ jobs:
with:
node-version: 18.x

- name: Pre-build dependencies
run: npm install yarn

- name: Install dependencies
run: yarn install

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion binding/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions binding/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
14 changes: 13 additions & 1 deletion binding/nodejs/src/platforms.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -111,6 +120,7 @@ function getLinuxPlatform(): string {
case '0xc07':
case '0xd03':
case '0xd08':
case '0xd0b':
return PLATFORM_RASPBERRY_PI;
case '0xd07':
return PLATFORM_JETSON;
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions demo/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions demo/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": "~3.0.3",
"commander": "^6.1.0",
"wavefile": "^11.0.0"
},
Expand Down
16 changes: 8 additions & 8 deletions demo/nodejs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading