LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-05-2019, 10:39 AM   #1
Pendeb
Member
 
Registered: Mar 2012
Posts: 89

Rep: Reputation: Disabled
Exclamation Need sound at restart


I'm trying to make the system launch sudo alsa force-reload, which seems to do the trick for me, but I don't know how.

I've had trouble with the autostart app, which seemingly ignores my shell script for running "pkexec alsa force-reload," and I'm having trouble with editing the sudoers file despite instructions on the web.

I'm running Ubuntu 18.04 "Bionic Beaver."
 
Old 12-05-2019, 12:14 PM   #2
/dev/random
Member
 
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.2, LFS-current, NetBSD 6.1.3, OpenIndiana
Posts: 319

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by Pendeb View Post
I'm trying to make the system launch sudo alsa force-reload, which seems to do the trick for me, but I don't know how.

I've had trouble with the autostart app, which seemingly ignores my shell script for running "pkexec alsa force-reload," and I'm having trouble with editing the sudoers file despite instructions on the web.

I'm running Ubuntu 18.04 "Bionic Beaver."
Code:
vim /etc/rc.local
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
alsa force-reload
exit 0
Code:
chmod +x /etc/rc.local
 
1 members found this post helpful.
Old 12-05-2019, 03:31 PM   #3
Pendeb
Member
 
Registered: Mar 2012
Posts: 89

Original Poster
Rep: Reputation: Disabled
Unhappy

I tried that, but I still have to manually reload alsa on reboot.
 
Old 12-05-2019, 05:28 PM   #4
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Ubuntu uses systemd and pulseaudio. Not sure it uses alsa, it might, I don't use ubuntu.

Open a terminal and run
Code:
alsamixer
, then note if all channels are unmuted. Close out of alsamixer (escape) and run
Code:
sudo alsactl store
. That sets everything and "I think" will restore on boot.

If that doesn't work, maybe someone who runs Ubuntu can chime in.
 
1 members found this post helpful.
Old 12-05-2019, 06:02 PM   #5
Pendeb
Member
 
Registered: Mar 2012
Posts: 89

Original Poster
Rep: Reputation: Disabled
It didn't work.

Wait, let me recheck.

Last edited by Pendeb; 12-05-2019 at 06:04 PM.
 
Old 12-05-2019, 06:18 PM   #6
Pendeb
Member
 
Registered: Mar 2012
Posts: 89

Original Poster
Rep: Reputation: Disabled
No, it didn't work.
 
Old 12-06-2019, 02:57 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
assuming
Code:
# which $(alsa)
/usr/bin/alsa
(my system does not have an 'alsa' command though):

Code:
# cat <<EOF > /etc/systemd/system/alsa-force-reload.service
[Unit]
Description=Force reload ALSA

[Service]
ExecStart=/usr/bin/alsa force-reload

[Install]
WantedBy=multi-user.target
EOF
# systemctl enable alsa-force-reload
 
2 members found this post helpful.
Old 12-06-2019, 07:37 AM   #8
Pendeb
Member
 
Registered: Mar 2012
Posts: 89

Original Poster
Rep: Reputation: Disabled
I'm still not getting sound on reboot.
 
Old 12-08-2019, 05:25 AM   #9
Pendeb
Member
 
Registered: Mar 2012
Posts: 89

Original Poster
Rep: Reputation: Disabled
I solved it myself.

I created a file, ~/.asoundrc containing

pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}

from https://www.alsa-project.org/wiki/Asoundrc

Last edited by Pendeb; 12-08-2019 at 05:28 AM. Reason: source
 
Old 12-10-2019, 01:18 PM   #10
Pendeb
Member
 
Registered: Mar 2012
Posts: 89

Original Poster
Rep: Reputation: Disabled
Thread unmarked as I'm still having problems
 
Old 02-07-2020, 01:16 AM   #11
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
right what kind of problems?

also describe how exactly you want to hear sounds please....as we all have different setups and not mind readers.
Well I failed the course

eg laptop speakers and 3.5mm headphones
surround sound via various coloured holes
sound via inbuilt monitor speaker/tv

also show output of
Code:
aplay -l
generally speaking....ubuntu type distros use alsa with a front end of pulseaudio
pulseaudio...until you setup a home config....runs system wide configs from /etc/pulse

If a specific media player is "playing up".....name the media player
also name type of media extension .....eg wmv or mp4 etc
 
  


Reply

Tags
alsa, autostart, sound, sudoers, ubuntu 18.04



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
Problem with "Graceful restart requested, doing restart" Guldstrand Linux - Server 8 02-02-2021 11:13 PM
[SOLVED] samba needs a restart after a system restart dimm0k Slackware 16 12-04-2016 03:34 PM
[SOLVED] Have to restart network on restart? sapslaj Linux - Networking 5 06-30-2012 02:02 PM
Ubuntu 9.10 - "Restart" option just restarts Ubuntu, doesn't restart PC tensigh Linux - Laptop and Netbook 5 03-02-2011 10:47 AM
How do I set the regulatory daemon to restart when I restart the network service? zahadumy Linux - Networking 0 11-05-2006 11:24 AM

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

All times are GMT -5. The time now is 11:59 AM.

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