Skip to main content
This section shows how to configure hardware for microphone and speaker connections and gives steps to verify basic audio use cases.

Hardware setup

Setup Flow

Setup Flow

Prerequisites
  • Set up your infrastructure as described in the Qualcomm Linux Build Guide
  • 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.
    2. Connect to the device by running the following command:
      ssh root@<device_IP_address>
      
      For example, if the IP address of the device is 10.92.160.222, run the following command:
      ssh root@10.92.160.222
      
Set up audio hardware
  1. To activate the digital microphone interface (DMIC) on the board, use DIP Switch PIN 2 to the ON position.
Setup Flow

Setup Flow

  1. Connect the speaker to the board as follows.
Setup Flow

Setup Flow

Enable audio with GStreamer

To decode audio using GStreamer apps, see the following. To encode audio using GStreamer apps, use the following instructions.
  • Set the default input device for PipeWire. Use the wpctl status command to list available nodes. Run wpctl set-default to set the source node to the handset mic.
    systemctl stop pipewire wireplumber pipewire.socket pipewire-manager.socket
    
    chmod 777 /dev/dma_heap/system
    
    systemctl start pipewire wireplumber
    
    wpctl status
    
    wpctl set-default <sink/source node ID>
    
  • Audio encode example
To check the GStreamer app for different chipsets, see Source information for multimedia sample applications.
GStreamer is an open source multimedia framework. Qualcomm provides GStreamer plug-ins as part of the Qualcomm IM SDK.

GStreamer plug-ins

GStreamer sample apps

Sample GStreamer apps for audio use cases are part of the Qualcomm IM SDK. Before running sample apps, meet these prerequisites. Run audio use cases with either command line or the GST app.

Play and record audio with the GStreamer app

Use the reference GST commands mentioned in audio playback/capture.

Enable audio with PipeWire

PipeWire is a graph-based processing framework that handles multimedia data. Find the source code for PipeWire at build-qcom-wayland/workspace/sources/pipewire. For more information, see the PipeWire open source documentation for detailed APIs available.
The pw-play and pw-record utilities in this guide demonstrate .wav file usage. PipeWire as a framework supports additional formats depending on available codecs and plugins.

PipeWire record

  1. Set up PipeWire recording: Use the wpctl status command to list available nodes. Run wpctl set-default to set the source node to the handset mic.
    systemctl stop pipewire wireplumber pipewire.socket pipewire-manager.socket
    
    chmod 777 /dev/dma_heap/system
    
    systemctl start pipewire wireplumber
    
    wpctl status
    
    wpctl set-default <sink/source node ID>
    
    pw-record --rate=48000 --format=s16 --channels=2 /opt/test.wav -v
    
    The command shell should resemble the following:
  2. Select Ctrl + C to stop the recording. Supported formats are s16le, s24le, s32le, 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.

Volume settings for recording

  1. Start audio capture using the pw-record utility.
  2. Open a new command prompt in parallel. Open ssh root@ip-addr and run the following command to set the volume level:
    wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.8
    
    In the above command, a value of 0.8 represents 80% volume. Adjust this value according to the desired volume level.

PipeWire playback

  1. Push the .wav audio file to the device for playback:
    scp test.wav root@[ip-addr]:/opt/
    
  2. After pushing the test.wav file, enter the device shell using ssh root@ip-addr.
  3. Set the default sink mode for playback using the below command and choose between two sink modes: one for low latency (LL) and another for deep buffer (DB).
    systemctl stop pipewire wireplumber pipewire.socket pipewire-manager.socket
    
    chmod 777 /dev/dma_heap/system
    
    systemctl start pipewire wireplumber
    
    wpctl status
    
    wpctl set-default <sink/source node ID>
    
  4. Use the following command to start playback:
    pw-play /opt/test.wav -v
    
    The command shell should resemble the following:

Volume settings for playback

  1. Start audio playback on the speakers using the pw-play utility.
  2. Open a new command prompt in parallel. Open ssh root@ip-addr and run the following commands to set the volume level:
    wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.8
    
    In the above command, a value of 0.8 represents 80% volume. Adjust this value according to the desired volume level.

Next steps