Audiotest records zeros

Hi there,
I have a problem with the audio input. First I was using just precise and precise_listen was working without any problem. Now I am trying to use entire Mycroft but I have problem with audio input. running audiotest the file /tmp/test.wav has correct length but just zeros inside. I double checked mute and everything I was able to check and I see nothing. parecord and paplay are doing the right job but Mycroft audiotest not :frowning: Any hint is welcome. Thank, Jozef

What is your Mycroft and audio hardware stup?

Did you already read the Audio troubleshooting guide.

I did read the Audio troubleshooting guide. It is well written. I learned how to set up the default audio input for pulse audio. So thanks to the author. I have two audio cards in the computer. Build-in and USB. From the source code, I learned that adding option device_name into listener can select the card. So I played also with this. But the result is always the same. In the /tmp/test.wav are always just 0 0 0 0 0 0 0 0. But the correct count of zeros :wink:
What do you mean by Mycroft setup? I first had just mycroft-precise. Where everything worked. Later I installed mycroft-core I checked the config file and tried to run “start-mycroft all”. Right now I am trying to get running properly just “start-mycroft audiotest”. Which runs. But the result …

Hi there,

I think by setup, Dominik meant what sort of hardware are you using. Mycroft is known to run on a range of hardware however with the hacker spirit of our Community we also get attempts to run Mycroft on completely unexpected devices. Sounds like you are just on a laptop/desktop.

Did you install this using the standard git clone method?

Can you post the device list and info output of mycroft-mic-test -l
as well as the config you have added to mycroft.conf?

Hi, thanks for the reply,

you are right, I am using an absolutely standard laptop with Debian on. And I did use git clone method to get Mycroft.

The mic-test output:
./bin/mycroft-mic-test -l
remote: Enumerating objects: 59, done.
remote: Counting objects: 100% (59/59), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 70 (delta 47), reused 55 (delta 46), pack-reused 11
Unpacking objects: 100% (70/70), done.
From github.com/MycroftAI/mycroft-core
b357874c25…a140efe8f7 dev -> origin/dev

  • [new branch] feature/boot-performance -> origin/feature/boot-performance
  • [new branch] feature/log-event-emit -> origin/feature/log-event-emit
  • [new branch] feature/log-merger -> origin/feature/log-merger
  • [new branch] mark-2-dev -> origin/mark-2-dev
    Already up to date.
    Initializing…
    Starting audiotest
    Initializing…
    ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
    ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
    ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
    ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
    connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
    attempt to connect to server failed
    connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
    attempt to connect to server failed
    ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
    ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
    ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback
    ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
    ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
    connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
    attempt to connect to server failed
    ====================== Audio Devices ======================
    Index Device Name
    14: pulse
    18: default

========================== Info ===========================
Input device: default @ Sample rate: 16000 Hz
Playback commandline: paplay WAV_FILE --stream-name=mycroft-voice

===========================================================
== STARTING TO RECORD, MAKE SOME NOISE! ==

===========================================================
== DONE RECORDING, PLAYING BACK… ==

(.venv) dodo@opahapaka:~/mycroft-core$ od -l /tmp/test.wav
0000000 1372346309298514 2338614392529502551
0000020 281479271677968 137438953488000
0000040 7022344801103118338 319488
0000060 0 0
*
1160040 0 0
1160054
(.venv) dodo@opahapaka:~//mycroft-core$

And the config, hm, I just gave up because even after modifying https I am getting an error about max 2 links in the post for new users :frowning:
So, which part of the config? And what is considered as a “link” here?

thanks

Jozef

yeah strange, the github repo is a link, but I can’t see any others.

The config I was thinking of was your mycroft.conf as you mentioned that you’d tried setting the device_name in listener. This would be at ~/.mycroft/mycroft.conf or /etc/mycroft/mycroft.conf

Hi, know where the config is :slight_smile: But since I can not copy here entire config - I did remove all “http://” from the config to cheat the checking I asked which part of the config would you like to have. But I give one more try, perhaps I am no more a new one :slight_smile:
Did not work, I am still new, so I am removing everything that might be considered as a link.

