Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Pieter Palmers <pieter.palmers@student.kuleuven.ac.be>
Cc: alsa-devel@lists.sourceforge.net,
	Jaroslav Kysela <perex@perex.cz>, Uros Bizjak <uros@kss-loka.si>
Subject: Re: FIX: soundblaster rear channels (ens1371)
Date: Fri, 17 Jan 2003 10:55:19 +0100	[thread overview]
Message-ID: <s5hsmvs14oo.wl@alsa2.suse.de> (raw)
In-Reply-To: <200301170104.40726.pieter.palmers@student.kuleuven.ac.be>

At Fri, 17 Jan 2003 01:04:40 +0100,
Pieter Palmers wrote:
> 
> Finally I figured out how to enable the rear channel separately from the front 
> on the creative labs CT5880 (= modified ens1371 as it seems).
 
great!  thanks for your work!

> I'll describe the settings to enable this, but I'm not going to submit a 
> patch, as I have noticed that I messed up my ens1370.c too much, and I can't 
> get a clean version because CVS doesn't work. It's a minor change, so I 
> assume it can be done by the maintainers.
> 
> The whole thing is in three bits in the BASE+0x04 register (ES_REG_STATUS in 
> the driver). These bits are bit27, bit26 and bit24
> There are three modes of operation:
> 1) No rear output: bit27=bit26=bit24=0
> 2) rear output is a mirror of the main output, but controlled by the 
> 'surround' slider of the mixer. I assume the ens1371 mixes the two 'devices' 
> and sends the mix to both MAIN and SURROUND DAC. This mode is selected by 
> setting  bit27=bit24=0 and bit26=1
> 3) independant rear (surround) and front output. Using the current driver, 
> this has the strange side-effect that HW:0,0 becomes the rear output and 
> HW:0,1 becomes the front. So HW:0,0 is controlled by the 'surround' mixer 
> control, and HW:1,0 is controlled by the PCM and Master mixer
> controls.

this is because we are using DAC2 for the hw:0,0 and DAC1 for hw:0,1.
i'm not sure why it is.

Jaroslav, is there any drawback to use DAC1 as default playback?
(i know that the OSS driver uses this order, too.)


> To 
> select this mode set bit27=bit24=1 and bit26=0. It seems that bit27=1 and 
> bit24=bit26=0 is identical, but the windows driver clearly does the first, so 
> why not? It works...
> 
> front only, no rear: 		bit27=0	bit26=0	bit24=0
> rear mirrors front:		bit27=0 	bit26=1 	bit24=0
> front & rear independant:	bit27=1 	bit26=0 	bit24=1 (x?)
> 
> 
> I patched my driver by inserting the following code around line 1947:
> (I included two lines of overlap to make the location easier to find)
> =============================================
> 	outb(ensoniq->uartc = 0x00, ES_REG(ensoniq, UART_CONTROL)); 
> 	outb(0x00, ES_REG(ensoniq, UART_RES));
> 
> #ifdef CHIP1371
> 	/* enable the rear outputs
> 	This seems to work
> 	ensoniq->cssr |= (0 << 27) | (1 << 24);
> 	but the windows driver does this, so let's
> 	also do it */
> 
> 	ensoniq->cssr |= (1 << 27) | (1 << 24);
> 
> 	/*
> 	Use this for mirror mode
> 	ensoniq->cssr |= (1 << 26);*/
> #endif
> 
> 	outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
> #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
> =============================================
> 
> Maybe there is a better place to put this? I don't know... I put it in the 
> snd_ensoniq_create() function because I always want 4ch output, and I don't 
> see the use of the other modes in an ALSA enviroment.
 
it would be better to create new controls, and changing the controls
via hook in the pcm configuration.


> Regards,
> 
> Pieter
> 
> PS: I'm also developing a driver for my Maxisound ISIS, where do I look for 
> information on ALSA/linux driver developement? Does anyone have a 'template' 
> ALSA driver?

there is a tutorial,
	http://www.alsa-project.org/~iwai/writing-an-alsa-driver/index.html

the docbook source is found in alsa-kernel/Documentation/DocBook.


> Does ALSA support non-DMA audio transfer? I believe the ISIS uses this kind of 
> transfers, but I don't know for sure yet. I know it's stupid design not to 
> use DMA, but there is nothing to do about it I guess.

yes, but the implementation depends on the driver.
you can use tasklet for transferring the data e.g. via io-port
read/write.

Uros has been working on the ALSA SAM9407 driver, and IIRC, maxi ISIS
uses a similar (same?) chip.  he might be able to help the development
of this driver.


ciao,

Takashi


-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en

  reply	other threads:[~2003-01-17  9:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-15 23:14 cs64xx distortion (GameTheater XP) Christian Esken
2003-01-16 10:24 ` Takashi Iwai
2003-01-16 23:11 ` Benny Sjostrand
2003-01-17  0:04   ` FIX: soundblaster rear channels (ens1371) Pieter Palmers
2003-01-17  9:55     ` Takashi Iwai [this message]
2003-01-17 10:36       ` Pieter Palmers
2003-01-17 10:48         ` Takashi Iwai
2003-01-17 11:32       ` Jaroslav Kysela
2003-01-17 12:11         ` Pieter Palmers
2003-01-17 12:10           ` Takashi Iwai
2003-01-17 12:18             ` Pieter Palmers
2003-01-17 14:08           ` Jaroslav Kysela
2003-01-17 14:14             ` Takashi Iwai
2003-01-17 12:00       ` Uros Bizjak
2003-01-17 12:47         ` support for SAM940x based cards Pieter Palmers
2003-01-17 13:09           ` Uros Bizjak
2003-01-17  0:38   ` cs64xx distortion (GameTheater XP) Richard Olsson
2003-01-18 11:13   ` Christian Esken
2003-01-18 16:06     ` Benny Sjostrand
2003-01-18 18:04       ` Friedrich Ewaldt

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=s5hsmvs14oo.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=perex@perex.cz \
    --cc=pieter.palmers@student.kuleuven.ac.be \
    --cc=uros@kss-loka.si \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox