Tiny Core Linux

Tiny Core Extensions => TCE Tips & Tricks => Topic started by: bmarkus on November 28, 2009, 04:43:07 AM

Title: Setting Alsa volume on easy way
Post by: bmarkus on November 28, 2009, 04:43:07 AM
Alsa master channel is muted and volume set to 0 after bootup. To change it I'm using the following commands:

Quote
amixer set Master 80%
amixer set Master unmute

You can add them to your startup script. In LXDE for example add them  to

/home/tc/.config/lxsession/LXDE/autostart

Quote
...
...
@amixer set Master 80%
@amixer set Master unmute

To have more fun

Quote
...
...
@amixer set Master 80%
@amixer set Master unmute
@aplay /home/tc/yourstartupmusic.wav

Title: Re: Setting Alsa volume on easy way
Post by: vinnie on November 29, 2009, 06:51:36 AM
Great tweaks markus ;)
Title: Re: Setting Alsa volume on easy way
Post by: jls on November 29, 2009, 07:49:00 AM
I have in my /opt/.filetool:
etc/asound.state
so I don't need to do what u did, even when I change pc
Title: Re: Setting Alsa volume on easy way
Post by: bmarkus on November 29, 2009, 09:41:20 AM
I have in my /opt/.filetool:
etc/asound.state
so I don't need to do what u did, even when I change pc


On my machine there are no etc/asound.state
Title: Re: Setting Alsa volume on easy way
Post by: jls on November 29, 2009, 09:55:03 AM
sudo alsactl store
Title: Re: Setting Alsa volume on easy way
Post by: bmarkus on November 29, 2009, 10:11:46 AM
sudo alsactl store

This was not in the post :)
Title: Re: Setting Alsa volume on easy way
Post by: Kingdomcome on November 29, 2009, 11:54:01 AM
Info file to the rescue  :P
Quote
If you want your alsa settings to persist across reboots, use the
command 'alsactl store' after alsa has been set up.  This stores the
configuration in /etc/asound.state.  Place this file in your backup to
allow your alsa settings to persist across sessions.
Title: Re: Setting Alsa volume on easy way
Post by: bmarkus on November 29, 2009, 12:34:40 PM
Well, it works. It is a great solution to save "volume 0%, muted". The question is not how to save, but how to setup, see original post :)
Title: Re: Setting Alsa volume on easy way
Post by: Jason W on November 29, 2009, 06:11:47 PM
Adding a sleep command in bootlocal.sh before "/usr/local/etc/init.d/alsasound start" made it restore the settings instead of starting muted.  It evidently is a timing issue with the boot process as some folks have reported success without a sleep command, and myself and others have their sound muted on boot instead of restored. 
Title: Re: Setting Alsa volume on easy way
Post by: jpeters on November 29, 2009, 09:47:15 PM
It's buggy.  I have to turn Master and PCM off and back on after loading the browser.  I've got mine hotkeyed.   
Title: Re: Setting Alsa volume on easy way
Post by: Jason W on December 02, 2009, 04:57:30 AM
Yeah, alsa locks in one app for sound preventing other apps from accessing it.  Sometimes that hangs after the first app is closed.  Some of my machines' cards are not detected by OSS, and some apps have bad sound with OSS.  Each has it's own merits and drawbacks.
Title: Re: Setting Alsa volume on easy way
Post by: Xianwen Chen on January 30, 2010, 08:19:44 AM
Code: [Select]
amixer set Master 80%
amixer set Master unmute
amixer set PCM 80%
amixer set PCM unmute

Just FYI that, I have to set PCM as well to have sound.
Title: Re: Setting Alsa volume on easy way
Post by: banditman on February 23, 2010, 08:26:57 AM
What I Do
Run alsamixer unmute and raise the volume sliders to max on master and pcm channels then press esc then run sudo alsactl store, then simply add alsactl restore to bootlocal.sh file.
Job done!  :D
Title: Re: Setting Alsa volume on easy way
Post by: aus9 on April 21, 2010, 10:17:32 PM
hi

I have an intel card with LXDE and just to show we are different down under I have to use
amixer set Speaker unmute

-----The volume was already ok as were most other settings......I have not yet set up my intel model=5stack.....but the weird thing is the first time I run
alsamixer I have no PCM selection.....but when I start testing a sound.....I get one.

Anyhow I prefer this way as it only requires non-root access to edit. YMMV


Title: Re: Setting Alsa volume on easy way
Post by: nitram on June 26, 2015, 01:16:08 PM
This works for me using Alsa and TinyCore 6 for sound and persistence:
- add alsa-config.tcz to /etc/sysconfig/tcedir/onboot.lst
- add the following to /opt/bootlocal.sh:
     amixer set Master unmute &
     amixer set PCM unmute &
     amixer set Master 80% &
     amixer set PCM 80% &
- on my system if PCM is muted sound does not work
- using Fluxbox, add to .fluxbox/keys to mute/unmute and control volume via keyboard:
     Mod4 Up :Exec amixer sset Master,0 1+
     Mod4 Down :Exec amixer sset Master,0 1-
     Mod4 Left :Exec amixer sset Master,0 toggle

PS: XMMS is still a great music player :)
Title: Re: Setting Alsa volume on easy way
Post by: nitram on July 17, 2015, 02:33:08 PM
Unfortunately PCM was still re-booting muted, so the commands listed below were moved from /opt/bootlocal.sh to /home/tc/.X.d/startups file. Persistent good volume upon several reboots. Makes more sense anyway as the commands don't require root.
     amixer set Master unmute &
     amixer set PCM unmute &
     amixer set Master 80% &
     amixer set PCM 80% &