Bug 7220
Summary: | saa7134: no sound after suspend to disk | ||
---|---|---|---|
Product: | Drivers | Reporter: | Adrian Bunk (bunk) |
Component: | Video(Other) | Assignee: | Rafael J. Wysocki (rjwysocki) |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | akpm, mchehab, protasnb, rjwysocki |
Priority: | P2 | ||
Hardware: | i386 | ||
OS: | Linux | ||
Kernel Version: | all | Subsystem: | |
Regression: | --- | Bisected commit-id: | |
Bug Depends on: | |||
Bug Blocks: | 7216 | ||
Attachments: | syslog |
Description
Adrian Bunk
2006-09-27 17:26:24 UTC
Try unloading/reloading saa7134 around resume. If that helps, port insmod/rmmod parts of the driver into suspend/resume and you are done. It does help, but I failed to get this "porting" done in a working way when I tried it. To initialize the board after resume, you will need parts of saa7134_initdev, like: /* initialize hardware #1 */ saa7134_board_init1(dev); saa7134_hwinit1(dev); /* initialize hardware #2 */ saa7134_board_init2(dev); saa7134_hwinit2(dev); Taking a closer look at the code, I suspect we will need to split some hardware initialization code there from the subsystem initializations taken in place by those init stuff. For unregister, it calls: saa7134_hwfini(dev); You should notice, however, that some of the code called by fini will unregister some devices (like input). So, you will need to do a better check on that. At a first glance, i would just call, at suspend: saa7134_tvaudio_fini() to disable audio output. fixed? Is the bug still present in 2.6.22-rc3 and/or in the latest -git ? The code is in (I see it in 2.6.22-rc4), just needs some testing and the bug can be closed. Adrian, can you please try it and confirm the code works now? Thanks. Any progress? Sorry, I somehow didn't get around to test this one. I tested with 2.6.23-rc2: The good news is: Sound works after resuming when I'm not watching TV when suspending. The bad news is: I wanted to know whether it also works when watching TV while suspending, so I tried watching analog TV with tvtime and DVB-T with kaffeine (the card supports doing both at the same time) when suspending. During suspend I got kernel BUG at drivers/media/video/video-buf-dvb.c:59. After resume: Bad page state in process 'tvtime' page:c15b0e40 flags:0x40000000 mapping:00000000 mapcount:0 count:-1 Trying to fix it up, but a reboot is needed After resuming processes randomly (but quickly) segfaulted. After typing in a console "shutdown -h now" the kernel panic'ed. Created attachment 12355 [details]
syslog
Hm, the bug was triggered during the freezing of tasks. I think this patch will help: http://www.sisk.pl/kernel/hibernation_and_suspend/2.6.23-rc3/patches/11-freezer-do-not-send-signals-to-kernel-threads.patch [You'll need to apply the previous patches from the series before it.] There are also another fix removing the BUG_ON() on video-buf-dvb that may help: http://git.kernel.org/?p=linux/kernel/git/mchehab/v4l-dvb.git;a=commit;h=b396f1e8ff2de4d9db15ce6b8d7748c542364a60 I just tried 2.6.23-rc3-mm1 that contains both patches, and except for some minor issues it's now working fine: :-) When only running tvtime (analog TV) when suspending tvtime continues running after resuming (perfect!). When only running kaffeine (DVB-T) when suspending, kaffeine only shows a freeze frame after resuming. After closing and restarting kaffeine it works again. Most likely the tuning of the device wasn't restored when resuming? When running both tvtime and kaffeine when suspending, kaffeine has the problem described above plus tvtime doesn't has sound. After closing both applications and restarting them it works again. After the latest v4l-dvb merge into Linus' tree everything is working fine. :-) I don't even have to restart kaffeine anymore (only the channel needs to be reselected). tvtime also continues to work when both were running (but this might also have improved due to me switching to saa7134-alsa). Thanks a lot for these improvements! |