LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 12-03-2021, 05:22 AM   #1
vladimir1986
Member
 
Registered: Jul 2011
Posts: 111

Rep: Reputation: Disabled
Remembering mic settings with pulseaudio


Hi there. Just to know if there is some way of sorting out a small nuissance I encounter every time I got a zoom class.

My laptop has a very handy mic on/off switch which I rather use than the software mute/unmute controls.
I found the volume soft spot (let's say that on my laptop is 40%) for the mic, between "I can't hear you" and "my ears are bleeding". However, pulseaudio defaults to 22%, which is "did I heard something?".

So, first time I want to talk, I need to manually select the desired volume, then mute the mic when I finished and wait for next time I need to talk...

Now, there is a random chance the volume will revert back to 20%, forcing me to increase manually again this is no constant and it might as well stay at the volume I did set it up.

My question: Is there any way of making it remember your desired values, like you can do with alsa?
 
Old 12-03-2021, 07:01 AM   #2
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: debian IceWM
Posts: 5,613

Rep: Reputation: Disabled
you could create 2 simple /usr/local/bin files that are executable.....do not change pulseaudio we will ignore it.
the contents will vary but let me give you an idea.

Code:
amixer scontents
look for your capture name.

eg my output
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 65536
Mono:
Front Left: Playback 39977 [61%] [on]
Front Right: Playback 39977 [61%] [on]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 65536
Front Left: Capture 15247 [23%] [on]
Front Right: Capture 15247 [23%] [on]

so before making a script the command could be but I have a tower and can have 2 inputs for front mic
Code:
 amixer sset 'Capture',0 100%,100%
my output
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 65536
Front Left: Capture 65536 [100%] [on]
Front Right: Capture 65536 [100%] [on]

Naturally I expect you to drop the second one.

Then adjust the command until your % with no change to pulseaudio is correct. Lets say its 50%

2) so contents of script one would be
Quote:
#!/bin/sh
amixer sset 'Capture',0 50%
3) then when you finish session...rerun the command to work out a second %

####

Your control name is likely not mine so change to suit please

If your mic is currently muted then you will need another command to unmute it...but your original post suggests that is not an issue?

4) you could then create keyboard shortcuts to execute script 1 and 2
or create desktop entries so you click desktop icons to do the same thing if you somehow do not like kb shortcuts

Last edited by aus9; 12-03-2021 at 07:08 AM.
 
Old 12-03-2021, 11:45 AM   #3
enigma9o7
Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 882

Rep: Reputation: 325Reputation: 325Reputation: 325Reputation: 325
Quote:
Originally Posted by vladimir1986 View Post
Now, there is a random chance the volume will revert back to 20%, forcing me to increase manually again this is no constant and it might as well stay at the volume I did set it up.

My question: Is there any way of making it remember your desired values, like you can do with alsa?
I have the same problem, but worse, on my desktop with an external usb webcam/mic combo thing. The mic gain in pavu defaults below 0db which shuts off mic completely. I have to always turn it up to 0db for meetings, and it turns itself back down by itself later. For google meets in chrome, I found an add-on to keep it from turning down during meeting (as last year my kid was using that for school), automatic gain control blocker or something. But for the standalone zoom app, dunno, I just manually set it every time (with an alsamixer command in a script like other post suggested - which I also have run at startup, which doesn't help much as something keeps turning it back down).

I hope you find a better solution and will be watching this thread for ideas for my own issue too!

Last edited by enigma9o7; 12-03-2021 at 11:49 AM.
 
Old 12-03-2021, 04:32 PM   #4
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: debian IceWM
Posts: 5,613

Rep: Reputation: Disabled
Quote:
which I also have run at startup
I know you are not the OP but a quite a few DE/WM have autostart sections that allow for automation.

eg IceWM I have .icewm/startup....where nl is a usr/local/bin script
Quote:
!#/bin/sh

pcmanfm --desktop &
nm-applet &
nl &
firefox &
volumeicon &
 
Old 12-03-2021, 05:23 PM   #5
vladimir1986
Member
 
Registered: Jul 2011
Posts: 111

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by aus9 View Post
you could create 2 simple /usr/local/bin files that are executable.....do not change pulseaudio we will ignore it.
the contents will vary but let me give you an idea.

Code:
amixer scontents
look for your capture name.

eg my output
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 65536
Mono:
Front Left: Playback 39977 [61%] [on]
Front Right: Playback 39977 [61%] [on]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 65536
Front Left: Capture 15247 [23%] [on]
Front Right: Capture 15247 [23%] [on]

so before making a script the command could be but I have a tower and can have 2 inputs for front mic
Code:
 amixer sset 'Capture',0 100%,100%
my output
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 65536
Front Left: Capture 65536 [100%] [on]
Front Right: Capture 65536 [100%] [on]

Naturally I expect you to drop the second one.

Then adjust the command until your % with no change to pulseaudio is correct. Lets say its 50%

2) so contents of script one would be


