Bug 13599

Summary: Asus Xonar D1 (snd_virtuoso) not working after resume from suspend
Product: Drivers Reporter: Dan Ziemba (zman0900)
Component: Sound(ALSA)Assignee: Clemens Ladisch (clemens)
Status: RESOLVED CODE_FIX    
Severity: normal CC: clemens, tiwai
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:
Attachments: patch to correctly reinitialize D1 after resume

Description Dan Ziemba 2009-06-22 09:59:42 UTC
I have an Asus Xonar D1 card in my computer.  It works great for days at a time, but if is suspend the computer, when I resume later I have no sound output.  The module is still loaded after resume, and pulseaudio still detects the card rather than showing a null output.  The only way I have found to restore the sound is to first kill pulseaudio and anything else using the sound card, then unload and reload the snd_virtuoso module.  Even using rmmod to remove only that module and leaving snd_oxygen_lib and the rest of the underlying sound modules in is enough to restore the sound.  I first began to notice this with the 2.6.27 kernel in Fedora 10, but I did not own the card before then so this problem this problem probably didn't start there.  I am currently experiencing the problem with the 2.6.29 kernel in Fedora 11, currently their version is 2.6.29.4-167.  I am experiencing this on x86_64; I have not tried 32 bit.  Here's some extra info:


$ modinfo snd_virtuoso
filename:       /lib/modules/2.6.29.4-167.fc11.x86_64/kernel/sound/pci/oxygen/snd-virtuoso.ko
license:        GPL v2
description:    Asus AVx00 driver
author:         Clemens Ladisch <clemens@ladisch.de>
srcversion:     13975703EE98C13B214FCF5
alias:          pci:v000013F6d00008788sv00001043sd0000834Fbc*sc*i*
alias:          pci:v000013F6d00008788sv00001043sd00008314bc*sc*i*
alias:          pci:v000013F6d00008788sv00001043sd000082B7bc*sc*i*
alias:          pci:v000013F6d00008788sv00001043sd00008275bc*sc*i*
alias:          pci:v000013F6d00008788sv00001043sd00008269bc*sc*i*
depends:        snd-oxygen-lib,snd
vermagic:       2.6.29.4-167.fc11.x86_64 SMP mod_unload 
parm:           index:card index (array of int)
parm:           id:ID string (array of charp)
parm:           enable:enable card (array of bool)


$ lsmod | grep snd
snd_virtuoso           13236  2 
snd_oxygen_lib         32640  1 snd_virtuoso
snd_pcm                79960  1 snd_oxygen_lib
snd_timer              22496  1 snd_pcm
snd_page_alloc          9216  1 snd_pcm
snd_mpu401_uart         7872  1 snd_oxygen_lib
snd_rawmidi            23392  1 snd_mpu401_uart
snd_seq_device          7300  1 snd_rawmidi
snd                    65096  11 snd_virtuoso,snd_oxygen_lib,snd_pcm,snd_timer,snd_mpu401_uart,snd_rawmidi,snd_seq_device
soundcore               7024  1 snd


$ lspci | grep audio
08:00.0 Multimedia audio controller: C-Media Electronics Inc CMI8788 [Oxygen HD Audio]



I have searched through the change logs for 2.6.30 and I haven't noticed anything that seems related to this issue, but I am willing to test it on this machine if someone thinks it might behave differently with my sound card.  Let me know if I can provide any more info or test anything.  Keep up the good work.
Comment 1 Clemens Ladisch 2009-06-30 11:30:37 UTC
Suspend+resume was tested on my D2, but not with any other model AFAIK.

Apparently, the driver does not correctly reinitialize the DACs.

I'll see if there is some driver initialization code that could be resused when resuming.
Comment 2 Clemens Ladisch 2009-07-01 09:11:46 UTC
Created attachment 22159 [details]
patch to correctly reinitialize D1 after resume

Please try the attached patch.
Comment 3 Dan Ziemba 2009-07-01 21:02:26 UTC
I compiled just snd-virtuoso.ko with this patch and loaded it and it seems to work perfectly.  Sound works after resume both if it was stopped when going to sleep and if it was playing when going to sleep.  This can probably be marked as resolved.  Thank you.