Thanks, @janjongboom. This has solved the issue of the error while recording audio.
The verbose output below:
$ edge-impulse-linux --verbose
Edge Impulse Linux client v1.2.6
[SER] Using microphone hw:0,0
[GST] Found devices: [
{
"id": "/dev/video1",
"name": "Integrated Camera",
"caps": [
{
"type": "video/x-raw",
"width": 1280,
"height": 720,
"framerate": 10
},
{
"type": "video/x-raw",
"width": 960,
"height": 540,
"framerate": 15
},
{
"type": "video/x-raw",
"width": 848,
"height": 480,
"framerate": 20
},
{
"type": "video/x-raw",
"width": 640,
"height": 480,
"framerate": 30
},
{
"type": "video/x-raw",
"width": 640,
"height": 360,
"framerate": 30
},
{
"type": "video/x-raw",
"width": 424,
"height": 240,
"framerate": 30
},
{
"type": "video/x-raw",
"width": 352,
"height": 288,
"framerate": 30
},
{
"type": "video/x-raw",
"width": 320,
"height": 240,
"framerate": 30
},
{
"type": "video/x-raw",
"width": 320,
"height": 180,
"framerate": 30
}
]
},
{
"id": "/dev/video0",
"name": "Droidcam",
"caps": [
{
"type": "video/x-raw",
"width": 640,
"height": 480,
"framerate": 30
}
]
}
]
[SER] Using camera Integrated Camera starting...
[GST] Starting gst-launch-1.0 with [
'v4l2src',
'device=/dev/video1',
'!',
'video/x-raw,width=640,height=480',
'!',
'videoconvert',
'!',
'jpegenc',
'!',
'multifilesink',
'location=test%05d.jpg'
]
[GST] Setting pipeline to PAUSED ...
[GST] Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
[GST] New clock: GstSystemClock
[SER] Connected to camera
[WS ] Connecting to wss://remote-mgmt.edgeimpulse.com
[WS ] Connected to wss://remote-mgmt.edgeimpulse.com
[GST] Got snapshot test00003.jpg time since last: 295ms. size
[GST] Got snapshot test00005.jpg time since last: 199ms. size
[GST] Got snapshot test00007.jpg time since last: 199ms. size
[WS ] Device "cris-laptop" is now connected to project "Test_project"
[WS ] Go to https://studio.edgeimpulse.com/studio/30100/acquisition/training to build your machine learning model!
[GST] Got snapshot test00009.jpg time since last: 200ms. size
[GST] Got snapshot test00011.jpg time since last: 200ms. size
[GST] Got snapshot test00013.jpg time since last: 199ms. size
[GST] Got snapshot test00015.jpg time since last: 200ms. size
[GST] Got snapshot test00017.jpg time since last: 200ms. size
[GST] Got snapshot test00019.jpg time since last: 200ms. size
[GST] Got snapshot test00021.jpg time since last: 199ms. size
[GST] Got snapshot test00023.jpg time since last: 199ms. size
[WS ] Incoming sampling request {
path: '/api/training/data',
label: 'test',
length: 2000,
interval: 0.0625,
hmacKey: 'ed7f4620a5915677614fa16fe6b9b7ad',
sensor: 'Microphone'
}
[SER] Waiting 2 seconds
Recording via: sox [
'-t', 'alsa',
'hw:0,0', '-q',
'-r', '16000',
'-c', '1',
'-e', 'signed-integer',
'-b', '16',
'-t', 'raw',
'-'
] {}
Recording 1 channels with sample rate 16000...
[GST] Got snapshot test00025.jpg time since last: 199ms. size
Recording 4096 bytes <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 ff ff 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff 00 00 ... 4046 more bytes>
[GST] Got snapshot test00027.jpg time since last: 199ms. size
Recording 4096 bytes <Buffer 00 00 00 00 ff ff 00 00 01 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 ff ff 00 00 00 00 ff ff 00 00 00 00 01 00 00 00 00 00 ff ff ... 4046 more bytes>
Recording 4096 bytes <Buffer 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 ff ff 00 00 01 00 00 00 01 00 ff ff 00 00 ... 4046 more bytes>
[GST] Got snapshot test00029.jpg time since last: 199ms. size
Recording 8192 bytes <Buffer 00 00 ff ff 00 00 00 00 00 00 00 00 01 00 01 00 ff ff ff ff 01 00 01 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 8142 more bytes>
[GST] Got snapshot test00031.jpg time since last: 199ms. size
Recording 4096 bytes <Buffer 00 00 01 00 00 00 00 00 01 00 ff ff ff ff 00 00 00 00 00 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 4046 more bytes>
[GST] Got snapshot test00033.jpg time since last: 199ms. size
Recording 4096 bytes <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 ff ff 00 00 00 00 ff ff ... 4046 more bytes>
[GST] Got snapshot test00035.jpg time since last: 199ms. size
Recording 8192 bytes <Buffer 00 00 01 00 00 00 00 00 ff ff 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 ... 8142 more bytes>
[GST] Got snapshot test00037.jpg time since last: 199ms. size
Recording 4096 bytes <Buffer ff ff 00 00 00 00 ff ff 00 00 ff ff 00 00 01 00 00 00 00 00 01 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 ... 4046 more bytes>
[GST] Got snapshot test00039.jpg time since last: 199ms. size
Recording 4096 bytes <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 ff ff 00 00 00 00 01 00 00 00 ... 4046 more bytes>
Recording 8192 bytes <Buffer 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 01 00 00 00 00 00 ff ff 00 00 01 00 00 00 01 00 00 00 00 00 01 00 00 00 00 00 00 00 ff ff 01 00 ... 8142 more bytes>
[GST] Got snapshot test00041.jpg time since last: 199ms. size
Recording 4096 bytes <Buffer 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ... 4046 more bytes>
[GST] Got snapshot test00043.jpg time since last: 199ms. size
[SER] Recording audio...
Recording 4096 bytes <Buffer 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 ff ff 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 ... 4046 more bytes>
[GST] Got snapshot test00045.jpg time since last: 199ms. size
Recording 8192 bytes <Buffer 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 01 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 00 00 00 00 00 00 ... 8142 more bytes>
[GST] Got snapshot test00047.jpg time since last: 199ms. size
Recording 4096 bytes <Buffer ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 01 00 01 00 00 00 01 00 00 00 00 00 ... 4046 more bytes>
[GST] Got snapshot test00049.jpg time since last: 199ms. size
Recording 4096 bytes <Buffer 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 ff ff 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 4046 more bytes>
[GST] Got snapshot test00051.jpg time since last: 199ms. size
Recording 8192 bytes <Buffer ff ff 01 00 00 00 00 00 01 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 ff ff 00 00 00 00 01 00 00 00 ... 8142 more bytes>
Recording 4096 bytes <Buffer 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 4046 more bytes>
[GST] Got snapshot test00053.jpg time since last: 200ms. size
Recording 4096 bytes <Buffer 00 00 00 00 00 00 ff ff 00 00 00 00 01 00 00 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 ... 4046 more bytes>
[GST] Got snapshot test00055.jpg time since last: 199ms. size
Recording 8192 bytes <Buffer 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 01 00 ... 8142 more bytes>
[GST] Got snapshot test00057.jpg time since last: 199ms. size
Recording 4096 bytes <Buffer ff ff 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 ... 4046 more bytes>
[GST] Got snapshot test00059.jpg time since last: 199ms. size
Recording 4096 bytes <Buffer 00 00 00 00 ff ff 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ... 4046 more bytes>
[GST] Got snapshot test00061.jpg time since last: 199ms. size
Recording 8192 bytes <Buffer 00 00 00 00 00 00 01 00 00 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00 ff ff 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 01 00 ff ff ... 8142 more bytes>
[GST] Got snapshot test00063.jpg time since last: 200ms. size
Recording 4096 bytes <Buffer 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 ... 4046 more bytes>
Recording 2390 bytes <Buffer ff ff 00 00 ff ff 00 00 00 00 ff ff 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 01 00 ff ff ff ff 00 00 00 00 00 00 00 00 ff ff 00 00 ... 2340 more bytes>
End Recording: 4.018s
[SER] Uploading sample to https://ingestion.edgeimpulse.com/api/training/data...
[GST] Got snapshot test00065.jpg time since last: 200ms. size
[GST] Got snapshot test00067.jpg time since last: 199ms. size
[SER] Sampling finished
[GST] Got snapshot test00069.jpg time since last: 201ms. size
[GST] Got snapshot test00072.jpg time since last: 298ms. size
[GST] Got snapshot test00074.jpg time since last: 200ms. size
[GST] Got snapshot test00077.jpg time since last: 298ms. size
[GST] Got snapshot test00079.jpg time since last: 199ms. size
[GST] Got snapshot test00081.jpg time since last: 199ms. size
[GST] Got snapshot test00083.jpg time since last: 199ms. size
[GST] Got snapshot test00085.jpg time since last: 199ms. size
[GST] Got snapshot test00087.jpg time since last: 199ms. size
[GST] Got snapshot test00089.jpg time since last: 199ms. size
[GST] Got snapshot test00091.jpg time since last: 199ms. size
[GST] Got snapshot test00093.jpg time since last: 199ms. size
[GST] Got snapshot test00095.jpg time since last: 199ms. size
^C[SER] Received stop signal, stopping application... Press CTRL+C again to force quit.
[GST] handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:09.803339636
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
However, the issue with standalone local audio inferencing still persists.
Below is the output for various trials using “hw:0,0” and “plughw:PCH,0” arguments.
$ ./build/audio hw:0,0 --debug
Enabling debug mode
audio interface opened
hw_params allocated
hw_params initialized
hw_params access set
hw_params format set
cannot set sample rate (Invalid argument)
$ ./build/audio plughw:PCH,0 --debug
Enabling debug mode
audio interface opened
hw_params allocated
hw_params initialized
hw_params access set
hw_params format set
hw_params rate set: 16000
hw_params channels set:1
cannot set parameters (Cannot allocate memory)
Should there be some audio settings that need to be done prior?