No Audio Output on Picroft with Jabra 410

Here are the contents of the file in the etc/mycroft directory.

{
  "play_wav_cmdline": "aplay -Dhw:0,0 %1",
  "play_mp3_cmdline": "mpg123 -a hw:0,0 %1",
  "enclosure": {
    "platform": "picroft"
  },
  "tts": {
    "mimic": {
      "path": "/usr/local/bin/mimic"
    }
  },
  "ipc_path": "/ramdisk/mycroft/ipc/",
  "hotwords": {
    "hey mycroft": {
      "module": "precise"
    }
  },
  "SkillInstallerSkill": {
    "path": "/opt/venvs/mycroft-core/bin/msm"
  }
}

FYI - When I open AlsaMixer, hit F6, I see the Jabra on Sound Card 1. When I select this the up and down arrows do move the volume indicator lights on the Jabra when on F3[Playback]. A small victory.

I then decided to try adding a line for listener according to the sound issues wiki. Unfortunately I can’t edit the file as it is read-only. I tried sudo but I can’t find any documentation that provides the root password for picroft?

So, alas, still no listening or speaking mycroft. Thanks for any help.

These are the two lines that I’d recommend experimenting with, for instance try
"play_wav_cmdline": "aplay -Dhw:0,3 %1"

to get it to pick up source 3

Unfortunately audio is the hardest part for us to get working with Picroft :frowning:

Wow - this is a little more work than I thought it would be. I specifically chose the Jabra based on the wiki as it indicated that it was one of the recommended choices.

A couple of issues seem to be getting in my way of resolving this.

Why can’t I save changes to mycroft.conf? I get an E212 Cannot open file for writing. Presumably I am not going to get far without being able to edit and save this file?

Why does ssh into the unit periodically reject the password “mycroft”. I just burned a clean SD and can only access the picroft through connected keyboard - “ssh pi@IP adddress” results in a password prompt but mycroft doesn’t work. Nor does raspberry that someone posted works or used to. This is particularly weird and not very encouraging.
It appears that the Jabra does move index numbers in the list-sources if you unplug it. I clean booted without it - then plugged it in and rebooted. It showed up once on index 2. Then I unplugged it again and rebooted and this time it showed up twice stereo on index 2 and mono on index 3. Does it matter which one of these I try to setup stereo or mono? I assumed mono because the speaker probably isn’t stereo.

@KathyReid - Thanks for all your help - are you the only one helping out on this forum?

Hi Simon,

Unfortunately audio issues and getting Devices configured is one of the most frequent complaints we have with Picroft - and thank you for sticking with us so far.

mycroft.conf not saving

If you are having trouble saving changes to your mycroft.conf file then it usually indicates filesystem permission issues. Can you run the command ls -las in the directory in which your mycroft.conf is stored so I can see what the permissions are?

ssh being rejected

The Picroft ssh password is definitely mycroft - I’m not sure why it would be periodically rejecting, and understand your frustration. If this happens, check;

  • Is Picroft on the network? Your router may be able to show you ‘attached devices’ and you should be able to ping Picroft if it is on the network.
  • If Picroft is connected wirelessly, is it in range?

Jabra 410

The spec sheet for the 410 isn’t clear on whether it’s stereo or not, by my assumption is that it would be due to its HD sound quality.

Have you tried the experimental unstable image? I’ve had better results with this and the Jabra 410.

https://mycroft.ai/to/picroft-unstable

Since I have had no luck with the released version or the beta from August, I thought I would try the new beta you linked to. Still no luck with this one out of the box. The auto setup does not play a sound and the microphone test does not work. Do you need to manually configure your Jabra 410 or does it work automatically after answering the startup questions.

Also, I do see red error messages during the startup - is there a way to find these logs and check these as they scroll past too quickly?

I notice that pacmd list-sources does not work under this beta release, or at least I can’t run it from the default login directory.

I was able to run aplay and arecord and got the following:

aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
dmix:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample mixing device
dmix:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample snooping device
hw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Hardware device with all software conversions
default:CARD=USB
    Jabra SPEAK 410 USB, USB Audio
    Default Audio Device
sysdefault:CARD=USB
    Jabra SPEAK 410 USB, USB Audio
    Default Audio Device
front:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    Front speakers
surround21:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    Direct sample mixing device
dsnoop:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    Direct sample snooping device
hw:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    Direct hardware device without any conversions
plughw:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    Hardware device with all software conversions
(.venv) pi@picroft:~ $ arecord -L
-bash: record: command not found
(.venv) pi@picroft:~ $ 



arecord -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=USB
    Jabra SPEAK 410 USB, USB Audio
    Default Audio Device
