Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] amixer capture command not working
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
vcmota
Guru
Guru


Joined: 19 Jun 2017
Posts: 367

PostPosted: Sun Apr 11, 2021 1:08 pm    Post subject: [SOLVED] amixer capture command not working Reply with quote

Hy everybody. I am having issues with controlling alsamixer from command line using amixer. What I need, and I am failing to get, is a command line using amixer that allow me to toggle the capture of my headset microphone. Before 1 ou 2 years ago, I had one that worked, namelly "amixer set Headphone toggle".

A short background: I use DWM instead of a desktop environment, and I had the simplest setup for the audio, only with the alsamixer installed. It was easy to understand what was being controlled and by whom, specifically with amixer controlling everything. However, 1 or 2 years ago it became mandatory to install pulseaudio in order to have audio in firefox. Although I havent noticed at the time, I suspect that it was when everything became a mess.

I used to have Headphone as a amixer control, such that the command "amixer set Headphone toggle" worked flawlessly. Now it is not there anymore:
Code:

~> amixer controls
numid=4,iface=MIXER,name='Master Playback Switch'
numid=3,iface=MIXER,name='Master Playback Volume'
numid=2,iface=MIXER,name='Capture Switch'
numid=1,iface=MIXER,name='Capture Volume'
~>

When I try instead using "Capture" as amixer control, I receive messages indicating it is woking:
Code:

~> amixer set Capture toggle
Simple mixer control 'Capture',0
  Capabilities: cvolume cvolume-joined cswitch cswitch-joined
  Capture channels: Mono
  Limits: Capture 0 - 65536
  Mono: Capture 65536 [100%] [on]
~> amixer set Capture toggle
Simple mixer control 'Capture',0
  Capabilities: cvolume cvolume-joined cswitch cswitch-joined
  Capture channels: Mono
  Limits: Capture 0 - 65536
  Mono: Capture 65536 [100%] [off]
~>

But it aint working. I installed Cheese to test, and audio keep being captured. I also tryed with Master as amixer control, also without success:
Code:

~> amixer set Master toggle
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 63056 [96%] [off]
  Front Right: Playback 63056 [96%] [off]
~> amixer set Master toggle
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 63056 [96%] [on]
  Front Right: Playback 63056 [96%] [on]
~>

Although muting master really removed all the output audio from the computer, as Cheese has shown the audio from the headset keep being captured. Another aspect of this mess shows up in the command alsamixer, which opens the equalizer. It shows three options for the sound card: default, webcam (when it is connected) and "HDA intel PCH", which I assume is the onboard sound card. Independently of whom is set as the sound card on this interface, nothing is altered by amixer, neither toggling master nor toggling capture. That was surely not the case before installation of pulseaudio. In fact I tested the amixer commands also in the alsamixer interface, and they were affected as they should.

Thank you all for your attention.


Last edited by vcmota on Wed Apr 14, 2021 3:00 am; edited 1 time in total
Back to top
View user's profile Send private message
dbtx
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jan 2020
Posts: 117

PostPosted: Mon Apr 12, 2021 12:16 pm    Post subject: Re: amixer caprture command not working Reply with quote

vcmota wrote:
Independently of whom is set as the sound card on this interface, nothing is altered by amixer


I take it you're hitting F6 in alsamixer to pick the card it's showing & working on. But that's only for itself, and amixer and alsamixer don't directly affect each other. Have you tried running amixer with either -c or -D switches?
Back to top
View user's profile Send private message
vcmota
Guru
Guru


Joined: 19 Jun 2017
Posts: 367

PostPosted: Wed Apr 14, 2021 2:52 am    Post subject: Reply with quote

Thank you dbtx for your reply.

You are correct: I am referring to the f6 in alsamixer.

The problem however has been eliminated, although I am not sure how. In the last couple days I rebuild alsa, alsa-plugins and pulseaudio after revising whether their flags were properly set (there were some flags that I assumed that should have been set and I added them), and revised all the kernel options I have set considering what is suggested in the gentoo wiki. I found out there were some inconsistencies, more specifically some options which should be compiled with the kerrnel were set to be added as module. After all this, recompiling and reinstalling the kernel, the amixer command started to work as expected after a reboot. Now I am able to toggle via amixer in command line not only for Master but also for Capture. I may never know however which was the issue exactly.

Thank you for your attention again!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum