From: Takashi Iwai Subject: Re: stateful reconnect with snd-usb-audio Date: Fri, 16 Jun 2006 17:33:53 +0200 Message-ID: References: <8d4807d50606121405n51edef2au3de163b01029aaf5@mail.gmail.com> <8d4807d50606141020w8e29a50t6b97528d7e82a0c5@mail.gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Sam Revitch Cc: alsa-devel@lists.sourceforge.net, Jaroslav Kysela List-Id: alsa-devel@alsa-project.org At Fri, 16 Jun 2006 12:04:04 +0200, I wrote: > > At Wed, 14 Jun 2006 10:20:57 -0700, > Sam Revitch wrote: > > > > > Anyway, re-reading the quote above, it sounds more like a problem > > > happening only via suspend. Then, this might be solved automatically > > > if the proper suspend/resume is implemented on usb-audio driver. > > > > > I'm not sure how alsa-lib can decide if device has been disconnected > > > permanently or temporary. But if you mean "closing the file descriptor > > > in the first time when -ENODEV occurs", it makes a lot of sense for > > > alsa-lib and yes, it should be there. > > > > Thanks for replies. > > > > The problem with usb_audio_disconnect() getting stuck isn't specific > > to suspend, although the part of it that I care about right now is. > > That function shouldn't be waiting for handles to be closed, as > > somebody can execute a DoS attack on khubd by sending SIGSTOP to any > > process that has the sound driver open. > > > > Perhaps the snd_device dev_disconnect and dev_unregister routines for > > the various abstract layers need to be changed so that sysfs/procfs > > entries are removed in dev_disconnect? This way it might be possible > > to release a slot without freeing anything that might be in use. > > Yes, it sounds feasible. > > > As for implementing suspend/resume methods for snd-usb-audio, doesn't > > that require explicit support from the device for retaining state in > > some sort of low power 0.5mA mode? I don't know whether the card I'm > > using even supports that. > > I don't think the low-poer mode is a requirement although it would be > nice to have. The main purpose of suspend/resume is the stop of PCM > streams and save/restore the mixer status. A short test didn't work, so looks like you are right... The fix for snd_card_free() is the way to go right now. (Though, the proper support of suspend/resume would be best, of course.) Takashi