alsamixer controls

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
melhadden

alsamixer controls

Post by melhadden »

Hi,
this problem isn't specific to me only, it's a BIG DEAL around the world. everyone I've talked to using a form of linux has the same problem.
People are losing their hearing. I have 2 blown BOSE speakers sitting in my closet. When an advertisement or a video comes on that has uncontrolled sound output, my speakers try to fly to the moon and they would if not screwed into the wall. I will not use headphones because of this problem. This is a SERIOUS problem and is a hazard to human health ! DEAD SERIOUS !!!
My Problem: on session login, alsamixer controls set themselves according to some value stored away in some unknown file.
Is there a way to have alsamixer restore itself on login with settings already stored away nice and neat in another unknown file? At the moment I bring up the terminal and use arrow key $ sudo alsactl restore $ is OK but not what I want. I have tried different suggestions - editing the different rc.local files - anything that pertains to alsa,I have tried, changed, made my routines executable, no success. Putting the routine in the start-up applications, no joy. I don't really know how many times I've boogered linux with all the changes I've made to alsa just trying to get alsamixer to restore to the stored settings on login.... everytime I realize what I did will not work, I re-install linux fresh and start over instead of beating my head against an unmoveable object. I mention the files as being unknown, I don't care where they are, just want to be able to restore alsactl on login without any user input. Been at this for 2-3 months now....... I'm really up-to-speed on these installs :-(

I have been successful editng alsamixer control slider to my listening pleasure and saving the set controls $ sudo alsactl store $ stores the settings and $ sudo alsactl restore $ successfully restores alsamixer back to MY listening levels - NOT the levels attained when a youtube video wants to blow your speakers off the wall - because their PCM signal sent through the website is over driven 200%

$ sudo pluma /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common $
in terminal and changing
[Element PCM]
volume = ignore to volume = ignore ---
kills those over-driven incoming signals from every source except when you test your speakers using sound control or pavucontrol or plug in headphones.
$ sudo alsactl restore $ resets alsamixer back to MY levels, not 100% across the board as it shows when rebooted or a new session begins.

~ $ inxi -Fxz
System: Host: mel-asus Kernel: 3.19.0-32-generic x86_64 (64 bit gcc: 4.8.2)
Desktop: MATE 1.12.0 (Gtk 3.10.8~8+qiana)
Distro: Linux Mint 17.3 Rosa
Machine: Mobo: ASUSTeK model: P8H61-M LE/CSM R2.0 v: Rev x.0x
Bios: American Megatrends v: 1414 date: 09/23/2014
CPU: Dual core Intel Pentium G2120 (-MCP-) cache: 3072 KB
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 12400
clock speeds: max: 3100 MHz 1: 1877 MHz 2: 1657 MHz
Graphics: Card: NVIDIA GF106 [GeForce GTS 450] bus-ID: 01:00.0
Display Server: X.Org 1.17.1 driver: nvidia
Resolution: 1920x1080@60.0hz, 1440x900@59.9hz
GLX Renderer: GeForce GTS 450/PCIe/SSE2
GLX Version: 4.5.0 NVIDIA 352.63 Direct Rendering: Yes
Audio: Card-1 Creative Labs EMU20k2 [X-Fi Titanium Series]
driver: snd_ctxfi bus-ID: 03:00.0
Card-2 NVIDIA GF106 High Definition Audio Controller
driver: snd_hda_intel bus-ID: 01:00.1
Sound: Advanced Linux Sound Architecture v: k3.19.0-32-generic
Network: Card: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
driver: r8169 v: 2.3LK-NAPI port: d000 bus-ID: 04:00.0
IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives: HDD Total Size: 1160.7GB (2.0% used)
ID-1: /dev/sda model: TS128GSSD320 size: 128.0GB
ID-2: /dev/sdb model: Hitachi_HDS72101 size: 1000.2GB
ID-3: USB /dev/sdg model: USB_DISK size: 32.5GB
Partition: ID-1: / size: 114G used: 5.8G (6%) fs: ext4 dev: /dev/sda1
ID-2: swap-1 size: 4.23GB used: 0.00GB (0%) fs: swap dev: /dev/sda5
RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors: System Temperatures: cpu: 51.0C mobo: 27.8C gpu: 0.0:73C
Fan Speeds (in rpm): cpu: N/A
Info: Processes: 164 Uptime: 9 min Memory: 566.5/3894.2MB
Init: Upstart runlevel: 2 Gcc sys: 4.8.4
Client: Shell (bash 4.3.111) inxi: 2.2.28

I have the graphics under control and have setup alsamixer to recognize only the XiFi card. Everything works like a charm except for having to restore alsamixer manually on every session. I've tried to tame this THING on this machine, my wife's computer, and my IBM T61 lapper.
Any help here would really be appreciated.

Mello
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: alsamixer controls

Post by Flemur »

Is there a way to have alsamixer restore itself on login with settings already stored away nice and neat in another unknown file?
Yes! Use "amixer".

