# Enable audio
This section shows how to configure hardware for
microphone and speaker connections and gives steps to verify basic audio
use cases.
Tab QCS6490
Tab IQ-9075
Tab IQ-8275
- *class* tabincludedirective
-
Setup flow
**Prerequisites**
- Set up your infrastructure as described in the [Qualcomm Linux Build
Guide](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/introduction.html)
- Flash the latest software release to the development board.
- Set up an SSH connection:
1. Enable SSH in Permissive mode by performing the steps mentioned in
[Use SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#use-ssh).
2. Connect to the device:
ssh root@
Copy to clipboard
For example, if the IP address of the device is 10.92.160.222, run
the following command:
ssh root@10.92.160.222
Copy to clipboard
**Set up audio hardware**
1. To activate the digital microphone interface (DMIC) on the board, use
DIP 2. Switch PIN 2 to the ON position.
2. Connect the speaker to the board.
- *class* tabincludedirective
-
Setup flow
**Prerequisites**
- Set up your infrastructure as described in the [Qualcomm Linux Build
Guide](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/introduction.html)
- Flash the latest software release to the development board.
- Set up SSH connection:
1. Enable SSH in Permissive mode by performing the steps mentioned in
[Use SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#use-ssh)
2. Connect to the device by running the following command:
ssh root@
Copy to clipboard
For example, if the IP address of the device is 10.92.160.222, run
the following command:
ssh root@10.92.160.222
Copy to clipboard
**Set up audio hardware**
Connect the speaker to the board.
Note
EVT boards need hardware rework for audio functions to work.
- *class* tabincludedirective
-
Setup flow
Note
The Audio functionality requires firmware and license from NXP or other third-party codec. Mercury Codec from NXP is the default codec with Qualcomm Dragonwing IQ-8275.
**Prerequisites**
- Set up your infrastructure as described in the [Qualcomm Linux Build
Guide](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/introduction.html)
- Flash the latest software release to the development board.
- Set up an SSH connection.
1. Enable SSH in Permissive mode. For instructions, see
[Use SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#use-ssh)
2. Connect to the device:
ssh root@
Copy to clipboard
For example, if the IP address of the device is 10.92.160.222, run:
ssh root@10.92.160.222
Copy to clipboard
**Set up audio hardware**
1. Get the required license and firmware from NXP for Mercury Codec.
2. Power off the device.
3. Open the back panel of the device.
4. Set the DIP switch S6 bit7 to ON and the DIP switch S6 bit8 to OFF.
5. Power on the device.
6. Run the following commands:
ssh root@ip-addr
mount -o rw,remount /
Copy to clipboard
7. Push the Mercury firmware received from NXP to the following location:
ssh root@ip-addr
scp -r mercury_firmware\. root@[ip-addr]:/etc/firmware/
Copy to clipboard
8. Set the device in Flashing mode. Select 1 (Flash Mercury) followed by 5 with `dac_mer_testapp`.
ssh root@ip-addr
dac_mer_testapp
Copy to clipboard
9. Flash the firmware:
mercuryflasher -f
Copy to clipboard
If the above command fails, check the output of the following commands for debug.
Check if the ping works:
mercuryflasher -p
Copy to clipboard
Check if the read works:
mercuryflasher -r
Copy to clipboard
Note
The commands should all return success or 0a.
The Mercuryflasher tool doesn’t work directly on the first candidate build. See the latest tool for details.
10. Power off the device.
11. Set the DIP switch S6 bit7 to OFF. Use the preceding figure as reference.
12. Power on the device.
13. For playback, connect the headphone/speaker device to the lineout 1/2 port as follows.
14. For recording, connect the microphone/headset device to the MIC1 port as follows.
## Enable audio with GStreamer
To decode and encode audio using GStreamer apps, see the following.
- [Audio decode
example](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/gst-audio-decode-sample.html)
- [Audio encode
example](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/gst-audio-encode-example-without-flac.html)
Note
To check the GStreamer app for different chipsets, see [Source information for multimedia sample applications](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/example-applications.html#multimedia-sample-applications).
GStreamer is an open source multimedia framework. Qualcomm provides
GStreamer plug-ins as part of the Qualcomm IM SDK.
### GStreamer plugins
- GStreamer plug-ins for audio decoder and encoder are part of Qualcomm IM SDK.
Download the entire Qualcomm IM SDK to use
[pulsesrc](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/pulsesrc.html)
and
[pulsesink](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/pulsesink.html).
- The [Qualcomm IM SDK Quick Start
Guide](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-51/introduction.html)
describes how to download and build the Qualcomm IM SDK.
### GStreamer sample apps
[Sample GStreamer apps for
audio](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/audio-sample-applications.html)
use cases are part of the Qualcomm IM SDK. Before running sample apps, meet
these [prerequisites](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/example-applications.html).
Run audio use cases with either command line or the GST app.
#### Play and record audio with the Gstreamer app
Use command line to run `gst-launch-1.0` for [audio playback/capture](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-50/audio-use-cases.html).
Note
For QCS8275, enable playback and record using `dac_mer_testapp` as described in [Enable audio](https://docs.qualcomm.com/doc/80-70020-16/topic/enable-audio.html#enable-audio).
## Enable audio with PulseAudio
### PulseAudio record
>
>
> Tab QCS6490
> Tab IQ-9075
> Tab IQ-8275
>
> - *class* tabincludedirective
>
> - 1. Set up PulseAudio recording:
>
>
> parec -v --rate=48000 --format=s16le --channels=1 --file-format=wav /opt/test.wav --device=regular2
> Copy to clipboard
>
>
> The command shell should resemble the following:
>
> 
> 2. Select Ctrl + C to stop the recording.
>
>
> Supported formats are `s16le`, `s24le`, `s32le`, `s24-32le`, rate
> can be `8000`, `16000`, `22050`, `24000`, `32000`, `44100`,
> `48000`, `88200`, `96000`, `176400`, `192000`, `352800`,
> `384000`, `705600`, and `768000`, and channels can range from `1` to a maximum of `8`.
>
> - *class* tabincludedirective
>
> - 1. Set up PulseAudio recording:
>
>
> parec -v --rate=48000 --format=s16le --channels=1 --file-format=wav /opt/test.wav --device=regular2
> Copy to clipboard
>
>
> The command shell should resemble the following:
>
> 
> 2. Select **Ctrl + C** to stop the recording.
>
>
> Supported formats are `s16le`, `s24le`, `s32le`, `s24-32le`, rate
> can be `8000`, `16000`, `22050`, `24000`, `32000`, `44100`,
> `48000`, `88200`, `96000`, `176400`, `192000`, `352800`,
> `384000`, `705600`, and `768000`, and channels can range from `1` to a maximum of `4`.
>
> - *class* tabincludedirective
>
> - 1. To start a playback or record use case, configure the Mercury Codec and DAC.
>
>
> Enable playback and capture:
>
>
> ssh root@ip-addr
> dac_mer_testapp
> Copy to clipboard
> 2. Select option 2 (SOC Mercury) followed by 1 (Enable Playback Setup) for playback and record use cases.
> 3. Run the following commands in a new command shell:
>
>
> ssh root@ip-addr
> parec -v --rate=48000 --format=s16le --channels=1 --file-format=wav /opt/test.wav --device=regular2
> Copy to clipboard
>
>
> The command shell should resemble the following:
>
> 
> 4. Select Ctrl + C to stop the recording.
>
>
> Supported formats are `s16le`, `s24le`, `s32le`, `s24-32le`, rate
> can be `8000`, `16000`, `22050`, `24000`, `32000`, `44100`,
> `48000`, `88200`, `96000`, `176400`, `192000`, `352800`,
> `384000`, `705600`, and `768000`, and channels can range from `1` to a maximum of `4`.
### Volume settings for recording
>
>
> Tab QCS6490
> Tab IQ-9075
> Tab IQ-8275
>
> - *class* tabincludedirective
>
> - 1. Start audio capture using the `parec` utility.
> 2. Open a new command prompt in parallel. Open `ssh root@ip-addr` and
> run the following command to set the volume level:
>
>
> pactl set-source-volume regular2
> Copy to clipboard
>
>
> `` varies from 0 to 65535.
>
> - *class* tabincludedirective
>
> - 3. Start capture using the `parec` utility.
> 4. Open a new command prompt in parallel. Open `ssh root@ip-addr` and
> run the following commands:
>
>
> pactl set-source-volume regular2
> Copy to clipboard
>
>
> `` varies from 0 to 65535.
>
> - *class* tabincludedirective
>
> - 5. Start capture using the `parec` utility.
> 6. Open a new command prompt in parallel. Open `ssh root@ip-addr` and
> run the following commands:
>
>
> pactl set-source-volume regular2
> Copy to clipboard
>
>
> `` varies from 0 to 65535.
### PulseAudio playback
>
>
> Tab QCS6490
> Tab IQ-9075
> Tab IQ-8275
>
> - *class* tabincludedirective
>
> - 1. Push the .wav audio file to the device for playback:
>
>
> scp test.wav root@[ip-addr]:/opt/
> Copy to clipboard
> 2. After pushing the test.wav file, enter the device shell using
> `ssh root@ip-add`.
> 3. Start playback:
>
>
> paplay /opt/test.wav -v
> Copy to clipboard
>
>
> The command shell should resemble the following:
>
> 
>
> - *class* tabincludedirective
>
> - 1. Push the .wav file to the device:
>
>
> scp test.wav root@[ip-addr]:/opt/
> Copy to clipboard
> 2. After pushing the test.wav file, enter the device shell using
> `ssh root@ip-add`.
> 3. Start playback:
>
>
> paplay /opt/test.wav -v
> Copy to clipboard
>
>
> The command shell should resemble the following:
>
> 
>
> - *class* tabincludedirective
>
> - 1. Push the .wav file to the device:
>
>
> scp test.wav root@[ip-addr]:/opt/
> Copy to clipboard
> 2. After pushing the test.wav file, enter the device shell using
> `ssh root@ip-add`.
> 3. Use the following command for playback:
>
>
> paplay /opt/test.wav -v
> Copy to clipboard
>
>
> The command shell should resemble the following:
>
> 
### Volume settings for playback
>
>
> Tab QCS6490
> Tab IQ-9075
> Tab IQ-8275
>
> - *class* tabincludedirective
>
> - 1. Start audio playback on the speakers using the `paplay` utility.
> 2. Open a new command prompt in parallel. Open `ssh root@ip-addr` and
> run the following commands to set the volume level:
>
>
> pactl set-sink-volume low-latency0
> Copy to clipboard
>
>
> `` varies from 0 to 65535.
>
> - *class* tabincludedirective
>
> - 1. Start playback on speaker using the `paplay` utility.
> 2. Open a new command prompt in parallel. Open `ssh root@ip-addr` and
> run the following commands:
>
>
> pactl set-sink-volume low-latency0
> Copy to clipboard
>
>
> `` varies from 0 to 65535.
>
> - *class* tabincludedirective
>
> - 1. Start playback on speaker using the `paplay` utility.
> 2. Open a new command prompt in parallel. Open `ssh root@ip-addr` and
> run the following commands:
>
>
> pactl set-sink-volume low-latency0
> Copy to clipboard
>
>
> `` varies from 0 to 65535.
PulseAudio is a general purpose sound server. It runs as
middleware between applications and hardware devices.
Find the source code for PulseAudio at
`build-qcom-wayland/workspace/sources/pulseaudio`.
This section lists commonly used PulseAudio APIs. See the
[open source PulseAudio
documentation](https://www.freedesktop.org/software/pulseaudio/doxygen/index.html)
for a complete description of all APIs .
For more information, see the [PulseAudio
API](https://www.freedesktop.org/software/pulseaudio/doxygen/simple_8h.html)
documentation
### pa\_stream\_new
Creates a new, unconnected stream with the specified name and sample
type.
pa_stream* pa_stream_new (
pa_context * c,
const char *name,
const pa_sample_spec * ss,
const pa_channel_map *map)
Copy to clipboard
**Parameter**
| c | Context in which to create the stream. |
| --- | --- |
| name | Stream name. |
| ss | Sample format. |
| map | Channel map. NULL for default. |
**Return value**
[pa_stream](https://freedesktop.org/software/pulseaudio/doxygen/stream_8h.html#a960d798980692a2ff01e5a70553d4f29)\*
handle
### pa\_stream\_get\_state
Returns the current stream state.
pa_stream_state_t pa_stream_get_state(
const pa_stream *p)
Copy to clipboard
**Parameters**
| p | pa\_stream handle. |
| --- | --- |
**Return value**
Returns the
[pa_stream_state_t](https://freedesktop.org/software/pulseaudio/doxygen/def_8h.html#a750e398d2ce663b858c87d8aa2f81eaa)
### pa\_stream\_get\_device\_name
Returns the sink or source name this stream connects to in
the server.
const char* pa_stream_get_device_name(const pa_stream *s)
Copy to clipboard
**Parameters**
| s | pa\_stream handle. |
| --- | --- |
**Return value**
Device name
### pa\_stream\_connect\_playback
Connects the stream to a sink.
int pa_stream_connect_playback (
pa_stream * s,
const char * dev,
const pa_buffer_attr *attr,
pa_stream_flags_t flags,
const pa_cvolume *volume,
pa_stream *sync_stream)
Copy to clipboard
**Parameter**
| s | Stream to connect to a sink. |
| --- | --- |
| dev | Sink name to which to connect. NULL to let the server decide. |
| attr | Buffering attributes. NULL for default. |
| flags | More flags. 0 for default. |
| volume | Initial volume. NULL for default. |
| sync\_stream | Synchronize this stream with the specified one. NULL for a standalone stream. |
**Return value**
Returns zero on success.
### pa\_stream\_connect\_record
Connects the stream to a source.
int pa_stream_connect_record(
pa_stream *s,
const char * dev,
const pa_buffer_attr * attr,
pa_stream_flags_t flags)
Copy to clipboard
**Parameters**
| s | Stream to connect to a source. |
| --- | --- |
| dev | Source name to which to connect. NULL to let the server decide. |
| attr | Buffer attributes. NULL for default. |
| flags | More flags. 0 for default. |
**Return value**
Returns zero on success.
### pa\_stream\_write
Writes data to the server for playback streams.
int pa_stream_write(
pa_stream * p,
const void * data,
size_t nbytes,
pa_free_cb_t free_cb,
int64_t offset,
pa_seek_mode_t seek)
Copy to clipboard
**Parameters**
>
>
> | p | Stream to use. |
> | --- | --- |
> | data | Data to write. |
> | nbytes | Data length to write in bytes. Must be in multiples of the stream’s sample specification frame size. |
> | free\_cb | Data clean-up routine. NULL to request an internal copy. |
> | offset | Seeking offset. Must be 0 for upload streams. Must be in multiples of the stream’s sample specification frame size. |
> | seek | Seek mode. Must be PA\_SEEK\_RELATIVE for upload streams. |
**Return value**
Returns zero on success.
### pa\_stream\_set\_write\_callback
Sets the callback function that’s called when new data can write
to the stream.
void pa_stream_set_write_callback(
pa_stream * p,
pa_stream_request_cb_t cb,
void *userdata)
Copy to clipboard
**Parameters**
| p | Stream to use. |
| --- | --- |
| cb | Callback function to set. |
| userdata | User data to send to callback. |
**Return value**
None
### pa\_stream\_set\_read\_callback
Sets the callback function that’s called when new data is available
from the stream.
void pa_stream_set_read_callback(
pa_stream * p,
pa_stream_request_cb_t cb,
void *userdata)
Copy to clipboard
**Parameters**
| p | Stream to use. |
| --- | --- |
| cb | Callback function to set. |
| userdata | User data to send to callback. |
**Return value**
None
### pa\_stream\_disconnect
Disconnects a stream from a source/sink.
int pa_stream_disconnect(pa_stream *s)
Copy to clipboard
**Parameters**
| s | pa\_stream handle. |
| --- | --- |
**Return value**
Returns zero on success.
For more information, see the [PulseAudio
API](https://freedesktop.org/software/pulseaudio/doxygen/stream_8h.html)
documentation.
Last Published: Jan 07, 2026
[Previous Topic
Audio overview](https://docs.qualcomm.com/bundle/publicresource/80-70020-16/topics/overview.md) [Next Topic
Customize audio use case](https://docs.qualcomm.com/bundle/publicresource/80-70020-16/topics/customize.md)