# [Unsolved] How to keep alsa when hibernating / suspending

## solamour

TuxOnIce works great on my desktop (with an aging Athlon and an nVIDIA onboard sound), but whenever I hibernate and resume my laptop, there is no sound; I need to restart alsa to bring back the sound.

If I build the sound into the kernel rather than as a module, even restarting alsa doesn't bring back the sound. It needs a reboot.

This is normally not a problem, because I can just add "RestartServices alsasound" in "/etc/hibernate/common.conf", so that alsa restarts when resuming. The problem is, when I pause and hibernate while watching a movie with mplayer, it also kills mplayer. This forces me to fast-forward the movie to where I left off upon resuming, and I often forget where I left off.

I clearly remember this wasn't the case a while ago. I was able to hibernate without killing alsa and the sound restored correctly after resuming, just like my desktop does. I'm fairly certain it started behaving differently after a few "emerge -vDu world", but I'm not sure what caused it.

It has been a lingering problem for a while, and I haven't figured out what to do. I'd appreciate any suggestions.

```
Linux sens 2.6.24-tuxonice-r9 #4 Wed Jul 9 23:20:55 PDT 2008 i686 Mobile Pentium II GenuineIntel GNU/Linux

Device Drivers

  Sound

    <M> Sound card support

      <M> Advanced Linux Sound Architecture

        PCI devices

          <M> ESS ES1968/1978 (Maestro-1/2/2E)

```

__

solLast edited by solamour on Fri Mar 13, 2009 9:26 pm; edited 1 time in total

----------

## wcw

I have the same problem as solamour.

And in addition, if I played mp3 before hibernate to ram, after resumed, the mp3 would continue and I could hear the music normally. And if I didn't use any sound application before hibernate to ram, after resumed, I still can used any sound application(no any warning or error), but just no sound.

```

<M> Sound card support                                             

         <M> Advanced Linux Sound Architecture                             │ │  

  │ │    <M>   Sequencer support                                           │ │  

  │ │    < >     Sequencer dummy client                                    │ │  

  │ │    <M>   OSS Mixer API                                               │ │  

  │ │    <M>   OSS PCM (digital audio) API                                 │ │  

  │ │    [*]     OSS PCM (digital audio) API - Include plugin system       │ │  

  │ │    [*]   OSS Sequencer API                                           │ │  

  │ │    < >   RTC Timer support                                           │ │  

  │ │    [ ]   Dynamic device file minor numbers                           │ │  

  │ │    [*]   Support old ALSA API                                        │ │  

  │ │    [*]   Verbose procfs contents                                     │ │  

  │ │    [ ]   Verbose printk                                              │ │  

  │ │    [ ]   Debug                                                       │ │  

  │ │          Generic devices  --->                                       │ │  

  │ │        PCI devices  --->    

         <M> Intel HD Audio                                                │ │  

  │ │    [*]   Build hwdep interface for HD-audio driver                   │ │  

  │ │    [*]   Build Realtek HD-audio codec support                        │ │  

  │ │    [*]   Build Analog Device HD-audio codec support                  │ │  

  │ │    [*]   Build IDT/Sigmatel HD-audio codec support                   │ │  

  │ │    [*]   Build VIA HD-audio codec support                            │ │  

  │ │    [*]   Build ATI HDMI HD-audio codec support                       │ │  

  │ │    [*]   Build Conexant HD-audio codec support                       │ │  

  │ │    [*]   Build C-Media HD-audio codec support                        │ │  

  │ │    [*]   Build Silicon Labs 3054 HD-modem codec support              │ │  

  │ │    [*]   Enable generic HD-audio codec parser                        │ │  

  │ │    [*]   Aggressive power-saving on HD-audio                         │ │  

  │ │    (0)     Default time-out for HD-audio power-save mode 

```

Any advice will be appreciated!

----------

## zAfi

I never had the behaviour you're describing with the tuxonice-sources I was using (2.6.24, 2.6.25 w. hibernate-script 1.98.1 & 1.99), although I would've liked it.

But since yesterday it works with 2.6.27-tuxonice (https://bugs.gentoo.org/show_bug.cgi?id=245140).

(Small sidenote: I'm not sure if I tried to get it work with hibernate-script-1.99 and an "official" toi-kernel, maybe you should try that first b4 trying the 2.6.27.)

```
CONFIG_SND=y

CONFIG_SND_TIMER=m

CONFIG_SND_PCM=m

CONFIG_SND_HWDEP=m

CONFIG_SND_RAWMIDI=m

CONFIG_SND_SEQUENCER=m

CONFIG_SND_SEQ_DUMMY=m

CONFIG_SND_OSSEMUL=y

CONFIG_SND_MIXER_OSS=m

CONFIG_SND_PCM_OSS=m

CONFIG_SND_PCM_OSS_PLUGINS=y

CONFIG_SND_SEQUENCER_OSS=y

# CONFIG_SND_RTCTIMER is not set

# CONFIG_SND_DYNAMIC_MINORS is not set

CONFIG_SND_SUPPORT_OLD_API=y

CONFIG_SND_VERBOSE_PROCFS=y

# CONFIG_SND_VERBOSE_PRINTK is not set

# CONFIG_SND_DEBUG is not set

CONFIG_SND_VMASTER=y

CONFIG_SND_DRIVERS=y

CONFIG_SND_PCI=y

CONFIG_SND_HDA_INTEL=m

# CONFIG_SND_HDA_HWDEP is not set

CONFIG_SND_HDA_CODEC_REALTEK=y

CONFIG_SND_HDA_CODEC_ANALOG=y

CONFIG_SND_HDA_CODEC_SIGMATEL=y

CONFIG_SND_HDA_CODEC_VIA=y

CONFIG_SND_HDA_CODEC_ATIHDMI=y

CONFIG_SND_HDA_CODEC_CONEXANT=y

CONFIG_SND_HDA_CODEC_CMEDIA=y

CONFIG_SND_HDA_CODEC_SI3054=y

CONFIG_SND_HDA_GENERIC=y

CONFIG_SND_HDA_POWER_SAVE=y

CONFIG_SND_HDA_POWER_SAVE_DEFAULT=5

```

```
CONFIG_TOI_CORE=y

# CONFIG_TOI_FILE is not set

CONFIG_TOI_SWAP=y

CONFIG_TOI_DEFAULT_PRE_HIBERNATE=""

CONFIG_TOI_DEFAULT_POST_HIBERNATE=""

CONFIG_TOI_CRYPTO=y

CONFIG_TOI_USERUI=y

CONFIG_TOI_USERUI_DEFAULT_PATH="/sbin/tuxoniceui_fbsplash"

# CONFIG_TOI_KEEP_IMAGE is not set

CONFIG_TOI_REPLACE_SWSUSP=y

# CONFIG_TOI_IGNORE_LATE_INITCALL is not set

CONFIG_TOI_CHECKSUM=y

CONFIG_TOI_DEFAULT_WAIT=25

CONFIG_TOI_DEFAULT_EXTRA_PAGES_ALLOWANCE=5000

# CONFIG_TOI_PAGEFLAGS_TEST is not set

CONFIG_TOI=y
```

GL

----------

## chy1013m1

does /etc/init.d/alsasound restart 

fix the sound?

----------

## solamour

"/etc/init.d/alsasound restart" indeed fixes the sound, but it also kills all apps that use sound, so when I pause a movie in mplayer, I need to restart it and fast-forward where I left off, which is rather irritating.

__

sol

----------

## solamour

Just for the heck of it, I created a new partition and installed Xubuntu, which seemed quite polished; pretty much everything worked right out of the box, including WiFi and hibernation. But after waking up from the hibernation, the sound was dead just as was the case for Gentoo, so I believe it's a common issue with the particular laptop I'm using.

Anyhow, it's not likely anyone would fix it for me, considering the laptop is almost a decade old. I'll just keep using "-ss" switch in mplayer; when I close mplayer while watching a movie, it displays how far I'm into the movie in (I think) seconds. I make a note of the number, and when the laptop wakes up from the hibernation, I simply issue "mplayer moviefile.avi -ss x" where "x" is the number I wrote down before. Somewhat clumsy, but it works.

__

sol

----------

