All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Revell <rlrevell@joe-job.com>
To: alsa-devel <alsa-devel@lists.sourceforge.net>
Cc: alsa-user@lists.sourceforge.net
Subject: [PATCH] emu10k1 multichannel support
Date: Tue, 18 Jan 2005 18:31:12 -0500	[thread overview]
Message-ID: <1106091073.24484.60.camel@krustophenia.net> (raw)

As promised, here's an updated patch to add real multichannel playback
support (and improved multichannel capture) to the emu10k1 driver.

http://www.alsa-project.org/~rlrevell/emu10k1-multichannel-v001.patch

Please test it and report any problems.  I am especially interested in
any regressions that impact regular PCM playback (the hw:0,0 device).

QuickStart:

$ jackd -R -v -d alsa -P hw:0,3 -C hw:0,2 -S

This also adds some new register info including a per channel half loop
interrupt that I have discovered by reverse engineering the Windows
drivers.

Improvements over previous versions:

 - Routes the 16 channels to the 16 FX buses by default.

 - Enables the first 16 FX capture outputs by default, required for 
full duplex operation at latencies lower than 512 frames.

 - Rewrote the voice allocator to use a more efficient round 
robin algorithm, eliminating the need to reserve the
first 16 voices for the multichannel device.  The next free voice 
is maintained in the card record and the search starts from there.

 - Use an extra voice for playback timing rather than the EFX capture
interrupt.  I was only ever able to get that to work at 64 frames.  Also
there are definite advantages to being able to use the capture and
playback devices independently.

 - Use the newly discovered per-channel half loop interrupt source for
the extra voice rather than the channel loop interrupts.  For unknown
reasons, this works better for multichannel playback, and does not seem
to affect regular PCM playback at all.

TODO:

 - Fix the send routing and volume controls for the multichannel device.
The current (copy and paste) solution assumes either one or two voices
per PCM.  So the default settings work fine but changing them with the
mixer is likely to have unpredictable effects.  

 - EFX capture should capture output channels 16-32 (mostly unused now)
by default, so that we only capture the sources the user has connected
to the multichannel recording inputs in the DSP manager.  Typically FX
buses 0-15 would be connected directly to FX outputs 16-32 so the
capture channels would correspond directly to the playback channels.  In
order for this to work the default DSP configuration has to be changed
slightly.

I tested this and it works well with 16in/16out at 128, 256, 512 frames.
32 and 64 should work too but I can't test as I'm running a stock 2.6.10
kernel for now ;-).  You can check that the routing is correct by
connecting a JACK client to the playback ports corresponding to the FX
buses described in Documentation/Audigy-mixer.txt and
Documentation/SB-Live-mixer.txt, and verifying that the output appears
on that channel (the FX buses are numbered from 0 but JACK numbers
clients from 1).  For example (from SB-Live-mixer.txt):

    name='Music Playback Volume',index=0

    This control is used to attenuate samples for left and right MIDI FX-bus
    accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples.
    The result samples are forwarded to the front DAC PCM slots of the AC97 codec.

So "alsaplayer -o jack -d alsa_pcm:playback_5,alsa_pcm:playback_6"
should output to FX buses 4 and 5, which you can test by lowering the
'Music' control in alsamixer.  With an SBLive, use ports 1 and 2 for the
front channels, 3 and 4 for the rear channels.  The Audigy uses
different channels, see the above docs for more info.

In addition to multichannel recording applications, this should also be
useful for OpenAL implementations, which are currently restricted to
using 21 sources due to the use of an extra voice per stereo PCM.  This
should allow up to 63 sources.

Lee



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt

             reply	other threads:[~2005-01-18 23:31 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-18 23:31 Lee Revell [this message]
2005-01-19 14:38 ` [PATCH] emu10k1 multichannel support William
2005-01-19 16:10   ` Lee Revell
2005-01-19 16:59   ` Lee Revell
2005-01-19 17:49     ` William
2005-01-19 18:20     ` William
2005-01-19 18:24       ` Lee Revell
2005-01-19 16:48 ` Takashi Iwai
2005-01-19 19:10   ` Lee Revell
2005-01-21 21:45   ` Lee Revell
2005-01-23  0:49     ` James Courtier-Dutton
2005-01-26 18:05       ` Lee Revell
2005-01-23 20:05     ` Lee Revell
2005-01-29  3:54   ` Lee Revell
2005-01-31 16:09     ` Bug in " Mikael Magnusson
2005-02-10 22:17       ` Lee Revell
2005-02-10 23:26         ` Mikael Magnusson
2005-02-11  1:55           ` Lee Revell
2005-02-11 18:41             ` Lee Revell
2005-02-11 20:32               ` Mikael Magnusson
2005-02-10 23:33         ` Shayne O'Connor
2005-02-11  0:59           ` Lee Revell
2005-02-11  1:35             ` Shayne O'Connor
2005-02-11  1:33               ` Lee Revell
2005-02-11  2:31                 ` Shayne O'Connor
2005-02-11  3:55                   ` Lee Revell
2005-02-11  9:54                     ` Takashi Iwai
2005-01-19 19:51 ` [Alsa-user] [PATCH] " Alexander Samad
2005-01-19 21:11   ` Lee Revell
2005-01-19 21:25     ` Alexander Samad
2005-01-19 22:16     ` Alexander Samad
2005-01-19 22:19     ` Alexander Samad
2005-01-19 22:54       ` [Alsa-user] " Lee Revell
2005-01-21 21:41       ` Lee Revell
2005-01-22  0:49         ` James Courtier-Dutton
2005-01-23 20:31         ` [Alsa-devel] " Alexander Samad
2005-01-25 17:09 ` Brian L Scipioni
2005-01-25 18:43   ` [Alsa-user] " Lee Revell
     [not found]     ` <1106743059.30763.21.camel@radium.gaugetheory.org>
     [not found]       ` <1106756424.2935.1.camel@krustophenia.net>
     [not found]         ` <s5hu0p3nimh.wl@alsa2.suse.de>
2005-01-27 18:41           ` [Alsa-user] emu10k1 alsamixer items Lee Revell
2005-01-28 15:33             ` Takashi Iwai
     [not found]     ` <1108148365.4267.22.camel@radium.gaugetheory.org>
2005-02-11 19:41       ` [PATCH] emu10k1 multichannel support Lee Revell
2005-02-11 20:11         ` Brian L Scipioni
2005-02-11 20:14           ` [Alsa-user] " Lee Revell
2005-02-15 14:20         ` Brian L Scipioni
     [not found]     ` <1108148630.4267.28.camel@radium.gaugetheory.org>
2005-02-11 19:44       ` emu10k1 MIDI record Lee Revell
2005-02-11 20:06         ` Brian L Scipioni
2005-02-11 20:12           ` [Alsa-user] " Lee Revell
2005-02-12 15:34             ` Brian L Scipioni
2005-02-12 23:51               ` [Alsa-user] " Lee Revell
2005-02-15 14:44                 ` Brian L Scipioni
2005-01-25 21:33   ` [Alsa-user] [PATCH] emu10k1 multichannel support Lee Revell

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=1106091073.24484.60.camel@krustophenia.net \
    --to=rlrevell@joe-job.com \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=alsa-user@lists.sourceforge.net \
    /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.