You are not logged in.

#1 2020-05-01 08:30:54

sf666
Member
Registered: 2020-05-01
Posts: 1

restore USB DAC audio volume after plugin

Hi there,

I've one issue with my USB audio.

1) USB DAC is connected to an USB port (card0)

card 0: Audio [McIntosh HD USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: SPDIF [Integrated SPDIF], device 0: S/PDIF PCM snd-soc-dummy-dai-0 [S/PDIF PCM snd-soc-dummy-dai-0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 2: DWHDMI [DW-HDMI], device 0: DW HDMI [dw-hdmi-ahb-audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

2) setting audio volume with alsamixer to -6 db for card0

3) power off USB DAC. The card disappears

4) Power on USB DAC. The card is online again

5) USB DAC volume is at -30db (probably default)

Question:

is it possible to restore the volume to the original value before unplugging (-6db) the device? alsa-restore daemon seems not to work in this case?!

cheers

sf

Offline

#2 2020-05-01 09:52:32

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: restore USB DAC audio volume after plugin

I've never tried this but you can probably create a udev rule to adjust the volume on device plugin. You can create a script to call to adjust the volume (i.e. amixer set Master 50%) when udev senses the USB device is plugged in.
https://wiki.archlinux.org/index.php/Udev
Others in the forum might have better or simpler ideas but this could be a workaround.

Offline

#3 2020-05-01 10:15:05

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,230

Re: restore USB DAC audio volume after plugin

Does the card index change? Did you actively store the volume change with a

sudo alsactl store

beforehand? Or are you actually and actively using the restore daemon?

systemctl status alsa-restore.service alsa-state.service

Offline

Board footer

Powered by FluxBB