All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Robert Krakora <rob.krakora@messagenetsystems.com>
Cc: alsa-user@lists.sourceforge.net,
	Jerry Geis <geisj@messagenetsystems.com>,
	alsa-devel@alsa-project.org
Subject: Re: dmix problems with analog out (HDMI out works fine with dmix)
Date: Thu, 29 Sep 2011 14:32:01 +0200	[thread overview]
Message-ID: <s5hr52za5ry.wl%tiwai@suse.de> (raw)
In-Reply-To: <CA+DpathSCpx3t3wVnX+jPufKHaZCVjiXoGF_wWozz7qPo4S3jw@mail.gmail.com>

At Thu, 29 Sep 2011 08:22:39 -0400,
Robert Krakora wrote:
> 
> On Thu, Sep 29, 2011 at 2:36 AM, Takashi Iwai <tiwai@suse.de> wrote:
> 
> > At Wed, 28 Sep 2011 12:29:05 -0400,
> > Robert Krakora wrote:
> > >
> > > Hi All,
> > >
> > > I am using ALSA 1.0.24 with the attached asound.conf.  I am attempting to
> > > share (mix) the analog output between Asterisk and aplay.  However, when
> > > Asterisk is running, my application throws an error when attempting to
> > play
> > > a wave file via aplay.  If I stop Asterisk, aplay plays the wave file
> > just
> > > fine.  If I remove the asound.conf file, Asterisk and aplay are both
> > happy
> > > and share the analog output just find with the default ALSA dmix
> > > implementation.  However, we need this asound.conf to work for us for
> > other
> > > reasons.  What is wrong with it.  I have even tried replacing dmix with
> > > dshare and get the same bad behavior.  We are running CentOS 6.0.  As a
> > > caveat, I am attempting to use dmix with analog audio.  If I use it with
> > > HDMI audio, it works flawlessly (same asound.conf with tweek to specify
> > > HDMI).  Thanks in advance for your help.
> > >
> > > [root@devkrakorar snd]# su silentm -c "aplay -Dplug:dmixer
> > > /usr/share/sounds/alsa/Front_
> > > Center.wav"
> > > ALSA lib pcm_hw.c:1293:(snd_pcm_hw_open) open '/dev/snd/pcmC0D0p' failed
> > > (-22): Invalid argument
> > >
> > > ALSA lib pcm_dmix.c:1068:(snd_pcm_dmix_open) unable to open slave
> > > aplay: main:660: audio open error: Invalid argument
> > > [root@devkrakorar snd]#
> >
> > Looks like the open of HD-audio stream failed by some reason.
> > When you open via aplay, is the corresponding stream already opened
> > by another?  Take a look at /proc/asound/card0/pcm0p/sub0/* files.
> >
> > Also, try the latest alsa-driver snapshot in
> >   ftp://ftp.suse.com/pub/people/tiwai/snapshot/
> >
> >
> > Takashi
> >
> 
> Hi Takashi,
> 
> Thanks for the quick response.  Yes, the HD-audio stream open fails because
> Asterisk has previously opened it.  aplay cannot open it (error -22).

-22 is -EINVAL, and it's not -EBUSY or -EAGAIN.  If a blocking open is
the problem, it should have been -EAGAIN or such.
That is, usually something conflicts with the opened stream.


Takashi

  parent reply	other threads:[~2011-09-29 12:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28 16:29 dmix problems with analog out (HDMI out works fine with dmix) Robert Krakora
2011-09-29  6:36 ` Takashi Iwai
2011-09-29 12:22   ` Robert Krakora
2011-09-29 12:25     ` Robert Krakora
2011-09-29 12:32     ` Takashi Iwai [this message]
2011-09-29 12:43       ` Robert Krakora
2011-09-29 12:44         ` Takashi Iwai
2011-09-29 12:45         ` Robert Krakora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hr52za5ry.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=alsa-user@lists.sourceforge.net \
    --cc=geisj@messagenetsystems.com \
    --cc=rob.krakora@messagenetsystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.