Reputation: 1
I am working with the google coral dev board, I have managed to set up the board and run the demo where it detects cars or vans. Next, I want to move on to voice commands. On the Coral website, they have a project “Keyword Spotting”. Which seemed like exactly what I was after. I put the project onto my board and went to try it out. However no luck. The board does not detect any sound. I tried using a 3.5mm headphone with a microphone (which works on other devices, no drivers). Looking into the Dev Board specs it has two built-in PDM microphones. No idea why it detects no input whatsoever
I followed the tutorial on the google APC youtube channel
I have tried, checking drivers for the board.
Tried opening up the sound settings using alsamixer
Tried recording a small sample with and without the headphones arecord -d test.wav
. This is creating the .wav files but no audio is captured.
Tried detecting audio devices on the board.
But still, at this time no success and I am finding it difficult to find other online resources for this problem. Is there something I have overlooked?
Any help will be much appreciated. Thanks.
Upvotes: -2
Views: 193
Reputation: 405
I ran into same issue. Turned out just need to set arecord flags.
For instance, plugging a headphone set into the 3.5mm audio jack, then running
arecord -D hw:0,0 -c 2 test.wav -f S16_LE -d 3
worked for me.
Some notes from my debugging process.
mediainfo
displays information about files in a nice human-readable format.
To visualize (so don't have to trust replaying through the same audio port) the wav file, I did this. I used sox
convert to a spectrogram (image), then converted to a jpg because for some reason jp2a
only takes jpg
(despite the jp2a
docs implying png
is accepted).
sox loud.wav -n spectrogram; convert spectroram.png spectrogram.jpg; jp2a spectrogram.jpg
You can try something like silence and compare with saying a lot of p
s or tapping the microphone to ensure it is recording.
Here is the results (although I'm running on laptop not the coral dev board) of a visualization of "p"ahs .
sox test.wav -n spectrogram; convert spectrogram.png spectrogram.jpg; jp2a spectrogram.jpg
................................'.......................''..................................................... .
..........................'',;,,;,'...............',;;;;,'......................'',;::,'............''''''''..
.............................',::;:;,................';cc::;'......................',;clc;'...........'''''''''...
..........................',cc:;;''...............':ll:;;'......................';ccl:;'...........''''''''''..
..........................,col:;;,'...............',::cl:'......................';cc::;''..........''''''''''.. :k.
..............''.............,cllclc;'...............':llcc:'......................,:c:;;,'...........''''''''''.. dW.
.............''...........;odolc:,'...............';lllc;'.....................',cllll:,..........'''''''''''.. dW'
. ............'.''...........,lddoc:,'...............;odlc:;''.....................,lol::;,..........''''''''''''. dN.
..........''..............,coooll;'...............,coolc:,'.....................,clodxo;'.........''''''''''''. oN'
...........''..............,:lodxdc'...............,ldoddl;'.....................;oxddxdc'.........''''''''''''. lK.
...........'''.............:dkxddo:'..............';oxxool;'....................'cxkkxdc,'......'''''''''''''''. cO.
..........'''.............;dkkkkko,''.............;lddxxd:'....................';odollc,'......'''''''''''''''. :k.
.............'''.............,codoooc'...............;dxdoc;''....................'ckkkxd:''......'''''''''''''''. ;d.
..........''....'.........,lddolc;'..............';ldxxoc,.....................':dxxoc:''.......''''''''',''''. ,c.
............'''...'.........;oxxxoc:'..............';oxdddo;'.....................,lxkkxc,'......''''','''',,'''. .;
.. ..........'''...''........,oxxxdl:'...............:dxxxxo;'.....................;dxxooc,'......'''',,,''',,,''. .' .
.. ...........'''...''........;dxddxdl,..............':dxxdoc,'....................';oxkOxo,'.....''''',;;,'',;,''. .'
. ..........''''..'''........;oxxxxdc,'.............';dkxkkx:'....................'cxxxddoc'.....''''',;;'',;;,''. .'
' .........''''..'''.......'ck00kkxd;'.............';dxxdol;'....................'ckkxxxo:'.....''''',;;,',;:;''. .'
' ...........''''...''.......'ckOOxdoc,'''...........';xOOkkxl,''..................'lOOkddoc''''..'''',:c:,,;::;''. .'
.. .........''''............'cxOkkxxo,''............'cxOOkxl;'....................'cxkkxxo:''....'''',;::,,;::;,'. ..
...........''''............';okOkdol;'''...........'lkOOkxdc''''.................';ldkkkxl''''..'''';c:;,,;:;,''. ..
.........''''.............;dO0OOxo,''''.'........';lxkkdo:'''..................';dO0OOOd;''.'''''',;:;,;::;,''. .. .
..........''''.............:xO00kdl,'''...........'lkO000Oo;'''''''''...........'ckOO0K0x;,'''''''';:::;;:::;,'. ..
..........''''............'ckO0KKKOl;,''''''..'...'lxO0Odl:'''............'.....':dO0OOko,''''''''';cll::looc,'. . .
..........'''.....'......'cxO00Okd:''..'.........'oO00KK0x;'''''''.............'ck00O0Od,''''''''';colccllll:,. .
..........''.............'lO0KKKOd:,''''''.......'oO0OOxdl,'''..'..............'cxOO00Od;'''''''',lddddddooolc.
..................'......'cxO0Okkd:''............'lxk0K0Oo;,''''..''.....'.....':k00KXKk:,''''''',ldxxdxkkxdl:.
.........''..''''....'......'cxOO0K0xc:;,''''''''''',dO00Oxoc''''....'....'..'....'oOKKKKKO:,'''''',cdxkkxkOxkkoc.
...........'''....'''.....'lk000KK0d,,''''........,x0KKKXX0l;;,''''''''..'''....'oO0O0XK0l,,'''',,:oxkxxO0Okxoo. .
...''...'...''''''''''.''''oOKKK0OOo,''''''..'''..,kKK0OO0k:'''''''''''..''''...'lkOOkxdo;'''''',;okOOkkOOOOkdo.
....''''''''''''''.''''''.',x0KK00K0d,'''''''''''.',xKXX00Ox;'''''''''''''''....',kKKKOOkl,'''''',:x0KKK000K00Ox. .
.'''''''''''''''''''''''''dOKK0Oxo:'''''''''''''',dOKKKOdc,'''''''''''''''''''',dO0Oxxxl,''''''':k0KKK00KKK0Ox. .'.
...''''''''''''''''''''''',kKXXX0Okl,''''''''''''':k0KXXKOx;'''''''''''''''''''',xKNX0OOd;''''''':O0KXKKXKKKK0O'
.'''''''''''''''''''''''''lOKKKOkxc'''''''''''''',ok0KK0kd:'''''''''''''''''''''lxO0kkOx:'''''''ck0KXK0KKKK0Ok.
. . .... ... ............. .....,,.','..'.'..........',,'',;,.'''..''....'..'....''.,,,''',..''...''..,,'.',,..'..
... ..
vs. one of silence
$ sox test.wav -n spectrogram; convert spectrogram.png spectrogram.jpg; jp2a spectrogram.jpg
................................................................................................................
..............................................................................................................
..................................................................................................................
................................................................................................................
.............................................................................................................. :k.
.................................................................................................................. dW.
.............................................................................................................. dW'
. ................................................................................................................ dN.
.............................................................................................................. oN'
................................................................................................................ lK.
................................................................................................................ cO.
.............................................................................................................. :k.
.................................................................................................................. ;d.
............................................................................................................... ,c.
................................................................................................................. .;
.. ............................................................................................................... .' .
.. ................................................................................................................ .'
. ................................................................................................................ .'
' .............................................................................................................. .'
' ................................................................................................................. .'
.. .............................................................................................................. ..
................................................................................................................ ..
............................................................................................................... .. .
................................................................................................................ ..
..............'''..............................................'................................................ . .
............................................................................................................... .
..........................................''...................................................................
..........''......'''......'...................''''.................'................'''.....''................
.....'''.''.....'''....''...............................'''..''.......'...'..'.......'.....'''''''''''''..''''....
....''....'''..''''...............''...........'...''''''....''...................'''.....'''''.....'''......... .
...'''..''.'''...''.......''......''...''.....'...'..''.........'''''''''''''''........''''''...'...............
.....'.......''''...''...'''''....'.'''''''''''''''''''''''...'''''''''''''.''''''.''''''.''''''''''''..''''..... .
.'''''''.''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''..'''''''''''''''''.'''''''''''''... .'.
.''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''...
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''.
. ................... ................ ......... ..................... ... ................... ......... . .
... ..
...... '...
If there is literally no input (e.g. if you just use arecord test.wav
) you will see emptiness:
mendel@vexing-apple:~/whisper.cpp$ sox test.wav -n spectrogram ; convert spectrogram.png spectrogram.jpg ; jp2a spectrogram.jpg
.
.
lK,
... dW,
dW;
dN,
oX,
lK'
. cO'
:x.
. ,o.
':.
.,
.. .'.
. .'
. . .'..
' .'
. .'
. ..
.. .
.. ..
.
.
..
.
.
...
. . . . .
Upvotes: 0