PiCroft - USB speaker volume

I have mycroft-core 20.8.1 running on a Pi 4b. I have set it up successfully with a mini USB microphone (Mini USB Microphone– The Pi Hut) and an old set of usb speakers (Jazz J-1321).

I had to amend the first two lines of /etc/mycroft/mycroft.conf in order to get audio from the speakers (based on the output from aplay -l)

“play_wav_cmdline”: “aplay -Dhw:2,0 %1”,
“play_mp3_cmdline”: “mpg123 -a hw:2,0 %1”,

The issue I’m having is with the volume of the speech output. I have been through the forum and tried:

  1. altering audio_setup.sh as per Default(boot) volume
  2. altering the volume skill default volume in mycroft.conf
  3. changing volume/ output in alsamixer - even with all cards set to 0 the output is still present and loud
  4. changing sink volume in pulse audio with pactl - again very loud even with all cards set to 0
  5. changing pulse volume with amixer

I am at a loss.

aplay -l output:

card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 2: MicroII [Audio Advantage MicroII], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

pactl list short sinks output:

0 alsa_output.usb-C-Media_INC._C-Media_USB_Audio-00.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
1 alsa_output.platform-bcm2835_audio.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED

Any help appreciated

All the best

Ok, I’ve managed to get it to quieten down a bit

Step 1: edit /etc/mycroft/mycroft.conf in order to get audio from the speakers, changing the lines, where the highlighted number is the card number given by aplay -l (the USB speakers were card number 2 in my case):

“play_wav_cmdline”: “aplay -Dhw:2,0 %1”,
“play_mp3_cmdline”: “mpg123 -a hw:2,0 %1”,

Step 2: Turn the card’s ‘Loudness’ control off: find the control identifier (numid) using

amixer -c 2 controls

(again 2 being the number of my usb card)

and then set to 0 using

amixer -c 2 cset numid=4 0

Step 3: Find the index of the usb speakers using

pacmd list-sinks

This was index 0 in my case.

Step 4: Set the volume using

pactl set-sink-volume 0 0.1%

I found around 0.1% was acceptable, even in a noisy kitchen. You can test using mycroft-speak until a suitable volume is found.

More of an alsa/pulse/Linux thing than Mycroft but thought it might be useful to others using usb speakers in their picroft setup.

1 Like