Picroft - Headphones - No Output Sound

card 0: sndrpigooglevoi [snd_rpi_googlevoicehat_soundcar], device 0: Google voiceHAT SoundCard HiFi voicehat-codec-0 [Google voiceHAT SoundCard HiFi voicehat-codec-0]
Subdevices: 0/1
Subdevice #0: subdevice #0

I do not - I accidentally selected that output device, instead of the headphone jack. How do I switch the output device?

{
“max_allowed_core_version”: 21.2
}

Yout might rerun the mycroft installer script via invoking mycroft-setup-wizard from the bash command line (at the prompt that ends with “$”) once the picroft is booted (you may need to exit the cli by pressing Ctrl-C first).

Hi @droidus I ran into this testing a new Picroft release this week. Will have a new image to test shortly but running the following should set your 3.5mm analog audio jack to be the default device in pulseaudio:

pactl set-default-sink alsa_output.platform-bcm2835_audio.analog-stereo

Then you need to delete the custom play_xxx_cmdline entries in /etc/mycroft/mycroft.conf

1 Like

It still will not play on my 3mm headphones.

@droidus
I’ve spent the last few days trying to get this up and running. I organized my notes in this post which includes audio out the 3.5 jack.

Hmm, if you’re still having trouble I’ve pushed the changes to a release candidate image that you can find here:
https://downloads.mycroft.ai/releases/picroft/rc/

When I attempt to unzip that file, it says it’s not a zip archive.

It’s an image you need to write to your sdcard

I think the zipfile is genuinely corrupt.

chrism@thinkp51:~/Downloads$ unzip Picroft_v21.02.0_20210604.img.zip 
Archive:  Picroft_v21.02.0_20210604.img.zip
End-of-central-directory signature not found.  Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive.  In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.

unzip:  cannot find zipfile directory in one of Picroft_v21.02.0_20210604.img.zip or
    Picroft_v21.02.0_20210604.img.zip.zip, and cannot find Picroft_v21.02.0_20210604.img.zip.ZIP, period.

chrism@thinkp51:~/Downloads$ file Picroft_v21.02.0_20210604.img.zip 
Picroft_v21.02.0_20210604.img.zip: Zip archive data, at least v?[0x32d] to extract

chrism@thinkp51:~/Downloads$ md5sum Picroft_v21.02.0_20210604.img.zip 
6f0259c36c04a6343ab5dc16ea0e4768  Picroft_v21.02.0_20210604.img.zip
1 Like

Apologies - you were right the zip file was bad. I’ve uploaded a fresh version.

Checksums for Picroft_v21.02.0_20210604.img.zip
SHA256: 171d858d6b669765b71d2593767d5b7d848db377053ccee368c4ff7b60dbbb28
MD5: 6f0259c36c04a6343ab5dc16ea0e4768

Edit: wrong hashes - correct ones are

md5 sum 84b7df3db0691398bf51be42fe07e5f2
sha 256 sum 2d5a81375036a1dc4ce30051ea9e9181f4019c8f61264db3a43d87d03df854a6

Thanks!

Although I did not use the zip file, I did roll my own from a fork of enclosure-picroft based on your pulseaudio branch.

I have been messing with it for a couple days with a variety of sinks and sources.

My findings so far have been:

  • With a Adafruit Voice Bonnet (mic/speaker hat combo board), both source and sink operation are fairly flaky via pulse. Not much of a surprise, did not much expect it to work at all. Could not reach a configuration that was reliable, so moved on to…

  • This USB/BT speakerphone in USB mode https://smile.amazon.com/gp/product/B07RXMNKPN/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1 … almost works via pulse… mic works fine… sink works except any TTS generated has the first second or two cut off of it (eg. “hey mycroft, what time is it” will cause “eleven” to be spoken if the time is “it’s four eleven”, etc)… could not figure that out so moved on to…

  • Generic USB mic and speaker (separated). Still working on this, seems a bit flaky, but will continue to try to make it work reliably. Current issue is that sometimes the sink just stops working for TTS. The mic seems to always work.

I’m sure each of these can be made to work with some combination of pulse daemon.conf settings or equivalent elbow grease, haven’t hit on the right combo yet though :slight_smile: If I succeed, I will report back. The good news is that each of them kinda work and the source/sink chooser in the installer seems to work fine.

1 Like

Hey thanks for the effort you’re putting in on this.

I’d be interested to know if repeating the same audio made any difference for the TTS output?
Eg

speak "this is a test sentence"
speak "this is a test sentence"

A cut off of that size is ussualy the cause of “suspend-on-idle” module of Pulse. But you are right @gez, let’s check the caching first.

Thanks gez and j1nx, I downloaded and installed the rc, and tried some things.

In a setup with the most generic possible USB speaker attached as a sink (a tiny little 1W thing that I bought from Adafruit), executing

    speak hello; speak hello

From bash produces “lo, hello” in output (the first moments of the first hello are truncated). Commenting out “load-module module-suspend-on-idle” from /etc/pulse/default.pa (and restarting) produced the same, unfortunately.

A few by-the-way findings, having downloaded the updated version of Picroft_v21.02.0_20210604.img.zip after gez replaced it.

  1. The md5 and sha256 sums in gez’s post above are for the old, truncated file, not the new, working file.

  2. The installer generates an audio_setup.sh that is incorrect if you choose to select custom sinks and sources by number. It includes the literal ```"${card_name}" instead of the interpolated version, e.g.

     pactl set-default-sink ${card_name}
     pactl set-default-source ${card_name}
    

    Instead of

     pactl set-default-sink alsa_output.usb-generic-device-foo.analog_stereo
     pactl set-default-source alsa_input.usb-generic-device-bar.analog_mono
    

    I’ll try submit a PR to fix this, but in the meantime, anyone playing along at home will need to
    fix their audio_setup.sh and reboot (or at least run audio_setup.sh again).

Correction about the TTS output of “speak hello; speak hello”: sometimes it produces “lo, hello”, and sometimes it produces “lo, lo”. Good times :slight_smile:

And FTR, if I do this:

~/mycroft-core/mimic/bin/mimic -t hello -o hello.wav
paplay hello.wav ; paplay hello.wav 

It does not seem to chop off the beginning syllable of the first hello (maybe sliiiiiightly but not like it does when I do speak; speak). So presumably the cutoff has something to do with when the waveform is produced and sampled in real time, at the same time.

Will move conversation about my woes to conversation about the pulseaudio PR on GitHub ( Switch from ALSA to PulseAudio by krisgesling · Pull Request #153 · MycroftAI/enclosure-picroft · GitHub ) as this has become a bit offtopic from OP.

I downloaded it again from here: Index of /releases/picroft/rc. The sha256 sum does not match up with what it should be.
Please advise.
Thank you.

gez mistakenly posted the md5sum and sha256sum of the old, truncated file along with his notification that he had uploaded a new file. Here’s what I get for the newer file version:

md5 sum 84b7df3db0691398bf51be42fe07e5f2
sha 256 sum 2d5a81375036a1dc4ce30051ea9e9181f4019c8f61264db3a43d87d03df854a6

:man_facepalming: indeed… is it the weekend yet?

I can confirm these hashes though.

1 Like

It worked! Thank you!

2 Likes