loading

Introduction

After installing the USB Sound Card, I turned the volume knob and i had no effect on the audio level. On further investigation, I discovered that although this particular sound card has a hardware volume contol, the Sound Blaster X-Fi Surround 5.1 Pro sound card does NOT provide any hardware mixer. A solution to this problem is to create a "software" volume control.

Scope

This instructable will cover the following:

  • Discover whether the sound card provide hardware mixing.
  • Create a software volume control for UNSUPPORTED the hardware mixer of the sound card
  • Use ALSA utilities to test sound card and sound device

This instructables will NOT cover the following

  • PulseAudio
  • Open Sound System (OSS)

Specifications

My Raspberry Pi:

  • Raspberry Pi 2 model Raspbian based on Debian Version 8.0 (a.k.a Jessie)
  • Advanced Linux Sound Architecture Driver Version k4.1.10-v7+
  • Pulse Audio and OSS are NOT installed
  • 2 speakers connected to Raspberry Pi's audio/video 3.5mm socket.

Step 1: Test Whether Sound Card and Speakers Work

Step 2: Check Whether ALSA Creatd a Hardware Volume Control

Open terminal:

alsamixer

There is no volume control as shown in the screenshot. That means hardware mixer is not supported by the sound card. Bummer!

Step 3: Create a Software Volume Control

ALSA provides a "software" volume control in our case.

Open terminal

cd

To simplify this step, start with a fresh blank .asoundrc file. Backup the current .asoundrc file if you have them

mv .asoundrc asoundrc.bk
vi .asoundrc

Enter the lines as shown in the screenshot.

Save the file.

Step 4: Test Software Volume Control

Open terminal:

speaker-test -twav -c2

Open another terminal:

alsamixer

Refer to screenshot. A new bar called "Master" appears. Use the "UP" and "Down" Arrow key to control the volume.

The loudness of the sound should vary.

This "software" volume control only works in software. The volume knob on my sound card is not able to control the "software" volume control.

<p>For copy/paste instead of typing it in. Formatting got clobber on the paste.</p><p>pcm.volume {</p><p>type softvol</p><p>slave {</p><p> pcm &quot;surround51&quot;</p><p>}</p><p>control {</p><p>name &quot;Master&quot;</p><p>card 0</p><p>}</p><p>hint {</p><p> show {</p><p> @func refer</p><p> name defaults.namehint.extended</p><p> }</p><p> description &quot;Software Volume Control &quot;</p><p>}</p><p>}</p><p>pcm.!default {</p><p>type plug# with a plug device, so rate is converted automatically</p><p>slave {</p><p> pcm &quot;volume&quot;</p><p>}</p><p>hint {</p><p> show {</p><p> @func refer</p><p> name defaults.namehint.extended</p><p> }</p><p> description &quot;Playback in Surround 5.1 &quot;</p><p>}</p><p>}</p>

About This Instructable

4,181views

5favorites

Bio: Systems Administrator and Software Programmer.
More by mirza irwan osman:Install Modem USB Device in Raspberry Pi Make the Volume Knob of Sound Blaster X-Fi Surround 5.1 Pro Sound Card Work in Raspberry Pi Create a Volume Control for USB Sound Card in Raspberry Pi 
Add instructable to: