#1 ALSA Module not working

Closed
opened 4 years ago by Ghost · 5 comments
Ghost commented 4 years ago

Hi I am on Arch Linux. I use alsa with pulseaudio. I am using it and I found volume_perc not working properly. I tried it with make AUDIO=ALSA but it is partially working. It only shows the 'muted' when the master is Muted, but when not muted volume is shown not correctly (always 0%). I could not figure out why it is happening.

Hi I am on Arch Linux. I use alsa with pulseaudio. I am using it and I found volume_perc not working properly. I tried it with make AUDIO=ALSA but it is partially working. It only shows the 'muted' when the master is Muted, but when not muted volume is shown not correctly (always 0%). I could not figure out why it is happening.
dm9pZCAq commented 4 years ago
Owner

thank you for issue!

high cpu usage is because you rerun command every N second instead of every volume change

i will see what can i do to fix it

so can you please show me output of these command:

amixer get Master
thank you for issue! high cpu usage is because you rerun command every `N` second instead of every volume change i will see what can i do to fix it so can you please show me output of these command: ```sh amixer get Master ```
Ghost commented 4 years ago
Poster

Here is the output of ammixer get Master

> amixer get Master
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 26216 [40%] [on]
  Front Right: Playback 26216 [40%] [on]

Also here is the list of my sound devices

> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: Generic Analog [Generic Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

What I found that the specific line in components/volume.c that reads the value of current volume is returning no value

if (is_muted()) {
   bprintf(volume, "%s", MUTED);
} else {
   snd_ctl_elem_read(ctl, control); 
   vol = snd_ctl_elem_value_get_integer(control, 0); <------ This returns no value
   vol = rint((double)vol / (double)range * 100);
   bprintf(volume, "%s",
                    SYM,
                    vol * (range > 0),
                    PERCENT);
Here is the output of `ammixer get Master` ``` > amixer get Master Simple mixer control 'Master',0 Capabilities: pvolume pswitch pswitch-joined Playback channels: Front Left - Front Right Limits: Playback 0 - 65536 Mono: Front Left: Playback 26216 [40%] [on] Front Right: Playback 26216 [40%] [on] ``` Also here is the list of my sound devices ``` > aplay -l **** List of PLAYBACK Hardware Devices **** card 0: PCH [HDA Intel PCH], device 0: Generic Analog [Generic Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4] Subdevices: 1/1 Subdevice #0: subdevice #0 ``` What I found that the specific line in `components/volume.c` that reads the value of current volume is returning no value ``` if (is_muted()) { bprintf(volume, "%s", MUTED); } else { snd_ctl_elem_read(ctl, control); vol = snd_ctl_elem_value_get_integer(control, 0); <------ This returns no value vol = rint((double)vol / (double)range * 100); bprintf(volume, "%s", SYM, vol * (range > 0), PERCENT); ```
dm9pZCAq commented 4 years ago
Owner

ok, thank you

i'll fix it soon

ok, thank you i'll fix it soon
dm9pZCAq commented 4 years ago
Owner
[should be fixed](commit/70cefa5fa93abfe3c6727040a25516e66c1c08df)
Ghost commented 4 years ago
Poster

Thanks. It's working now.

Thanks. It's working now.
Sign in to join this conversation.
No Label
bug
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.