how to turn off sound by default?

Post here if you are a new Porteus member and you're looking for some help.
att
Contributor
Contributor
Posts: 137
Joined: 28 Dec 2010, 17:09

how to turn off sound by default?

Post#1 by att » 05 Mar 2012, 11:38

Hello,

Sorry, for such a stupid question, but I want to boot Porteus-KDE (1.0 1.1 1.2 rc1, whatever version) and I want KDE to start with sound set to silence by default.
Things that I tried myself, and which did not work:
* I tried to edit /etc/rc.d/rc.alsa and I set every "set" value to 0% - did not work - kmix still came up with 74% volume.
* I replaced rc.alsa with a dummy echo file (echo "alsa off!") - still does not work - kmix still comes up with a volume set to 54%.

Now I am out of clues. Thus:
Which config file do I have to edit to get a sound volume of 0% correctly, every time I start?
Where is the config file with the waveform-file (wav-file) so I can replace the startup-sound manually?

I prefer to use /rootcopy method to change config files. Any clues are appreciated.

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: how to turn off sound by default?

Post#2 by Hamza » 05 Mar 2012, 13:09

nosound as cheatcode at boot up should solve your problem.
NjVFQzY2Rg==

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: how to turn off sound by default?

Post#3 by Ahau » 05 Mar 2012, 13:16

Hi att,

The 'volume=' cheatcode has been added for this purpose, so in version 1.2 rc1, all you need to do is add the cheat to your boot line as, 'volume=0%'

In version 1.1, you could add the following lines to /opt/porteus-scripts/paths and place the modified version in your rootcopy:

Code: Select all

# Set volume
VOLUME=`egrep -o " volume=[^ ]+" /proc/cmdline | cut -d= -f2`
[ "$VOLUME" ] && amixer set Master $VOLUME
In version 1.0 or 1.1, I think you could probably use the same code in /etc/rc.d/rc.local, generate another script just with those lines and set it as part of your Desktop Environment's autostart, or perhaps boot with: 'autoexec=amixer~set~Master~0'. I'll check on that...

Posted after 5 minutes 29 seconds:
I just tested with 'autoexec=amixer~set~Master~0' and it worked -- that's probably your easiest solution for V1.0 and 1.1.

Hamza's suggestion would be even easier, but I believe it would disable the detection of your sound hardware altogether, so you wouldn't have sound even if you turned the volume up after logging in.
Please take a look at our online documentation, here. Suggestions are welcome!

att
Contributor
Contributor
Posts: 137
Joined: 28 Dec 2010, 17:09

Re: how to turn off sound by default?

Post#4 by att » 05 Mar 2012, 17:33

The "nosound" boot parameter did not work for me. Furthermore, it is not documented anywhere, also not in the "cheatcodes.txt" file.

As a workaround, I disabled all system sounds and saved the config file "knotifyrc" to /porteus/rootcopy/root/.kde4/share/config/knotifyrc

My knotifyrc looks like this:

---------------------------------------
[Misc]
LastConfiguredApp=KDE Arbeitsfläche

[Phonon::AudioOutput]
KNotify_Volume=0

[Sounds]
No sound=true
Use external player=false
Volume=0
------------------------------------------

The other files I also saved were kde.notifyrc and powerdevil.notifyrc - these also contain no references to sounds anymore.

Thus, I have now no sounds playing at startup. I might have replaced all the ogg files in /usr/share/sounds with 0-byte-files aswell.

If you still know a better solution, let me know. I'll wait for final porteus 1.2 in the meantime :)

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: how to turn off sound by default?

Post#5 by francois » 07 Nov 2016, 04:04

volume=0% seems the right solution. :)
Prendre son temps, profiter de celui qui passe.

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: how to turn off sound by default?

Post#6 by Ed_P » 07 Nov 2016, 06:29

^ You responded to a 3 1/2 yr old thread!!
Ed

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: how to turn off sound by default?

Post#7 by francois » 07 Nov 2016, 12:33

In fact, I wanted to stay on topic. I did not know that volume cheatcode existed. In my case, I used it to increase the volume on my computer. Old does not mean obsolete. :wink:
Prendre son temps, profiter de celui qui passe.

Post Reply