From: Takashi Iwai Subject: Re: [PATCH 0/2] Fix thread safety issues Date: Wed, 30 Jan 2013 17:03:59 +0100 Message-ID: References: <1359559337-15533-1-git-send-email-jerome@taodyne.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: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 05443265074 for ; Wed, 30 Jan 2013 17:04:00 +0100 (CET) In-Reply-To: <1359559337-15533-1-git-send-email-jerome@taodyne.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Jerome Forissier Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Wed, 30 Jan 2013 16:22:15 +0100, Jerome Forissier wrote: > > This is a set of two patches to fix thread safety issues I found when running > a video application over ALSA. The application uses LibVLC to play several > videos simultaneously. LibVLC calls snd_pcm_open() and snd_device_name_hint() > from multiple threads, without locking--which is allowed according to > http://www.alsa-project.org/main/index.php/SMP_Design. The fix for snd_pcm_direct_parse_open_conf() looks good. I'm going to apply this now. snd_device_name_hint() should use snd_config_update_r() and pass the local config space to others instead of snd_config. thanks, Takashi > > Without these patches, I would get random error messages like: > > ALSA lib confmisc.c:768:(parse_card) cannot find card '$CARD' > ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device > ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings > ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_concat returned error: No such device > ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name > ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_refer returned error: No such device > ALSA lib conf.c:4663:(snd_config_expand) Evaluate error: No such device > > Jerome Forissier (2): > Make snd_device_name_hint() thread-safe by locking a mutex > snd_pcm_direct_parse_open_conf(): use thread-safe getgrnam_r() > > src/control/namehint.c | 31 +++++++++++++++++++++++++++++++ > src/pcm/pcm_direct.c | 15 +++++++++++---- > 2 files changed, 42 insertions(+), 4 deletions(-) > > -- > 1.8.1.2 > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >