All of lore.kernel.org
 help / color / mirror / Atom feed
* Channels jumping with snd_intel8x0, nforce2 and 5.1 output
@ 2004-01-04 17:55 Gorka Olaizola
  2004-01-05 14:27 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Gorka Olaizola @ 2004-01-04 17:55 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

Hello,

I've been experimenting with a Nforce2 mobo during last month and the only
thing I couldn't fix is this sound problem with 5.1 surround sound.

I have read all the messages in this and other lists refering this problem
and I have tried 3 different versions of alsa drivers (0.9.8, 1.0.0rc2 and
latest cvs 1.0.1). All of this present the same problem of jumping channels.

When seeking in mplayer or using speaker_test the channels change their
positions randomly.
I know it's a known bug but I want to know if it's on the list of bugs
to fix or if it is a bigger problem like lack of documentation or something.

If there is a way I can help or something I can do to isolate this bug tell
me.

Thank you

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Channels jumping with snd_intel8x0, nforce2 and 5.1 output
  2004-01-04 17:55 Channels jumping with snd_intel8x0, nforce2 and 5.1 output Gorka Olaizola
@ 2004-01-05 14:27 ` Takashi Iwai
  2004-01-05 17:59   ` Gorka Olaizola
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2004-01-05 14:27 UTC (permalink / raw)
  To: Gorka Olaizola; +Cc: alsa-devel

At Sun, 4 Jan 2004 18:55:52 +0100,
Gorka Olaizola wrote:
> 
> [1  <text/plain; us-ascii (7bit)>]
> Hello,
> 
> I've been experimenting with a Nforce2 mobo during last month and the only
> thing I couldn't fix is this sound problem with 5.1 surround sound.
> 
> I have read all the messages in this and other lists refering this problem
> and I have tried 3 different versions of alsa drivers (0.9.8, 1.0.0rc2 and
> latest cvs 1.0.1). All of this present the same problem of jumping channels.
> 
> When seeking in mplayer or using speaker_test the channels change their
> positions randomly.
> I know it's a known bug but I want to know if it's on the list of bugs
> to fix or if it is a bigger problem like lack of documentation or something.

does this happen with 4.0 output?

what came into my mind is the alignment problem, if it doesn't happen
with 4.0 output.  check the period and buffer size shown in
/proc/asound/card0/pcm0p/sub0 directory, anyway.


thanks,

Takashi


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Channels jumping with snd_intel8x0, nforce2 and 5.1 output
  2004-01-05 14:27 ` Takashi Iwai
@ 2004-01-05 17:59   ` Gorka Olaizola
  2004-01-08 22:24     ` Gorka Olaizola
  0 siblings, 1 reply; 5+ messages in thread
From: Gorka Olaizola @ 2004-01-05 17:59 UTC (permalink / raw)
  To: Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]

On Mon, Jan 05, 2004 at 03:27:15PM +0100, Takashi Iwai wrote:
> 
> does this happen with 4.0 output?
> 
With 4.0 and 4 channels it doesn't seem to happen.

Output while using #speaker_test -Dsurround40 -c 4 -r 48000

cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 4
rate: 48000 (48000/1)
period_size: 1200
buffer_size: 4800
tick_time: 1000

cat /proc/asound/card0/pcm0p/sub0/sw_params
tstamp_mode: NONE
period_step: 1
sleep_min: 0
avail_min: 1200
xfer_align: 1
start_threshold: 4800
stop_threshold: 4800
silence_threshold: 0
silence_size: 0
boundary: 1258291200

cat /proc/asound/card0/pcm0p/sub0/prealloc
64


The output of  #speaker_test -Dsurround51 -c 6 -r 48000
is the same than the above one but with 6 channels.

Sometimes, when the channel jumping happens in surround51, playing
speaker_test with surround40 scrolls the channels too (The rear speaker
play instead the front speaker). Playing speaker_test
again and again in surround40 mode does not seem to scroll the channels.
They stay changed until I change them in surround51 mode.

If I change the period_size and buffer_size in the speaker_test code
to 1024 and 8192, the values stay the same in surround40 mode but the
buffer_size value change to 5120 in surround51 mode. I don't know if it does
matter.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Channels jumping with snd_intel8x0, nforce2 and 5.1 output
  2004-01-05 17:59   ` Gorka Olaizola
@ 2004-01-08 22:24     ` Gorka Olaizola
  2004-01-12 17:08       ` Clemens Ladisch
  0 siblings, 1 reply; 5+ messages in thread
From: Gorka Olaizola @ 2004-01-08 22:24 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 2309 bytes --]