{
“lang”: “en-us”,
“system_unit”: “metric”,
“time_format”: “full”,
“date_format”: “DMY”,
“opt_in”: false,
“confirm_listening”: true,
“sounds”: {
“start_listening”: “snd/start_listening.wav”,
“end_listening”: “snd/end_listening.wav”,
“acknowledge”: “snd/acknowledge.mp3”
},
“play_wav_cmdline”: “paplay %1 --stream-name=mycroft-voice”,
“play_mp3_cmdline”: “mpg123 %1”,
“play_ogg_cmdline”: “ogg123 -q %1”,
“location”: {
“city”: {
“code”: “Heidelberg”,
“name”: “Heidelberg”,
“state”: {
“code”: “”,
“name”: “”,
“country”: {
“code”: “De”,
“name”: “Germany”
}
}
},
“coordinate”: {
“latitude”: 49.417374,
“longitude”: 8.675236
},
“timezone”: {
“code”: “Europe/Berlin”,
“name”: “Central Europe Time”,
“dstOffset”: 3600000,
“offset”: -21600000
}
},
“data_dir”: “/opt/mycroft”,
“skills”: {
“msm”: {
“directory”: “skills”,
“versioned”: true,
“repo”: {
“cache”: “.skills-repo”,
REMOVED
“branch”: “19.02”
}
},
“upload_skill_manifest”: true,
“directory”: “~/.mycroft/skills”,
“auto_update”: true,
“blacklisted_skills”: [
“skill-media”,
“send_sms”,
“skill-wolfram-alpha”,
“pianobar-skill”
],
“priority_skills”: [
“mycroft-pairing”,
“mycroft-volume”
],
“update_interval”: 1.0
},
“server”: {
REMOVED
“version”: “v1”,
“update”: true,
“metrics”: false
},
“websocket”: {
“host”: “0.0.0.0”,
“port”: 8181,
“route”: “/core”,
“ssl”: false
},
“gui_websocket”: {
“host”: “0.0.0.0”,
“base_port”: 18181,
“route”: “/gui”,
“ssl”: false
},
“listener”: {
“device_name”: “default”,
“sample_rate”: 16000,
“record_wake_words”: true,
“save_utterances”: true,
“wake_word_upload”: {
“disable”: true,
REMOVED
},
“mute_during_output”: true,
“duck_while_listening”: 0.3,
“phoneme_duration”: 120,
“multiplier”: 1.0,
“energy_ratio”: 1.5,
“wake_word”: “hey mycroft”,
“stand_up_word”: “wake up”
},
“precise”: {
“dist_url”: “REMOVED”,
“model_url”: “REMOVED”
},
“hotwords”: {
“hey mycroft”: {
“module”: “precise”,
“threshold”: 1e-90,
“lang”: “en-us”,
//“local_model_file”: “~/mycroft-precise/hallo-lisa.pb”,
“sensitivity”: 0.5,
“trigger_level”: 1
},
“wake up”: {
“module”: “pocketsphinx”,
“phonemes”: “W EY K . AH P”,
“threshold”: 1e-20,
“lang”: “en-us”
}
},
“enclosure”: {
“port”: “/dev/ttyAMA0”,
“rate”: 9600,
“timeout”: 5.0,
“update”: true,
“test”: false
},
“log_level”: “INFO”,
“ignore_logs”: [
“enclosure.mouth.viseme”,
“enclosure.mouth.display”
],
“session”: {
“ttl”: 180
},
“stt”: {
“module”: “govivace”
},
“tts”: {
“module”: “mimic”,
“mimic”: {
“voice”: “ap”
},
“mimic2”: {
“lang”: “en-us”,
“url”: “REMOVED”,
“preloaded_cache”: “/opt/mycroft/preloaded_cache/Mimic2”
},
“espeak”: {
“lang”: “english-us”,
“voice”: “m1”
}
},
“padatious”: {
“intent_cache”: “~/.mycroft/intent_cache”,
“train_delay”: 4
},
“Audio”: {
“backends”: {
“local”: {
“type”: “simple”,
“active”: true
},
“vlc”: {
“type”: “vlc”,
“active”: true,
“duck”: true
}
},
“default-backend”: “local”
},
“debug”: true
}

Ah, apologies, most people’s user / device level config files are quite short, so wasn’t expecting this.

From your previous comment I assume you have already tried changing the listener > device_name from “default” to “pulse”.

I’m interested by this line:
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)

Wondering if libjack0 is installed? It is required by portaudio19-dev
However I do need to warn that I have recently seen that this can conflict (and therefore uninstalls) lib-jack-2-0 which on one users machine resulted in WINE and it’s associated programs being automatically removed.

Yes, I did try both devices. Right now I uninstalled the jack completely. But nothing has changed. Just the errors at the beginning of the mic test. Is jackd needed at for for Mycroft?

(.venv) dodo@opahapaka:~/EML_Projects/mycroft-core$ parecord /tmp/aaa.wav
^C(.venv) dodo@opahapaka:~/EML_Projects/mycroft-core$ od -l /tmp/aaa.wav|head
0000000 2376853260486994 2338614392529502551
0000020 562954248388624 757632231058500
0000040 7022344801103118340 908896568248660376
0000060 911992840436714478 1017266088079527432
0000100 936200057822121264 1060050937371626971
0000120 993903308534255173 1027399341861899814
0000140 1016421650264821261 994747746343980532
0000160 985177451107847682 888630060901076158
0000200 1078910048569527702 1076658214425202514
0000220 926066804046564730 1090450698716515859
(.venv) dodo@opahapaka:~/EML_Projects/mycroft-core$ ./bin/mycroft-mic-test -l -d 5
Already up to date.
Initializing…
Starting audiotest
Initializing…
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
====================== Audio Devices ======================
Index Device Name
14: pulse
18: default

========================== Info ===========================
Input device: pulse @ Sample rate: 16000 Hz
Playback commandline: paplay WAV_FILE --stream-name=mycroft-voice

===========================================================
== STARTING TO RECORD, MAKE SOME NOISE! ==

===========================================================
== DONE RECORDING, PLAYING BACK… ==

(.venv) dodo@opahapaka:~/EML_Projects/mycroft-core$ od -l /tmp/test.wav
0000000 686251053566290 2338614392529502551
0000020 281479271677968 137438953488000
0000040 7022344801103118338 159744
0000060 0 0
*
0470040 0 0
0470054
(.venv) dodo@opahapaka:~/EML_Projects/mycroft-core$

O.K. Completely my fault. It was not clear to me that Pulseaudio keeps track of all aps and new one gets mic in mute state. That’s the reason why parecord and some others did work but Mycroft not. Sorry for the confusions …

1 Like

Hey, so glad you figured it out, I was stumped!

Thanks for posting what was actually happening. Will keep it in mind for future issues :slight_smile: