<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>intelligent e-Services &#187; Debian</title>
	<atom:link href="https://ieservices.de/en/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>https://ieservices.de/en/</link>
	<description>the new challenge for open minded people</description>
	<lastBuildDate>Fri, 10 Apr 2026 15:02:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Restoring/Restarting your sound running alsa sound on Linux (Debian)</title>
		<link>https://ieservices.de/en/2013/06/15/restoringrestarting-your-sound-running-alsa-sound-on-linux-debian/</link>
		<comments>https://ieservices.de/en/2013/06/15/restoringrestarting-your-sound-running-alsa-sound-on-linux-debian/#comments</comments>
		<pubDate>Sat, 15 Jun 2013 19:53:24 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[alsa-sound]]></category>
		<category><![CDATA[alsamixer]]></category>
		<category><![CDATA[amixer]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PCM]]></category>
		<category><![CDATA[restore sound]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[Soundcard]]></category>
		<category><![CDATA[volume]]></category>

		<guid isPermaLink="false">http://ieservices.de/?p=2504</guid>
		<description><![CDATA[<p>In general I&#8217;m a happy user of Linux systems when it comes to provide (web) services such as Webservers, FTP-Servers, File-servers and even Virtual [...]</p>
<p>The post <a rel="nofollow" href="https://ieservices.de/en/2013/06/15/restoringrestarting-your-sound-running-alsa-sound-on-linux-debian/">Restoring/Restarting your sound running alsa sound on Linux (Debian)</a> appeared first on <a rel="nofollow" href="https://ieservices.de/en/">intelligent e-Services</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In general I&#8217;m a happy user of Linux systems when it comes to provide (web) services such as Webservers, FTP-Servers, File-servers and even Virtual Boxes. But I figured using Linux, as a desktop system running in the X11/Gnome/KDE on Debian is not yet really stable.<br />
And yes, it&#8217;s really going on my nerves, when you start up a browser and you want to see some videos &#8211; and suddenly &#8211; the sound is frozen. Then the first approach would be restarting your computer or trying everything else.</p>
<p>Besides that, I figured, that there are also other cases, when the sound didn&#8217;t work anymore:</p>
<ul>
<li>After the restarting the computer</li>
<li>After sending the computer into the suspend mode and waking it up again</li>
</ul>
<p>But actually, if you are running the alsa sound driver, I implemented a neat solution to restart your sound driver.</p>
<p>Yes, I also read that you can restart your sound somewhere &#8211; and actually I used this command since then until now.</p>
<p>The command to restart your alsa sound driver was:</p>
<pre>alsa force-reload</pre>
<p>After executing this command, yes, you&#8217;ll might have your sound driver back and you would be able to hear something&#8230;. but always you need to adjust your PCM volume level again.</p>
<p>So, therefore I wrote a small init.d script which is doing the following:</p>
<ol>
<li>It saves your current PCM volume level</li>
<li>It restarts your alsa sound drivers and waits! until it is fully loaded!</li>
<li>Then after that, it restores your PCM volume level</li>
</ol>
<pre>#! /bin/sh

### BEGIN INIT INFO
# Provides:             sound
# Default-Start:        2 3 4 5
# Default-Stop:
# Short-Description:    Restart the sound
### END INIT INFO

set -e
amixer=/usr/bin/amixer
alsa=/usr/sbin/alsa

# /etc/init.d/sound: restarts the "alsa" daemon

case "$1" in
restart)
rawlevel=$($amixer -c 0 get PCM | tail -2 | awk -F'[' '{print $2}' | sed -e 's/\n//' | sed -e 's/]/,/' | sed -e 's/, //g')
level=$(echo $rawlevel | sed -e 's/ /,/g')
echo Getting current pcm volume level
echo $level
echo Restarting the sound driver
nohup $alsa force-reload &gt; /dev/null ||  wait $!
sleep 3
echo Restoring the volume level
cmd=$(echo $amixer -c 0 sset PCM,0 $level)
echo    $cmd
$cmd
;;

*)
echo "Usage: /etc/init.d/sound {restart}"
exit 1
esac

exit 0</pre>
<p>Init.d script to restart the linux alsa sound driver &#8211; filename: sound.sh</p>
<p>You can place this script in your /etc/init.d/ folder &#8211; (and don&#8217;t forget to make it executable). Then you can always call it like the following:</p>
<pre>/etc/init.d/sound.sh restart</pre>
<p>Additionally you can add the sound.sh init.d script to your sudo commands with:</p>
<pre>visudo

<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px;">And just add this line somewhere</span></pre>
<pre>$USER$ ALL=NOPASSWD: /etc/init.d/sound.sh

(Replace $USER$ with your username)</pre>
<p>&nbsp;</p>
<p>Well this script is not build like rocket science &#8211; and I&#8217;m sure there is a way to optimize it. I just wanted to get it work.</p>
<p>So be happy to use it! But also, I&#8217;m happy, if some else out there has a better proposal. I&#8217;m listening!</p>
<p>So happy surfing and watch Videos!</p>
<p>The post <a rel="nofollow" href="https://ieservices.de/en/2013/06/15/restoringrestarting-your-sound-running-alsa-sound-on-linux-debian/">Restoring/Restarting your sound running alsa sound on Linux (Debian)</a> appeared first on <a rel="nofollow" href="https://ieservices.de/en/">intelligent e-Services</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ieservices.de/en/2013/06/15/restoringrestarting-your-sound-running-alsa-sound-on-linux-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