I think i've found something interesting.

I downloaded de nvaudio driver from Nvidia's site and read the source a bit.
I found this function:

void __start_dac(struct Nvaudio_state *state)
{
    int i =0;
    unsigned int i_glob_cnt = 0;
    struct Nvaudio_card *card = state->card;
    struct dmabuf *dmabuf = &state->dmabuffer;

    if (dmabuf->count > 0 && state->ready && !state->enable &&
        (state->trigger & PCM_ENABLE_OUTPUT)) {

----------------------------------------------------------------------
        /* Reset the Global Cnt back to Stereo 16ch and set the format 
           This is needed to keep the 6 channel data in alignment ,
           to start from Front Left always */
        i_glob_cnt = inl(card->iobase + GLOB_CNT);
        outl((i_glob_cnt & 0xcfffff),card->iobase + GLOB_CNT);
        mdelay(50);
        outl(i_glob_cnt,card->iobase + GLOB_CNT);
----------------------------------------------------------------------
        /* Reset the leftover datainfo*/
        for(i=0; i < 5 ; i++)
            AnalogLeftovers[i] = 0;
        AnalogLeftoverCount = 0;

        state->enable = DAC_RUNNING;

        /* Interrupt Enable, LVI Enable, DMA Enable*/
        outb((0x10|0x04|0x01), state->card->iobase + PO_CR);

#ifdef NV_DEBUG_PLAY
        printk("Starting DAC \n");
#endif
    }
}

I translated the part that I thought interesting to the function
"snd_intel8x0_setup_multi_channels" in the file intel8x0.c of Alsa (Line
923)

I have added this to the function

	case DEVICE_NFORCE:
		cnt = igetdword(chip, ICHREG(GLOB_CNT));
		cnt &= ~ICH_PCM_246_MASK;
		if (chip->multi4 && channels == 4)
			cnt |= ICH_PCM_4;
		else if (chip->multi6 && channels == 6)
			cnt |= ICH_PCM_6;
		iputdword(chip, ICHREG(GLOB_CNT), (cnt & 0xcfffff));
		mdelay(50);
		iputdword(chip, ICHREG(GLOB_CNT), cnt);
		break;

Now speaker_test works well for me and the sound is coming from the right
speaker all the time. But there are some problems.
With mplayer in oss emulation the sound is very choppy and with
alsa9:surround51 there are constant cracks and pops.
If I play a DVD with xine with alsa:surround51 the sound seems correct and I
don't hear cracks. Maybe mplayer has some problems with alsa 1.0.x

I hope it's useful.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Channels jumping with snd_intel8x0, nforce2 and 5.1 output
  2004-01-08 22:24     ` Gorka Olaizola
@ 2004-01-12 17:08       ` Clemens Ladisch
  0 siblings, 0 replies; 5+ messages in thread
From: Clemens Ladisch @ 2004-01-12 17:08 UTC (permalink / raw)
  To: Gorka Olaizola; +Cc: alsa-devel

Gorka Olaizola wrote:
> I downloaded de nvaudio driver from Nvidia's site and read the source a bit.
>
>         /* Reset the Global Cnt back to Stereo 16ch and set the format
>            This is needed to keep the 6 channel data in alignment ,
>            to start from Front Left always */
>         i_glob_cnt = inl(card->iobase + GLOB_CNT);
>         outl((i_glob_cnt & 0xcfffff),card->iobase + GLOB_CNT);
>         mdelay(50);
>         outl(i_glob_cnt,card->iobase + GLOB_CNT);
>
> I translated the part that I thought interesting to the function
> "snd_intel8x0_setup_multi_channels" in the file intel8x0.c of Alsa (Line
> 923)
> ...
> Now speaker_test works well for me and the sound is coming from the right
> speaker all the time. But there are some problems.
> With mplayer in oss emulation the sound is very choppy and with
> alsa9:surround51 there are constant cracks and pops.
> If I play a DVD with xine with alsa:surround51 the sound seems correct and I
> don't hear cracks. Maybe mplayer has some problems with alsa 1.0.x

I think these problems are not related to your patch.

Please add an explanatory comment to your change, and submit a patch
for intel8x0.c.


Regards,
Clemens




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-12 17:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-04 17:55 Channels jumping with snd_intel8x0, nforce2 and 5.1 output Gorka Olaizola
2004-01-05 14:27 ` Takashi Iwai
2004-01-05 17:59   ` Gorka Olaizola
2004-01-08 22:24     ` Gorka Olaizola
2004-01-12 17:08       ` Clemens Ladisch

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.