3) then when you finish session...rerun the command to work out a second %

####

Your control name is likely not mine so change to suit please

If your mic is currently muted then you will need another command to unmute it...but your original post suggests that is not an issue?

4) you could then create keyboard shortcuts to execute script 1 and 2
or create desktop entries so you click desktop icons to do the same thing if you somehow do not like kb shortcuts
That is an idea. Interesting, but my Mic is also 'Capture',0.

amixer sset 'Capture',0 100% 100% Sets it to 32% on the pulseaudio mixer, which is a bit odd, but just enough. It means I just need to speak a tad bit higher than usual

At the same time, messing up with the settings in Zoom I realize there is an option which was ticked which said: "adjust automatically the input volume". Now I am suspicious that was the main issue. Zoom in Linux is pretty bad!

The making a script idea is good, maybe I could pipe it out to the "unmute mic" key... I am using Plasma at the moment, so it shouldn't be difficult. Using I3 or similar should be even easier.

Tomorrow morning I am going to fire up any reocrding application and see if I can reproduce my problem. As I said, it might be zoom and not Pulse/Alsa problem!
 
Old 12-03-2021, 09:11 PM   #6
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: debian IceWM
Posts: 5,613

Rep: Reputation: Disabled
I have not used KDE/plasma in years. But I recall phonon and now there appears to be something called plasmashell.

the link below is not directly related to your mic issue but focus on some of the plasmashell stuff. Do not blame zoom so quickly?

https://forums.gentoo.org/viewtopic-...fb044081b72946

^ see the log under "This is the new log:"

that looks like some of kind of extra daemon layer....so harder to trouble shoot.

I would be tempted to say go to something simple
 
Old 12-05-2021, 01:08 PM   #7
vladimir1986
Member
 
Registered: Jul 2011
Posts: 111

Original Poster
Rep: Reputation: Disabled
There is many weird stuff that goes with KDE. PE: When I am at uni, I can only connect to the Eduroam network under KDE. It doesn´t matter if I set up NetworkManager, straight away wpa supplicant, or anything. Only works in KDE (so same distro with different DE won't be able to connect). Same with some bluetooth... dunno, I always found odd. In any case I wouldn't be surprised if that was a KDE Issue. Maybe next time I'll use I3, or Wmaker and see if that makes a difference
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
K3b settings help, file previer and remembering last iso Whiskers Linux - Software 0 11-26-2004 05:32 PM
Remembering window settings in OpenBox LavaDevil94 Linux - Software 0 11-21-2004 12:33 PM
xfce sound mixer not remembering settings killerbob Slackware 5 10-30-2004 04:22 PM
Red Hat 9 having difficulty remembering its internet settings. flapjackboy Linux - Networking 6 08-11-2003 01:16 PM
Remembering network settings ShakyJake Linux - Newbie 5 04-13-2003 10:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration