Hardware volume control (Cirrus Logic CS4398 DAC)

General discussion about RuneAudio. Do not post any support or feature requests here.

Hardware volume control (Cirrus Logic CS4398 DAC)

Postby The Setlaz » 12 Jun 2015, 21:41

Hi guys,

I'm running RuneAudio on my Raspberry Pi 2 connected to USB DAC (Marantz SA KI Perl Lite - equipped with a Cirrus Logic CS4398 DAC) that supports hardware volume control.

I'm able to change the volume using Alsamixer volume control on the RPI2, however in RuneUI, setting the volume control to "enabled - Hardware" in RuneUI translates into changing the volume of the SoC output (bcm2835) rather the volume of the sound card being used. (hence doing nothing to the actual volume)

Is there something to do to "bind" the volume knob to the sound card being actually used?

Also I noticed with the bcm2835, the volume knob value is not a 1-to-1 mapping to the Alsamixer PCM value
RuneUI: 0 -> 2 AlsamixerPCM (dB Gain -102.37dB)
RuneUI: 10 -> 3 Alsamixer PCM (dB Gain -91.73dB)
RuneUI: 20 -> 4 Alsamixer PCM (dB Gain -81.09dB)
RuneUI: 40 -> 9 Alsamixer PCM (dB Gain -59.81dB)
RuneUI: 60 -> 20 Alsamixer PCM (dB Gain -38.54dB)
RuneUI: 80 -> 44 Alsamixer PCM (dB Gain -17.26dB)
RuneUI: 100 -> 100 Alsamixer PCM (dB Gain +4.00dB)

RuneUI is more in a 1 step = 1dB while Alsamixer has a completely different slope. What is the reason behind that?

Thanks !
The Setlaz
The Setlaz
 
Posts: 17
Joined: 12 Jun 2015, 13:46

Re: Hardware volume control

Postby hondagx35 » 13 Jun 2015, 01:21

Hi Setlaz,

please search the forum for this topic it is discussed multiple times.

Then go to the console and find the card number for your DAC from this command:
Code: Select all
aplay -l

Code: Select all
[root@runeaudio http]# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sunxisndspdif [sunxi-sndspdif], device 0: SUNXI-SPDIF sndspdif-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: sunxisndi2s [sunxi-sndi2s], device 0: SUNXI-I2S sndi2s-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: sunxisndhdmi [sunxi-sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 4: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Here it would be card 4.

Then post the output from:
Code: Select all
amixer -c 4

Use your number.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Hardware volume control

Postby The Setlaz » 14 Jun 2015, 19:11

Hi Frank,

Thanks for helping on this!

Here's what returns aplay -l command
Code: Select all
[root@runeaudio ~]# aplay -l     
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  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 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [DigiHug USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [DigiHug USB Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


Not quite sure why the card is listed twice.

When typing amixer -c 1, I get:
Code: Select all
[root@runeaudio ~]# amixer -c 1
Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 110
  Mono:
  Front Left: Playback 110 [100%] [0.00dB] [on]
  Front Right: Playback 110 [100%] [0.00dB] [on]
Simple mixer control 'PCM Capture Source',0
  Capabilities: enum
  Items: 'Line' 'IEC958 In'
  Item0: 'Line'
Simple mixer control 'Line',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 104
  Front Left: Capture 80 [77%] [0.00dB] [on]
  Front Right: Capture 80 [77%] [0.00dB] [on]



Thanks again!
The Setlaz
 
Posts: 17
Joined: 12 Jun 2015, 13:46

Re: Hardware volume control

Postby hondagx35 » 15 Jun 2015, 21:19

Hi The Setlaz,

please try this:
- update
- set volume to hardware
- reboot

Frank

If the update does not work (ERROR: your local changes.....) then try:
Code: Select all
cd /srv/http
git stash
git pull
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Hardware volume control (Cirrus Logic CS4398 DAC)

Postby The Setlaz » 15 Jun 2015, 23:46

Hi Frank,

Thanks for the update!
It pulled the changes through
Code: Select all
Update RuneUI
RuneUI updated successfully
From https://github.com/RuneAudio/RuneUI
38c91fc..35c8c70 dev -> origin/dev
Updating 38c91fc..35c8c70
Fast-forward
db/redis_acards_details | 2 ++
1 file changed, 2 insertions(+)


However, after reboot, the volume knob still affect the SoC and not the DAC output.
I checked the lines you added on GitHub, that seemed to correct to me though :?

PS: When I tried to reboot, I got the following error message
Code: Select all
Warning
The loading layer (spinning arrows) points to a socket error

So I just disconnected the supply...
PS2: Thanks for updating the topic name!
The Setlaz
 
Posts: 17
Joined: 12 Jun 2015, 13:46

support RuneAudio Donate with PayPal


Return to General discussion

Who is online

Users browsing this forum: No registered users and 10 guests