From: "Adrian McMenamin" Subject: Re: [PATCH] ALSA AICA sound on SEGA Dreamcast - fix behaviour in poor resource conditions Date: Fri, 6 Jul 2007 10:46:59 +0100 Message-ID: <92a12cdb0707060246p407f19depe16c59ac43eb0d96@mail.gmail.com> References: <92a12cdb0707051507r7ab1516blb7ea755d89c25efa@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.230]) by alsa0.perex.cz (Postfix) with ESMTP id 675F624595 for ; Fri, 6 Jul 2007 11:47:01 +0200 (CEST) Received: by nz-out-0506.google.com with SMTP id m22so142863nzf for ; Fri, 06 Jul 2007 02:47:00 -0700 (PDT) In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org List-Id: alsa-devel@alsa-project.org On 06/07/07, Takashi Iwai wrote: > At Thu, 5 Jul 2007 23:07:44 +0100, > Adrian McMenamin wrote: > > @@ -402,17 +396,10 @@ > > static int snd_aicapcm_pcm_trigger(struct snd_pcm_substream > > *substream, int cmd) > > { > > - struct snd_card_aica *dreamcastcard; > > switch (cmd) { > > case SNDRV_PCM_TRIGGER_START: > > spu_begin_dma(substream); > > break; > > - case SNDRV_PCM_TRIGGER_STOP: > > - dreamcastcard = substream->pcm->private_data; > > - if (dreamcastcard->timer.data) > > - del_timer(&dreamcastcard->timer); > > - aica_chn_halt(); > > - break; > > default: > > return -EINVAL; > > } > > Is this a correct change? Then you'd have no control for stopping the > stream. > The shutdown is all done in the close() now, partly because snd_aicapcm_pcm_trigger cannot sleep and close() can. Is there a pressing reason to put code in snd_aicapcm_pcm_trigger?