> For the complete documentation index, see [llms.txt](https://mycroft.gitbook.io/mycroft-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mycroft.gitbook.io/mycroft-docs/support/audio-troubleshooting.md).

# Audio

* [Troubleshooting Audio](/mycroft-docs/support/audio-troubleshooting.md#troubleshooting-audio)
  * [Missing pulseaudio](/mycroft-docs/support/audio-troubleshooting.md#missing-pulseaudio)
  * [Microphone can't hear me or CLI show no change in meter while speaking](/mycroft-docs/support/audio-troubleshooting.md#mic-cant-hear-me)
  * [Dev instance audio test](/mycroft-docs/support/audio-troubleshooting.md#dev-instance-audio-test)
  * [Test your mic](/mycroft-docs/support/audio-troubleshooting.md#test-your-mic)
* [Pulseaudio settings](/mycroft-docs/support/audio-troubleshooting.md#pulseaudio-settings)
  * [Show current settings and info](/mycroft-docs/support/audio-troubleshooting.md#show-current-settings-and-info)
  * [List available input devices](/mycroft-docs/support/audio-troubleshooting.md#list-available-input-devices)
  * [List available output devices](/mycroft-docs/support/audio-troubleshooting.md#list-available-output-devices)
  * [Changing pulseaudio input and output](/mycroft-docs/support/audio-troubleshooting.md#changing-pulseaudio-input-and-output)
  * [Echo cancellation](/mycroft-docs/support/audio-troubleshooting.md#echo-cancellation)
  * [Pulseaudio modules](/mycroft-docs/support/audio-troubleshooting.md#pulseaudio-modules)
* [Other useful commands](/mycroft-docs/support/audio-troubleshooting.md#other-useful-commands)
* [Will my device work](/mycroft-docs/support/audio-troubleshooting.md#will-my-device-work)

## Troubleshooting Audio

Mycroft utilizes pulseaudio for sound input and output. Mark 1 and Picroft devices have pulseaudio set up correctly for the mycroft user. On picroft, any mic or speakers you add to it may need to be configured as Mycroft uses the default input and output from pulse. Systems without pulseaudio installed will likely also not function as expected. Systems with both jack and pulseaudio may need additional configuration to work correctly.

#### Missing pulseaudio

If you see an issue in the logs with `Popen(play_wav_cmd)` and `OSError: [Errno 2] No such file or directory` this usually indicates that mycroft can't find pulseaudio. Make sure it's installed and mycroft is able to access it.

#### Microphone can't hear me or CLI show no change in meter while speaking

If no audio is picked up by mycroft, check the mic to verify it's working. If the mictest is successful, verify that pulse has your device as the default source.

**Dev instance audio test**

`start-mycroft.sh audiotest` will attempt to record, then play back a short audio clip using the default source and sink.

**Test your speakers**

To test a WAV file, you can use: `aplay $WAVfile`

For an MP3/OGG format: `mpg123 $mp3file`

**Test your mic**

The following command will start recording for ten seconds on the default input device when run: `arecord -d 10 -o test.wav`

You can play it back to hear what is recorded with `aplay test.wav`

## Pulseaudio settings

**Show current settings and info**

`pactl info`

For mycroft, the lines most relevant are the Default Source: and Default Sink:.

```
  picroft:~$ pactl info
  Server String: unix:/run/user/1000/pulse/native
  Library Protocol Version: 30
  Server Protocol Version: 30
  Is Local: yes
  Client Index: 813
  Tile Size: 65472
  User Name: pi
  Host Name: picroft
  Server Name: pulseaudio
  Server Version: 8.0
  Default Sample Specification: s16le 2ch 44100Hz
  Default Channel Map: front-left,front-right
  Default Sink: alsa_output.pci-0000_00_1b.0.analog-stereo
  Default Source: alsa_input.pci-0000_00_1b.0.analog-stereo
  Cookie: ab8a:0b4d
```

**List available output devices**

Use `pactl list sinks short` to list output devices available to the current user:

```
picroft:~$ pactl list sinks short
1       alsa_output.pci-0000_00_1b.0.analog-stereo      module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED
```

**List available input devices**

`pactl list sources short` will list input devices available to the current user:

```
picroft:~$ pactl list sources short
1       alsa_output.pci-0000_00_1b.0.analog-stereo.monitor      module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED
2       alsa_input.pci-0000_00_1b.0.analog-stereo       module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED
```

**Changing pulseaudio input and output**

If you need to adjust the device you're using for input or output, first determine the number of the source or sink you wish to set it to. Then use `pactl set-default-source` (for input) or `pactl set-default-sink` (for output) to update:

```
$ pactl set-default-source 2
$ pactl set-default-sink 1
```

This would set the default input to be device 2 and the default output device to be 1. Your numbers will vary. A succsessful change will not have any additional output listed. Verify with `pactl info`

**Echo cancellation**

Pulseaudio has an echo cancellation module that can be loaded.

```
$ pactl load-module echo-cancellation
```

This is system wide. If not previously enabled, you will need to restart any applications using pulse. For documentation, see <https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#index45h3> Additional usage and tips can be found <https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting>

**Pulseaudio modules**

Find out what modules are installed:

```
$ pactl list modules short
```

For more information like usage counts and properties, remove the `short`.

## Specifying an input device

By default Mycroft will use the system default device for all audio. In most cases this provides a more consistent, flexible and reliable experience. If however other methods do not work, we can specify the exact input device Mycroft should use in our `mycroft.conf` file. For information on this configuration file, see <https://mycroft.ai/documentation/mycroft-conf/>.

We first need to know the device name. Assuming your `mycroft-core` directory is located in the current users home directory. This can be found by running: `$ ~/mycroft-core/start-mycroft.sh audiotest -l`

This will output a list of audio devices, before it runs the mic-test. The output we need looks like:

```
====================== Audio Devices ======================
 Index    Device Name
  4:       HDA Intel PCH: ALC269VB Analog (hw:1,0)
  6:       pulse
  7:       default
```

This can be added to your user level configuration file - `~/.mycroft/mycroft.conf` by adding the following lines:

```
"listener": {
    "device_name": "DEVICE_NAME"
  },
```

Where "DEVICE\_NAME" is taken from the audio device output. As this file is written in JSON, we must be careful that each entry except the last one ends with a comma after the curly bracket. If this is the last entry in the file, delete the comma.

## Other useful commands

`lsusb` can be used to see what USB devices are connected to the system. `lsusb -v` can be also used, but produces significantly more output.

`groups` will list all the system groups the current user is a part of. In dev instances of mycroft, can be used to see if the mycroft user is part of the audio group. If running list sinks or list sources you see null or no devices for the user, use this command to verify if you're part of the `audio` group.

`alsamixer` is a command-line utility to adjust volume and muting of both inputs and outputs.

`pulseaudio -k` kills the current instance of pulseaudio.

`pulseaudio --start` will start pulseaudio.

`pavucontrol` is a GUI mixer client for X.

`pacmd` is an interactive shell version of `pactl`. Use `help` to see more once in the shell.

### Will my device work

Maybe.

Most USB mics and speakers are usable with pulseaudio. In general, if your OS can recognize the device as an audio endpoint pulse will be able to connect it. A variety of mics including the PS3 Eye, Blue snowballs, Jabra 410, various web cams, the movo mc1000, gaming headsets, and even the AIY hat have been used successfully. If you have the device on hand, try it out and see. If the information above isn't able to get it going, try asking on the chat server or the forum. Always check the volume levels if everything else seems to be set correctly.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mycroft.gitbook.io/mycroft-docs/support/audio-troubleshooting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