Here's a script I run @login to make sure the sound settings are civilized; get the device names from alsamixer columns*, or better yet use "qasmixer". You names and values will likely be different than the below:

Code: Select all

# Turn on:
# Note: with SoundBlaster, setting to 0db mostly doesn't work.
#
amixer set 'Master',0        25%  unmute
amixer set 'Headphone',0    100%  unmute
amixer set 'Headphone',1    100%  unmute
amixer set 'Wave'           100%
amixer set 'Wave Center'    100%
amixer set 'PCM'             23   unmute # 23=0db
amixer set 'Line'            23   unmute # 23=0db
amixer set 'Capture'          0dB unmute
#
amixer set 'Bass'           50%
amixer set 'Treble'         50%
#
amixer set 'Surround'        0 mute
amixer set 'Center'          0 mute
amixer set 'Front'           0 mute
#
# Turn off:
#
amixer set 'LFE',0         0 mute
#
# EOF
You can test your potential settings by trying them out in a terminal while watching alsamixer, e.g.

Code: Select all

amixer set 'Master',0        25%  unmute
and verify that the alsamixer settings change.

* 'Name' vs 'Name',0 vs 'Name',1 see
http://manpages.ubuntu.com/manpages/wil ... xer.1.html
for how to list control names. It's all kinda funky.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
melhadden

Re: alsamixer controls

Post by melhadden »

I am not concerned with amixer. Getting ALSA under control first is the key & I have succeeded doing that very thing on my own - except I have to manually type $ sudo alsactl restore $ in terminal every time I login. What you suggest is open-heart surgery while I'm trying to finish the operation without further bloodshed (figure of speech)

What I have done so far with alsa stops annoyingly loud interruptions from becoming a problem to start with. All I need i a way to restore the settings I already have stored when I login. Can it be done or not? If yes, then exactly how do I go about doing this?
Last edited by melhadden on Sat Jun 04, 2016 5:19 pm, edited 1 time in total.
melhadden

Re: alsamixer controls

Post by melhadden »

I think I have my problem solved.
step 1 take control of your soundcard. Edit analog-output.conf.common file

Code: Select all

sudo pluma /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common

change:
[Element PCM]
volume = merge to volume = ignore
websites use the PCM signal to rape your soundcard when the volume is "merged" with whatever else is going on.
'ignore' stops that from happening. If you don't do this, anything else I type will not matter.
open alsamixer

Code: Select all

 alsamixer 
F6 brings up the soundcards installed. Pick the one you need to control from the list. Press F5 and you are shown all of the controls available.
While listening to - anything - adjust alsamixer sliders to what sounds good to you. Some controls may be muted - there is an "m" at the bottom the control, press 'm' to unmute. Press ESC when done.

save those values

Code: Select all

sudo alsactl --file /var/lib/asound.state store
tell computer not to reload alsa settings

Code: Select all

gksudo pluma /etc/pulse/default.pa
scroll down to line

Code: Select all

load-module module-device-restore
comment out

Code: Select all

#load-module module-device-restore
reboot

Code: Select all

sudo reboot
This will load the control values alsamixer was set at before shutdown or reboot. Headphones plugged in or unplugged on laptops throw alsamixer into chaos and it has to be restored to your settings

Code: Select all

sudo alsactl restore
so.... when you shutdown, reboot or lose power alsa will have controls set exactly where the were before boot.

since I only have 1 device that is affected on boot - my sound card - killing the device load in default.pa --- along with ignoring the PCM signal received from any outside source ( headphones excluded ) works for me :-)
CCC999

Re: alsamixer controls

Post by CCC999 »

Thanks melhadden and Flemur. This helped me through the maze that Mint audio puts users through. As I've built a few PC's and loaded Mint, audio seems to be tougher to figure out. I found I had to ensure the changes were refreshed at startup....this site was the final key:
https://askubuntu.com/questions/50067/h ... r-settings look for an entry by Sergiy Kolodyazhnyy....hope this helps you.
Hoser Rob
Level 20
Level 20
Posts: 11796
Joined: Sat Dec 15, 2012 8:57 am

Re: alsamixer controls

Post by Hoser Rob »

Do you really think audio in Mint is any harder to fathom than it is in any other Linux distro? It isn't.

I've never had any problems with Linux audiop personally but it's a bit of a convoluted mess. I'm still trying to figure out what you actually need pulseaudio for ... for example Lubuntu ships without it and there don't seem to be any issues there.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: alsamixer controls

Post by Flemur »

melhadden wrote:I am not concerned with amixer. Getting ALSA under control first is the key & I have succeeded doing that very thing on my own - except I have to manually type $ sudo alsactl restore $ in terminal every time I login. What you suggest is open-heart surgery while I'm trying to finish the operation without further bloodshed (figure of speech)
What I suggested gets alsa under control without having to manually type anything. Was it too easy?
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Locked

Return to “Sound”