sysdefault:CARD=USB
    Jabra SPEAK 410 USB, USB Audio
    Default Audio Device
front:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    Front speakers
surround21:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    Direct sample mixing device
dsnoop:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    Direct sample snooping device
hw:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    Direct hardware device without any conversions
plughw:CARD=USB,DEV=0
    Jabra SPEAK 410 USB, USB Audio
    Hardware device with all software conversions

This is what I see when I run ls -las in the etc\mycroft directory

total 12
4 drwxr-xr-x  2 root root 4096 Sep 12 02:36 .
4 drwxr-xr-x 88 root root 4096 Sep 12 07:23 ..
4 -rw-r--r--  1 root root  285 Sep 12 02:36 mycroft.conf

Finally I was able to resolve the ssh issue - another device was on the same IP. I had a device with a static IP that was in the range of the DHCP server. Don’t know why it wasn’t seeing it but I am able to ssh into the unit fine now.

I have a fully operational Pycroft with the latest code released last week and using the
Jabra 410 USB conference speaker/microphone.

Briefly the steps were:

  1. Build a new Pycroft as per https://github.com/MycroftAI/enclosure-picroft/tree/stretch

  2. Run through the first time install wizard as normal.

  3. Reboot.

  4. As this point I had everything working except the speaker.
    (The microphone worked out of the box)

  5. Make the changes as below to DISABLE the onboard BCM2835 speaker
    hardware. This means the Jabra becomes Card 0 and the default.
    (I do plan to work with this further to see if I can leave the hardware
    enabled and change the default to the Jabra as card 1. This is yet to be
    started.

    Your best friend thorough this is the command alsa-info .
    When you run it respond ‘no’ to sending the data to the Alsa team to get
    to the file name containing your configuration details Save this, and refer to it for
    an exact description of your Alsa configuration.

Here are the steps. The steps include commands to cut/paste to run.

#1. Disable BCM2835 overlay from loading at boot time.
#- Edit /boot.config.txt

sudo cp -p /boot/config.txt /boot/config.txt.orig
sudo bash -c 'cat >> /boot/config.txt << __EOF
dtparam=audio=off
__EOF'
more /boot/config.txt
sudo shutdown -r now

#2. Force USB Audio to be card 0 I also forced the snd_bcm2835 to never be card 0 as well
#- Create /etc/modprobe.d/alsa-base.conf

sudo bash -c 'cat > /etc/modprobe.d/alsa-base.conf << __EOF
options snd_usb_audio index=0
options snd_bcm2835 index=-2
__EOF'
more /etc/modprobe.d/alsa-base.conf 
sudo shutdown -r now

#3. Change default to USB
#- Replace /etc/asound.conf

sudo mv /etc/asound.conf /etc/asound.conf.orig
sudo bash -c 'cat > /etc/asound.conf << __EOF
pcm.!default {
  type plug
  slave {
    pcm "hw:0,0"
  }
}

ctl.!default {
    type hw           
    card 0
}
__EOF'
cat /etc/asound.conf

#4. Replace ./audio_setup.sh created by the wizard so set Control 3 (Playback) to card 0

echo 'sudo amixer cset numid=3 "0"  > /dev/null' > ~/audio_setup.sh
echo "amixer set PCM 79%" >> ~/audio_setup.sh
bash ~/audio_setup.sh

#5. Test Output Audio with noise, then WAV files if they are on pycroft
#- First check the speaker volume. Use the -/+ on the Jabra and set it at about 75%
#- (Use control-C to stop if necessary)

cat /dev/urandom | aplay
speaker-test -t wav -c 2 -D hw:0

#6. Test Input Audio with noise (stop mycroft first to release the microphone driver)

mycroft-core/stop-mycroft.sh
cat /dev/urandom | arecord -d 5 /tmp/noise.wav
aplay /tmp/noise.wav

#7. Update /etc/mycroft/mycroft.conf to use the default alsa device.
# Use an editor and change lines 2 and 3 to look like this. ** Sorry no command here.

“play_wav_cmdline”: “aplay %1”,
“play_mp3_cmdline”: “mpg123 %1”,

#The entire default /etc/mycroft/mycroft.conf file shroud now look like:
#- /etc/mycroft/mycroft.conf

{
“play_wav_cmdline”: “aplay %1”,
“play_mp3_cmdline”: “mpg123 %1”,
“enclosure”: {
“platform”: “picroft”
},
“tts”: {
“mimic”: {
“path”: “/home/pi/mycroft-core/mimic/bin/mimic”
}
},
“ipc_path”: “/ramdisk/mycroft/ipc/”
}

#8. Do a final reboot to get everything started in a predictable manner.
sudo shutdown -r now

Hopefully it should all be working for you.

3 Likes

This is great - thanks. I am getting closer.

Microphone works in initial setup. All commands up to step 5 work like a charm.
One question about 1. The commands append dtparam=audio=off right after dtparam=audio=on. Did you want me to remove the dtparam=audio=on?

Then in step 5
aplay default_mono.wav and aplay default_dual.wav return “No such file…”. I tried searching for these files but couldn’t find them

speaker-test -t wav -c 2 -D hw:0 - works! I get front right and front left spoken through the Jabra.

cat /dev/urandom | arecord -d 5 /tmp/noise.wav - Returns “arecord: main:788: audio open error: Device or resource busy”

I went ahead and made the changes to the mycroft.conf file in step 7 and restarted but I am still not getting verbal responses from mycroft.

I’ve updated steps 5 and 6.

Step 5:- Before you do the speaker test, use the -/+ controls on the Jabra and set the volume about 75%

Step 6:- Mycroft has control of the microphone driver, so it needs to be stopped for the next test.

One other step I did do early in my testing, but did not include it in my notes was download the latest updates from GIT, including the Mimic engine:

mycroft-core/dev_setup.sh -fm

See how you go. I’ll grab another SD card and run through the procedure end to end, and make sure it’s repeatable.

2 Likes

Ok, I ran through it again and it worked! Thank you for your help - I am sure I wouldn’t have figured it out on my own. I am now running the “mycroft-core/dev_setup.sh -fm” - hopefully everything will work after this. But I created a backup of my working build just in case.

1 Like

Hi djl,
Thanks for the fix. I can take Mycroft out of the draw and place it back in to my project.
The history with my installation was it worked out of the box since installing last year.
I documented it in this video where it worked flawlessly.
Then around mid July (2018) sound out just stopped. I got it back but the quality was terrible - lots of poping, stuttering and clicking. After a total rebuild I could not get it back at all until your fix.

Many Thanks
Beer owed.

1 Like

Hi ausinch
Beers are always good. Glad to be of help.
Cheers
djl.

1 Like

If you are ever in Zürich Switzerland you’ve got it.

This has got my Jabra 410 going. Thanks, the solution is still needed!

1 Like

I know I am kind of reactivating a dead thread here so excuse me for that.
I have tried this guide and it worked until step 4. It gave lots of errors and this is the output:

ALSA lib conf.c:1371:(parse_def) c does not exists
ALSA lib conf.c:1852:(snd_config_load1) toplevel:2:14:No such file or directory
ALSA lib conf.c:3615:(config_file_open) /etc/asound.conf may be old or corrupted: consider to remove >or fix it
ALSA lib conf.c:3537:(snd_config_hooks_call) function snd_config_hook_load returned error: No such >file or directory
ALSA lib conf.c:3986:(snd_config_update_r) hooks failed, removing configuration
amixer: Control default open error: No such file or directory

ALSA lib conf.c:1371:(parse_def) c does not exists
ALSA lib conf.c:1852:(snd_config_load1) toplevel:2:14:No such file or directory
ALSA lib conf.c:3615:(config_file_open) /etc/asound.conf may be old or corrupted: consider to remove or fix it
ALSA lib conf.c:3537:(snd_config_hooks_call) function snd_config_hook_load returned error: No such file or directory
ALSA lib conf.c:3986:(snd_config_update_r) hooks failed, removing configuration
amixer: Mixer attach default error: No such file or directory

Alsamixer doesn’t work either, nor does the microphone. This is very weird because I installed Picroft again from the same image file, and the previous time, it was only the speaker which didn’t work. Step 4 crashed in a similar way there too. If it helps, here is my alsa-info output:

upload=true&script=true&cardinfo=
!!################################
!!ALSA Information Script v 0.4.64
!!################################

!!Script ran on: Thu Apr 4 14:26:07 UTC 2019

!!Linux Distribution
!!------------------

ID_LIKE=debian

!!DMI Information
!!---------------

Manufacturer:
Product Name:
Product Version:
Firmware Version:

!!Kernel Information
!!------------------

Kernel release: 4.14.50-v7+
Operating System: GNU/Linux
Architecture: armv7l
Processor: unknown
SMP Enabled: Yes

!!ALSA Version
!!------------

Driver version: k4.14.50-v7+
Library version: 1.1.3
Utilities version: 1.1.3

!!Loaded ALSA modules
!!-------------------

snd_bcm2835

!!Sound Servers on this system
!!----------------------------

No sound servers found.

!!Soundcards recognised by ALSA
!!-----------------------------

0 [ALSA ]: bcm2835_alsa - bcm2835 ALSA
bcm2835 ALSA

Hi Adutchman

As these instruction are relatively old, they do relate to the [Picroft Stable 2018-09-12 ] version of pycroft. Can you please retry the instructions using the 2018-09-12 version (https://github.com/MycroftAI/enclosure-picroft/tree/stretch) as the version you download.

While the instructions are not perfect, as ALSA Master is not implemented, it did work for me and many others in getting pycroft loaded and working.

Once you have it running, you can upgrade pycroft to the latest verison.

Let me know how you go.
Good luck
Cheers
DJL.

Hi DJL,
I do still use the 2018-09-12 as that is still the latest stable version. On the point of the instructions, I know that it worked for many and I am very thankful that you came up with the solution but I just want to find out what I have to do to get the same result.
Thank you for tuning in,
Adutchman

I have tried it again today for some 3 to 4 hours and it still doesn’t work. I tried it on Ubuntu Mate to make it easier to configure the audio (GUI). I have now come to a point that still only the microphone works and that the speaker only outputs the end of sentences. I have tested ALSA and that works and I have tested Firefox and that works too so it is a problem with Mycroft. This kind of pisses me of because Mycroft claims on the main page about Picroft that this device works but it just doesn’t. I have bought a Raspberry pi with accessories for 60 euros for this and now it doesn’t work and that is very annoying.
@krisgesling, Can Mycroft do something about the support for this device or remove it from the Picroft page because the listing of the device is kind of misleading when it doesn’t work. I had the Jabra laying around but I can see people buying this as a premium device and them being annoyed because it doesn’t work.
@DJL, You don’t have to help me of course, but since you wrote a solution, maybe you can help. As I already said, the ALSA works (the audiotest of the WAV file works) and Pulseaudio works (Firefox audio works) and Mycroft does recognise something because it can produce some sound, but only at the end of lines. It also gives me errors about the mycroft.conf file.

Hi Adutchman

I can assist, but it may not be prompt as I have local undertakings that significantly restrict the time I can respond in.

From your alsa-info listing above it appears your alsa-info results are not as they should be.

Your alsa-info output has the following issues:

ISSUE #1.

!!Loaded ALSA modules
!!-------------------

snd_bcm2835

PROBLEM—> snd_bcm2835 should not be here if the internal sound module is disabled as per step 1.

From steps above:
!!-----------------------
#1. Disable BCM2835 overlay from loading at boot time.
#- Edit /boot.config.txt

sudo cp -p /boot/config.txt /boot/config.txt.orig
sudo bash -c 'cat >> /boot/config.txt << __EOF
dtparam=audio=off
__EOF'
more /boot/config.txt
sudo shutdown -r now

ISSUE 2.

The sound card recognised is not the USB sound driver.

!!Soundcards recognised by ALSA
!!-----------------------------

0 [ALSA ]: bcm2835_alsa - bcm2835 ALSA
bcm2835 ALSA

should be:
!!Soundcards recognised by ALSA
!!-----------------------------

0 [USB ]: USB-Audio - Jabra SPEAK 410 USB
Jabra SPEAK 410 USB at usb-3f980000.usb-1.3, full speed

The sound card is recognised after the module loads following successful scan of the USB bus. (This is why I suggest a reboot after commands that affect boot sequences)

Also note: the JABRA 410 first boots in muted mode. (Bug… who knows.) As per Step 5. First check the speaker volume. Use the -/+ on the Jabra and set it at about 75%.

This can catch anyone out even if everything is working.

So to help you:

1… Can you please send me the name of the pycroft image and MD5 sum of that file so we can verify you are using the correct image.

2… Then to verify the steps:
Step 1.
Can you send me that last 5 lines of /boot/config.txt.

Step 2.
Can you send the output of ```/etc/modprobe.d/alsa-base.conf

Step 3.
Can you send the output of /etc/asound.conf

Step 4.
Can you send the output of ~/audio_setup.sh

Step 7.
Can you send the output of /etc/mycroft/mycroft.conf

Next time I will be able to respond is in two weeks.

Best regards
DJL
``

1 Like

Hello ,

I am studying engineering school and I have to set up mycroft service. Small problem, the sound does not go out of my jabra.
I tried to follow your instructions but several configuration files do not exist. Could you help me quickly so that I can put my year-end project to a successful conclusion?

Besr regards

Eli

Hi Elimane,

Can I check what you’ve attempted already and what might be showing up in your audio and voice logs?

These are located at /var/log/mycroft/ or if you just want to upload all your logs to termbin tell Mycroft to “create a support ticket” and you’ll get an email with a link.