Re: pcm_multi broken in alsa-lib - no duplex mode with jackd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Tue, 13 Mar 2007 03:01:17 +0100,
I wrote:
> 
> At Tue, 13 Mar 2007 00:46:52 +0100,
> I wrote:
> > 
> > At Sat, 10 Mar 2007 14:17:13 +0000,
> > John Rigg wrote:
> > > 
> > > On Fri, Mar 09, 2007 at 05:38:34PM +0100, Takashi Iwai wrote:
> > > > At Thu, 8 Mar 2007 21:51:28 +0000,
> > > > John Rigg wrote:
> > > > > 
> > > > > On Thu, Mar 08, 2007 at 07:58:23PM +0100, Takashi Iwai wrote:
> > > > > > At Thu, 08 Mar 2007 18:16:02 +0100,
> > > > > > Simon Lewis wrote:
> > > > > > > Many JACK users have successfully used the following patch:
> > > > > > > 
> > > > > > > http://www.sound-man.co.uk/linuxaudio/pcm_multi-patch
> > > > > > 
> > > > > > Well, the patch is no real fix.  It's likely a workaround for JACK,
> > > > > > though.  Someone has to take time to track down this bug more deeply.
> > > > > 
> > > > > True, the patch is just a workaround for JACK. However, I would
> > > > > argue that most users of pcm_multi are probably JACK users.
> > > > 
> > > > No, multi plugin is used in many surround PCM definitions as default.
> > > > It's pretty hidden, but multi streams are no rare case.
> > > 
> > > I hadn't noticed that. Thanks for pointing it out (and thank you for
> > > looking at this problem!)
> > > 
> > > > > Surely adding code that breaks something for the majority of users (no
> > > > > matter how correct that code is in isolation) is not a good thing.
> > > > 
> > > > Sure.  However, this code addition was for bugfixes of major other use
> > > > cases like above, IIRC.  The regression should be avoided and should
> > > > be fixed.  But the point is, we (at least, I) haven't been enough
> > > > informed, unfortunately (or simply burried in a big TODO list :)
> > > > 
> > > > Now, let's back to the original problem:  Could someone give a pointer
> > > > describing for this problem, or just explain a bit details here?
> > > > I vaguely remember but not precisely at all now...
> > > > I'm willing to dig down after knowing how I can reproduce the bug.
> > > 
> > > To summarise, using multiple sound cards with pcm_multi and jackd
> > > no longer works in duplex mode ever since extra linking code was
> > > added to pcm_multi.c in alsa-lib-1.0.9rc1.
> > > 
> > > Trying to start jackd in duplex fails with a poll timeout message.
> > > It still works in playback-only or capture-only modes.
> > > The lack of duplex operation makes overdubbing in a recording studio,
> > > for example, impossible.
> > > 
> > > A configuration which produces the problem with two ice1712 cards
> > > set up as a 16 channel multi device is shown here:
> > > http://www.sound-man.co.uk/linuxaudio/ice1712multi.html
> > > 
> > > With the .asoundrc described in the above link the following
> > > command fails with a poll timeout message:
> > > 
> > > jackd -d alsa -P multi_playback -C multi_capture
> > > 
> > > The following still work:
> > > jackd -d alsa -P multi_playback
> > > jackd -d alsa -C multi_capture
> > 
> > OK, played a bit around this bug.  A temporary fix is attached below.
> > It's applied to HG tree now, too.  Please give it a try.
> > 
> > The real fix will come later...
> 
> More complete fix is below.  Apply after the previous patch.
> (Or more easily use the HG version.)

BTW, while debugging this, I found some potential problems in the
current alsa support in JACK:

- The arguments of snd_pcm_link() is master, slave.  And, the master
  PCM should be used as a trigger.  In the case of JACK, it should
  call like snd_pcm_link(playback_handle, capture_handle).
 
- Mangles of poll revents are sometimes needed (e.g. dmix) by calling
  snd_pcm_poll_descriptor_revents() after poll.  JACK might work
  without this, though, because it checks only revents !=0 or not.
  Once if it checks the direction (IN/OUT), there could be a problem.


Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux