linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.0 sound output - wierd effects
@ 2003-12-26 21:55 Martin J. Bligh
  2003-12-26 22:27 ` Sven-Haegar Koch
                   ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-26 21:55 UTC (permalink / raw)
  To: linux-kernel

Upgraded my home desktop to 2.6.0. 
Somewhere between 2.5.63 and 2.6.0, sound got screwed up - I've confirmed
this happens on mainline, as well as -mjb.

If I leave xmms playing (in random shuffle mode) every 2 minutes or so,
I'll get some wierd effect for a few seconds, either static, or the track 
will mysteriously speed up or slow down. Then all is back to normal for 
another couple of minutes.

Anyone else seen this, or got any clues? Else I guess I'm stuck playing
bisection search.

Advanced Linux Sound Architecture Driver Version 0.9.7 (Thu Sep 25 19:16:36 2003 UTC).
PCI: Found IRQ 11 for device 0000:00:02.7
intel8x0: clocking to 48000
ALSA device list:
#0: SiS SI7012 at 0xdc00, irq 11

AMD Athlon(tm) XP 2100+, no power management or ACPI compiled in.

M.


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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 21:55 2.6.0 sound output - wierd effects Martin J. Bligh
@ 2003-12-26 22:27 ` Sven-Haegar Koch
  2003-12-27 16:14   ` Martin J. Bligh
  2003-12-26 22:52 ` Martin Schlemmer
  2003-12-26 22:59 ` 2.6.0 sound output - wierd effects Sander Sweers
  2 siblings, 1 reply; 41+ messages in thread
From: Sven-Haegar Koch @ 2003-12-26 22:27 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: linux-kernel

On Fri, 26 Dec 2003, Martin J. Bligh wrote:

> Upgraded my home desktop to 2.6.0.
> Somewhere between 2.5.63 and 2.6.0, sound got screwed up - I've confirmed
> this happens on mainline, as well as -mjb.
>
> If I leave xmms playing (in random shuffle mode) every 2 minutes or so,
> I'll get some wierd effect for a few seconds, either static, or the track
> will mysteriously speed up or slow down. Then all is back to normal for
> another couple of minutes.
>
> Anyone else seen this, or got any clues? Else I guess I'm stuck playing
> bisection search.

I get exactly the same with kernel 2.4 and alsa, intel8x0 ac97, but did
not test alsa 1.0rc yet, which mentions "intel8x0 driver fixes, OSS PCM
emulation fixes" - perhaps these fixes help.

c'ya
sven

-- 

The Internet treats censorship as a routing problem, and routes around it.
(John Gilmore on http://www.cygnus.com/~gnu/)

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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 21:55 2.6.0 sound output - wierd effects Martin J. Bligh
  2003-12-26 22:27 ` Sven-Haegar Koch
@ 2003-12-26 22:52 ` Martin Schlemmer
  2003-12-26 23:00   ` Martin J. Bligh
  2003-12-26 22:59 ` 2.6.0 sound output - wierd effects Sander Sweers
  2 siblings, 1 reply; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-26 22:52 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: Linux Kernel Mailing Lists

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

On Fri, 2003-12-26 at 23:55, Martin J. Bligh wrote:
> Upgraded my home desktop to 2.6.0. 
> Somewhere between 2.5.63 and 2.6.0, sound got screwed up - I've confirmed
> this happens on mainline, as well as -mjb.
> 
> If I leave xmms playing (in random shuffle mode) every 2 minutes or so,
> I'll get some wierd effect for a few seconds, either static, or the track 
> will mysteriously speed up or slow down. Then all is back to normal for 
> another couple of minutes.
> 
> Anyone else seen this, or got any clues? Else I guess I'm stuck playing
> bisection search.
> 
> Advanced Linux Sound Architecture Driver Version 0.9.7 (Thu Sep 25 19:16:36 2003 UTC).
> PCI: Found IRQ 11 for device 0000:00:02.7
> intel8x0: clocking to 48000
> ALSA device list:
> #0: SiS SI7012 at 0xdc00, irq 11
> 
> AMD Athlon(tm) XP 2100+, no power management or ACPI compiled in.
> 

I have had this as well, around there, and started using OSS, which
worked fine (ICH5 onboard - also).  Somewhere when I tried again, it
worked fine, so this is what I am using now.  What version userland
libs/utils ?  OSS emulation?

-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 21:55 2.6.0 sound output - wierd effects Martin J. Bligh
  2003-12-26 22:27 ` Sven-Haegar Koch
  2003-12-26 22:52 ` Martin Schlemmer
@ 2003-12-26 22:59 ` Sander Sweers
  2003-12-26 23:02   ` Martin J. Bligh
  2 siblings, 1 reply; 41+ messages in thread
From: Sander Sweers @ 2003-12-26 22:59 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: linux-kernel

Martin J. Bligh wrote:
> Upgraded my home desktop to 2.6.0. 
> Somewhere between 2.5.63 and 2.6.0, sound got screwed up - I've confirmed
> this happens on mainline, as well as -mjb.
> 
> If I leave xmms playing (in random shuffle mode) every 2 minutes or so,
> I'll get some wierd effect for a few seconds, either static, or the track 
> will mysteriously speed up or slow down. Then all is back to normal for 
> another couple of minutes.
> 
> Anyone else seen this, or got any clues? Else I guess I'm stuck playing
> bisection search.
> 

Yes had this problem, i found that it was the oss emulation. When i
switched to the alsa plugin the effect was gone.



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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 22:52 ` Martin Schlemmer
@ 2003-12-26 23:00   ` Martin J. Bligh
  2003-12-26 23:17     ` Martin Schlemmer
  0 siblings, 1 reply; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-26 23:00 UTC (permalink / raw)
  To: azarah; +Cc: Linux Kernel Mailing Lists



--Martin Schlemmer <azarah@nosferatu.za.org> wrote (on Saturday, December 27, 2003 00:52:47 +0200):

> On Fri, 2003-12-26 at 23:55, Martin J. Bligh wrote:
>> Upgraded my home desktop to 2.6.0. 
>> Somewhere between 2.5.63 and 2.6.0, sound got screwed up - I've confirmed
>> this happens on mainline, as well as -mjb.
>> 
>> If I leave xmms playing (in random shuffle mode) every 2 minutes or so,
>> I'll get some wierd effect for a few seconds, either static, or the track 
>> will mysteriously speed up or slow down. Then all is back to normal for 
>> another couple of minutes.
>> 
>> Anyone else seen this, or got any clues? Else I guess I'm stuck playing
>> bisection search.
>> 
>> Advanced Linux Sound Architecture Driver Version 0.9.7 (Thu Sep 25 19:16:36 2003 UTC).
>> PCI: Found IRQ 11 for device 0000:00:02.7
>> intel8x0: clocking to 48000
>> ALSA device list:
>> # 0: SiS SI7012 at 0xdc00, irq 11
>> 
>> AMD Athlon(tm) XP 2100+, no power management or ACPI compiled in.
>> 
> 
> I have had this as well, around there, and started using OSS, which
> worked fine (ICH5 onboard - also).  Somewhere when I tried again, it
> worked fine, so this is what I am using now.  What version userland
> libs/utils ?  OSS emulation?
> 
> -- 
> Martin Schlemmer

Dunno - I'm not clued up on sound stuff.

$ egrep  '(SOUND|SND|ALSA|OSS)' /boot/config-2.6.0 | egrep -v '^#'
CONFIG_SOUND_GAMEPORT=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_SEQUENCER=y
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_ENS1371=y
CONFIG_SND_INTEL8X0=y

Userspace stuff is stock Debian Woody, but not sure which libs you
want the version of. The following might help, but probably doesn't

M.

PS. 2.5.70 seems to work as well.

$ apt-cache showpkg xmms
Package: xmms
Versions: 
1.2.7-1(/var/lib/apt/lists/ftp.debian.org_debian_dists_stable_main_binary-i386_Packages)(/var/lib/dpkg/status)

Reverse Depends: 
  eroaster,xmms
  xmms-liveice,xmms
  xmmsarts,xmms
  xmms-wmdiscotux,xmms
  xmms-volnorm,xmms
  xmms-synaesthesia,xmms
  xmms-singit,xmms
  xmms-sid,xmms 1.2.5
  xmms-shell,xmms
  xmms-qbble,xmms
  xmms-osd-plugin,xmms 1.2.0
  xmms-msa,xmms
  xmms-modplug,xmms
  xmms-lirc,xmms
  xmms-jess,xmms 1.0
  xmms-jess,xmms
  xmms-infopipe,xmms
  xmms-goodnight,xmms
  xmms-fmradio,xmms
  xmms-flac,xmms
  xmms-dev,xmms 0.9.5.1-4
  xmms-dev,xmms 1.2.7-1
  xmms-crossfade,xmms
  xmms-cdread,xmms 1.2.5
  xmms-bumpscope,xmms
  xmms-alarm,xmms 1.2
  wmxmms-spectrum,xmms 0.9.5
  wmusic,xmms
  rep-xmms,xmms 1.2.4
  normalize,xmms
  logjam,xmms
  libxmms-perl,xmms
  junior-sound,xmms
  gnomp3,xmms
  gkrellmms,xmms
  gdancer,xmms
  extace,xmms
  eroaster,xmms
Dependencies: 
1.2.7-1 - libc6 (2 2.2.4-4) libglib1.2 (2 1.2.0) libgtk1.2 (2 1.2.10-4) xlibs (4 4.1.0) unzip (0 (null)) gdk-imlib1 (0 (null)) libart2 (2 1.2.13-5) libdb3 (2 3.2.9-1) libgnome32 (2 1.2.13-5) libgnomesupport0 (2 1.2.13-5) libgnomeui32 (2 1.2.13-5) libgnorba27 (2 1.2.13-5) liborbit0 (2 0.5.12) libpanel-applet0 (2 1.4.0.2-3) libwrap0 (0 (null)) libaudiofile0 (0 (null)) libesd0 (18 0.2.23-1) libesd-alsa0 (2 0.2.23-1) libgl1 (0 (null)) libmikmod2 (2 3.1.9) libogg0 (2 1.0rc3-1) libvorbis0 (2 1.0rc3-1) libxml1 (2 1:1.8.14-3) zlib1g (2 1:1.1.3) x11ampg (0 (null)) x11amp (0 (null)) xmms-vorbis (0 (null)) x11ampg (0 (null)) x11amp (0 (null)) xmms-vorbis (0 (null)) 
Provides: 
1.2.7-1 - xmms-vorbis x11amp x11ampg mp3-decoder 
Reverse Provides: 




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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 22:59 ` 2.6.0 sound output - wierd effects Sander Sweers
@ 2003-12-26 23:02   ` Martin J. Bligh
  0 siblings, 0 replies; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-26 23:02 UTC (permalink / raw)
  To: Sander Sweers; +Cc: linux-kernel

>> Anyone else seen this, or got any clues? Else I guess I'm stuck playing
>> bisection search.
> 
> Yes had this problem, i found that it was the oss emulation. When i
> switched to the alsa plugin the effect was gone.

Cool, thanks ... but it used to work this way. 2.5.70 worked ... if you're
seeing the same problem on 2.6.0, any chance you could confirm that 2.5.70
works for you?

M.


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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 23:00   ` Martin J. Bligh
@ 2003-12-26 23:17     ` Martin Schlemmer
  2003-12-26 23:24       ` Martin J. Bligh
  0 siblings, 1 reply; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-26 23:17 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: Linux Kernel Mailing Lists

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

On Sat, 2003-12-27 at 01:00, Martin J. Bligh wrote:
> --Martin Schlemmer <azarah@nosferatu.za.org> wrote (on Saturday, December 27, 2003 00:52:47 +0200):
> 
> > On Fri, 2003-12-26 at 23:55, Martin J. Bligh wrote:
> >> Upgraded my home desktop to 2.6.0. 
> >> Somewhere between 2.5.63 and 2.6.0, sound got screwed up - I've confirmed
> >> this happens on mainline, as well as -mjb.
> >> 
> >> If I leave xmms playing (in random shuffle mode) every 2 minutes or so,
> >> I'll get some wierd effect for a few seconds, either static, or the track 
> >> will mysteriously speed up or slow down. Then all is back to normal for 
> >> another couple of minutes.
> >> 
> >> Anyone else seen this, or got any clues? Else I guess I'm stuck playing
> >> bisection search.
> >> 
> >> Advanced Linux Sound Architecture Driver Version 0.9.7 (Thu Sep 25 19:16:36 2003 UTC).
> >> PCI: Found IRQ 11 for device 0000:00:02.7
> >> intel8x0: clocking to 48000
> >> ALSA device list:
> >> # 0: SiS SI7012 at 0xdc00, irq 11
> >> 
> >> AMD Athlon(tm) XP 2100+, no power management or ACPI compiled in.
> >> 
> > 
> > I have had this as well, around there, and started using OSS, which
> > worked fine (ICH5 onboard - also).  Somewhere when I tried again, it
> > worked fine, so this is what I am using now.  What version userland
> > libs/utils ?  OSS emulation?
> > 

> Userspace stuff is stock Debian Woody, but not sure which libs you
> want the version of. The following might help, but probably doesn't
> 

Over here the your main one if not using oss emu is alsa-lib  I used
0.9.8 for most of the time, but latest 1.0_rc[12] works as well.
Also for completeness you might include the version of alsa-utils.

Then, what does lsmod give?  Also, does xmms use oss or alsa as output
driver - switching between the two may or may not improve things?


-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 23:17     ` Martin Schlemmer
@ 2003-12-26 23:24       ` Martin J. Bligh
  2003-12-26 23:50         ` Martin Schlemmer
  0 siblings, 1 reply; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-26 23:24 UTC (permalink / raw)
  To: azarah; +Cc: Linux Kernel Mailing Lists

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

> Over here the your main one if not using oss emu is alsa-lib  I used
> 0.9.8 for most of the time, but latest 1.0_rc[12] works as well.

Debian doesn't seem to have an alsa-lib exactly.

Package: libalsaplayer0
Versions: 
0.99.59-5(/var/lib/apt/lists/ftp.debian.org_debian_dists_stable_main_binary-i386_Packages)(/var/lib/dpkg/status)
(provides /usr/lib/libalsaplayer.so.0.0.1)

$ apt-cache showpkg alsaplayer-alsa     
Package: alsaplayer-alsa
Versions: 
0.99.59-5(/var/lib/apt/lists/ftp.debian.org_debian_dists_stable_main_binary-i386_Packages)(/var/lib/dpkg/status)
(provides /usr/lib/alsaplayer/output/libalsa.so)

> Also for completeness you might include the version of alsa-utils.


$ apt-cache showpkg alsa-utils
Package: alsa-utils
Versions: 
0.9.0beta12-1(/var/lib/apt/lists/ftp.debian.org_debian_dists_stable_main_binary-i386_Packages)(/var/lib/dpkg/status)

> Then, what does lsmod give?

Nothing, as I don't use modules ;-)
I'll attatch the full config.

>  Also, does xmms use oss or alsa as output
> driver - switching between the two may or may not improve things?

Errm. No idea which it uses, nor can I see anything in it that switches ;-)

M.

PS. Current search gives us that it broke between 2.5.70 and 2.6.0-test3.



[-- Attachment #2: config-2.6.0 --]
[-- Type: application/octet-stream, Size: 23335 bytes --]

#
# Automatically generated make config: don't edit
#
CONFIG_X86=y
CONFIG_MMU=y
CONFIG_UID16=y
CONFIG_GENERIC_ISA_DMA=y

#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_STANDALONE=y
CONFIG_BROKEN_ON_SMP=y

#
# General setup
#
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_IKCONFIG is not set
# CONFIG_EMBEDDED is not set
CONFIG_KALLSYMS=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y

#
# Loadable module support
#
CONFIG_MODULES=y
# CONFIG_MODULE_UNLOAD is not set
CONFIG_OBSOLETE_MODPARM=y
# CONFIG_MODVERSIONS is not set
CONFIG_KMOD=y

#
# Processor type and features
#
CONFIG_X86_PC=y
# CONFIG_X86_VOYAGER is not set
# CONFIG_X86_NUMAQ is not set
# CONFIG_X86_SUMMIT is not set
# CONFIG_X86_BIGSMP is not set
# CONFIG_X86_VISWS is not set
# CONFIG_X86_GENERICARCH is not set
# CONFIG_X86_ES7000 is not set
# CONFIG_M386 is not set
# CONFIG_M486 is not set
CONFIG_M586=y
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
# CONFIG_M686 is not set
# CONFIG_MPENTIUMII is not set
# CONFIG_MPENTIUMIII is not set
# CONFIG_MPENTIUM4 is not set
# CONFIG_MK6 is not set
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
# CONFIG_MELAN is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MWINCHIPC6 is not set
# CONFIG_MWINCHIP2 is not set
# CONFIG_MWINCHIP3D is not set
# CONFIG_MCYRIXIII is not set
# CONFIG_MVIAC3_2 is not set
# CONFIG_X86_GENERIC is not set
CONFIG_X86_CMPXCHG=y
CONFIG_X86_XADD=y
CONFIG_X86_L1_CACHE_SHIFT=5
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_X86_PPRO_FENCE=y
CONFIG_X86_F00F_BUG=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_INVLPG=y
CONFIG_X86_BSWAP=y
CONFIG_X86_POPAD_OK=y
CONFIG_X86_ALIGNMENT_16=y
# CONFIG_HPET_TIMER is not set
# CONFIG_HPET_EMULATE_RTC is not set
# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
# CONFIG_X86_UP_APIC is not set
# CONFIG_X86_MCE is not set
# CONFIG_TOSHIBA is not set
# CONFIG_I8K is not set
# CONFIG_MICROCODE is not set
# CONFIG_X86_MSR is not set
# CONFIG_X86_CPUID is not set
# CONFIG_EDD is not set
CONFIG_NOHIGHMEM=y
# CONFIG_HIGHMEM4G is not set
# CONFIG_HIGHMEM64G is not set
# CONFIG_MATH_EMULATION is not set
# CONFIG_MTRR is not set

#
# Power management options (ACPI, APM)
#
# CONFIG_PM is not set

#
# ACPI (Advanced Configuration and Power Interface) Support
#
# CONFIG_ACPI is not set

#
# CPU Frequency scaling
#
# CONFIG_CPU_FREQ is not set

#
# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
#
CONFIG_PCI=y
# CONFIG_PCI_GOBIOS is not set
# CONFIG_PCI_GODIRECT is not set
CONFIG_PCI_GOANY=y
CONFIG_PCI_BIOS=y
CONFIG_PCI_DIRECT=y
# CONFIG_PCI_LEGACY_PROC is not set
CONFIG_PCI_NAMES=y
CONFIG_ISA=y
# CONFIG_EISA is not set
# CONFIG_MCA is not set
# CONFIG_SCx200 is not set
CONFIG_HOTPLUG=y

#
# PCMCIA/CardBus support
#
CONFIG_PCMCIA=y
# CONFIG_YENTA is not set
# CONFIG_I82092 is not set
# CONFIG_I82365 is not set
# CONFIG_TCIC is not set
CONFIG_PCMCIA_PROBE=y

#
# PCI Hotplug Support
#
# CONFIG_HOTPLUG_PCI is not set

#
# Executable file formats
#
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_MISC=y

#
# Device Drivers
#

#
# Generic Driver Options
#
# CONFIG_FW_LOADER is not set

#
# Memory Technology Devices (MTD)
#
# CONFIG_MTD is not set

#
# Parallel port support
#
CONFIG_PARPORT=y
CONFIG_PARPORT_PC=y
CONFIG_PARPORT_PC_CML1=y
# CONFIG_PARPORT_SERIAL is not set
# CONFIG_PARPORT_PC_FIFO is not set
# CONFIG_PARPORT_PC_SUPERIO is not set
# CONFIG_PARPORT_PC_PCMCIA is not set
# CONFIG_PARPORT_OTHER is not set
# CONFIG_PARPORT_1284 is not set

#
# Plug and Play support
#
# CONFIG_PNP is not set

#
# Block devices
#
CONFIG_BLK_DEV_FD=y
# CONFIG_BLK_DEV_XD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_LBD is not set

#
# ATA/ATAPI/MFM/RLL support
#
CONFIG_IDE=y
CONFIG_BLK_DEV_IDE=y

#
# Please see Documentation/ide.txt for help/info on IDE drives
#
# CONFIG_BLK_DEV_HD_IDE is not set
CONFIG_BLK_DEV_IDEDISK=y
CONFIG_IDEDISK_MULTI_MODE=y
# CONFIG_IDEDISK_STROKE is not set
# CONFIG_BLK_DEV_IDECS is not set
CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_IDEFLOPPY is not set
CONFIG_BLK_DEV_IDESCSI=y
# CONFIG_IDE_TASK_IOCTL is not set
# CONFIG_IDE_TASKFILE_IO is not set

#
# IDE chipset support/bugfixes
#
CONFIG_BLK_DEV_CMD640=y
# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_BLK_DEV_GENERIC is not set
# CONFIG_BLK_DEV_OPTI621 is not set
CONFIG_BLK_DEV_RZ1000=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y
# CONFIG_IDEDMA_ONLYDISK is not set
# CONFIG_IDEDMA_PCI_WIP is not set
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_BLK_DEV_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD74XX is not set
# CONFIG_BLK_DEV_CMD64X is not set
# CONFIG_BLK_DEV_TRIFLEX is not set
# CONFIG_BLK_DEV_CY82C693 is not set
# CONFIG_BLK_DEV_CS5520 is not set
# CONFIG_BLK_DEV_CS5530 is not set
# CONFIG_BLK_DEV_HPT34X is not set
# CONFIG_BLK_DEV_HPT366 is not set
# CONFIG_BLK_DEV_SC1200 is not set
CONFIG_BLK_DEV_PIIX=y
# CONFIG_BLK_DEV_NS87415 is not set
# CONFIG_BLK_DEV_PDC202XX_OLD is not set
# CONFIG_BLK_DEV_PDC202XX_NEW is not set
# CONFIG_BLK_DEV_SVWKS is not set
# CONFIG_BLK_DEV_SIIMAGE is not set
CONFIG_BLK_DEV_SIS5513=y
# CONFIG_BLK_DEV_SLC90E66 is not set
# CONFIG_BLK_DEV_TRM290 is not set
# CONFIG_BLK_DEV_VIA82CXXX is not set
# CONFIG_IDE_CHIPSETS is not set
CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_IVB is not set
CONFIG_IDEDMA_AUTO=y
# CONFIG_DMA_NONPCI is not set
# CONFIG_BLK_DEV_HD is not set

#
# SCSI device support
#
CONFIG_SCSI=y
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
CONFIG_BLK_DEV_SR=y
# CONFIG_BLK_DEV_SR_VENDOR is not set
CONFIG_CHR_DEV_SG=y

#
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
#
# CONFIG_SCSI_MULTI_LUN is not set
CONFIG_SCSI_REPORT_LUNS=y
# CONFIG_SCSI_CONSTANTS is not set
# CONFIG_SCSI_LOGGING is not set

#
# SCSI low-level drivers
#
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_7000FASST is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AHA152X is not set
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
CONFIG_SCSI_AIC7XXX_OLD=y
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_IN2000 is not set
# CONFIG_SCSI_MEGARAID is not set
# CONFIG_SCSI_SATA is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_CPQFCTS is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_DTC3280 is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_EATA_PIO is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_GENERIC_NCR5380 is not set
# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_PPA is not set
# CONFIG_SCSI_IMM is not set
# CONFIG_SCSI_NCR53C406A is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_PAS16 is not set
# CONFIG_SCSI_PSI240I is not set
# CONFIG_SCSI_QLOGIC_FAS is not set
CONFIG_SCSI_QLOGIC_ISP=y
# CONFIG_SCSI_QLOGIC_FC is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_SYM53C416 is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_T128 is not set
# CONFIG_SCSI_U14_34F is not set
# CONFIG_SCSI_ULTRASTOR is not set
# CONFIG_SCSI_NSP32 is not set
# CONFIG_SCSI_DEBUG is not set

#
# PCMCIA SCSI adapter support
#
# CONFIG_PCMCIA_AHA152X is not set
# CONFIG_PCMCIA_FDOMAIN is not set
# CONFIG_PCMCIA_NINJA_SCSI is not set
# CONFIG_PCMCIA_QLOGIC is not set

#
# Old CD-ROM drivers (not SCSI, not IDE)
#
# CONFIG_CD_NO_IDESCSI is not set

#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set

#
# Fusion MPT device support
#
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support (EXPERIMENTAL)
#
# CONFIG_IEEE1394 is not set

#
# I2O device support
#
# CONFIG_I2O is not set

#
# Networking support
#
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
# CONFIG_NETLINK_DEV is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_PNP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_ARPD is not set
# CONFIG_INET_ECN is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_IPV6 is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_NETFILTER is not set

#
# SCTP Configuration (EXPERIMENTAL)
#
CONFIG_IPV6_SCTP__=y
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_FASTROUTE is not set
# CONFIG_NET_HW_FLOWCONTROL is not set

#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
CONFIG_NETDEVICES=y

#
# ARCnet devices
#
# CONFIG_ARCNET is not set
CONFIG_DUMMY=y
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set

#
# Ethernet (10 or 100Mbit)
#
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
CONFIG_NET_VENDOR_3COM=y
# CONFIG_EL1 is not set
# CONFIG_EL2 is not set
# CONFIG_ELPLUS is not set
# CONFIG_EL16 is not set
CONFIG_EL3=y
# CONFIG_3C515 is not set
CONFIG_VORTEX=y
# CONFIG_TYPHOON is not set
# CONFIG_LANCE is not set
# CONFIG_NET_VENDOR_SMC is not set
# CONFIG_NET_VENDOR_RACAL is not set

#
# Tulip family network device support
#
CONFIG_NET_TULIP=y
# CONFIG_DE2104X is not set
CONFIG_TULIP=y
# CONFIG_TULIP_MWI is not set
CONFIG_TULIP_MMIO=y
# CONFIG_DE4X5 is not set
# CONFIG_WINBOND_840 is not set
# CONFIG_DM9102 is not set
# CONFIG_AT1700 is not set
# CONFIG_DEPCA is not set
# CONFIG_HP100 is not set
CONFIG_NET_ISA=y
# CONFIG_E2100 is not set
# CONFIG_EWRK3 is not set
# CONFIG_EEXPRESS is not set
# CONFIG_EEXPRESS_PRO is not set
# CONFIG_HPLAN_PLUS is not set
# CONFIG_HPLAN is not set
# CONFIG_LP486E is not set
# CONFIG_ETH16I is not set
# CONFIG_NE2000 is not set
# CONFIG_ZNET is not set
# CONFIG_SEEQ8005 is not set
CONFIG_NET_PCI=y
# CONFIG_PCNET32 is not set
# CONFIG_AMD8111_ETH is not set
CONFIG_ADAPTEC_STARFIRE=y
# CONFIG_ADAPTEC_STARFIRE_NAPI is not set
# CONFIG_AC3200 is not set
# CONFIG_APRICOT is not set
# CONFIG_B44 is not set
# CONFIG_CS89x0 is not set
# CONFIG_DGRS is not set
CONFIG_EEPRO100=y
# CONFIG_EEPRO100_PIO is not set
# CONFIG_E100 is not set
# CONFIG_FEALNX is not set
# CONFIG_NATSEMI is not set
# CONFIG_NE2K_PCI is not set
# CONFIG_8139CP is not set
# CONFIG_8139TOO is not set
CONFIG_SIS900=y
# CONFIG_EPIC100 is not set
# CONFIG_SUNDANCE is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
# CONFIG_NET_POCKET is not set

#
# Ethernet (1000 Mbit)
#
CONFIG_ACENIC=y
# CONFIG_ACENIC_OMIT_TIGON_I is not set
# CONFIG_DL2K is not set
CONFIG_E1000=y
# CONFIG_E1000_NAPI is not set
# CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_R8169 is not set
# CONFIG_SIS190 is not set
# CONFIG_SK98LIN is not set
# CONFIG_TIGON3 is not set

#
# Ethernet (10000 Mbit)
#
# CONFIG_IXGB is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_PLIP is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set

#
# Wireless LAN (non-hamradio)
#
# CONFIG_NET_RADIO is not set

#
# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
# CONFIG_RCPCI is not set
# CONFIG_SHAPER is not set

#
# Wan interfaces
#
# CONFIG_WAN is not set

#
# PCMCIA network device support
#
CONFIG_NET_PCMCIA=y
# CONFIG_PCMCIA_3C589 is not set
# CONFIG_PCMCIA_3C574 is not set
# CONFIG_PCMCIA_FMVJ18X is not set
CONFIG_PCMCIA_PCNET=y
# CONFIG_PCMCIA_NMCLAN is not set
# CONFIG_PCMCIA_SMC91C92 is not set
# CONFIG_PCMCIA_XIRC2PS is not set
# CONFIG_PCMCIA_AXNET is not set

#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set

#
# IrDA (infrared) support
#
# CONFIG_IRDA is not set

#
# Bluetooth support
#
# CONFIG_BT is not set

#
# ISDN subsystem
#
# CONFIG_ISDN_BOOL is not set

#
# Telephony Support
#
# CONFIG_PHONE is not set

#
# Input device support
#
CONFIG_INPUT=y

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set

#
# Input I/O drivers
#
# CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
# CONFIG_SERIO_PCIPS2 is not set

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=y
# CONFIG_MOUSE_PS2_SYNAPTICS is not set
# CONFIG_MOUSE_SERIAL is not set
# CONFIG_MOUSE_INPORT is not set
# CONFIG_MOUSE_LOGIBM is not set
# CONFIG_MOUSE_PC110PAD is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_SERIAL_NONSTANDARD is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
# CONFIG_SERIAL_8250_CONSOLE is not set
# CONFIG_SERIAL_8250_CS is not set
CONFIG_SERIAL_8250_NR_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
CONFIG_PRINTER=y
# CONFIG_LP_CONSOLE is not set
# CONFIG_PPDEV is not set
# CONFIG_TIPAR is not set

#
# I2C support
#
# CONFIG_I2C is not set

#
# I2C Algorithms
#

#
# I2C Hardware Bus support
#

#
# I2C Hardware Sensors Chip support
#
# CONFIG_I2C_SENSOR is not set

#
# Mice
#
# CONFIG_BUSMOUSE is not set
# CONFIG_QIC02_TAPE is not set

#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set

#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
# CONFIG_SONYPI is not set

#
# Ftape, the floppy tape device driver
#
# CONFIG_FTAPE is not set
CONFIG_AGP=y
# CONFIG_AGP_ALI is not set
# CONFIG_AGP_ATI is not set
# CONFIG_AGP_AMD is not set
# CONFIG_AGP_AMD64 is not set
CONFIG_AGP_INTEL=y
# CONFIG_AGP_NVIDIA is not set
CONFIG_AGP_SIS=y
# CONFIG_AGP_SWORKS is not set
# CONFIG_AGP_VIA is not set
# CONFIG_DRM is not set

#
# PCMCIA character devices
#
# CONFIG_SYNCLINK_CS is not set
# CONFIG_MWAVE is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_HANGCHECK_TIMER is not set

#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set

#
# Digital Video Broadcasting Devices
#
# CONFIG_DVB is not set

#
# Graphics support
#
# CONFIG_FB is not set
# CONFIG_VIDEO_SELECT is not set

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_MDA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y

#
# Sound
#
CONFIG_SOUND=y

#
# Advanced Linux Sound Architecture
#
CONFIG_SND=y
CONFIG_SND_SEQUENCER=y
# CONFIG_SND_SEQ_DUMMY is not set
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_SEQUENCER_OSS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set

#
# Generic devices
#
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_VIRMIDI is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set

#
# ISA devices
#
# CONFIG_SND_AD1848 is not set
# CONFIG_SND_CS4231 is not set
# CONFIG_SND_CS4232 is not set
# CONFIG_SND_CS4236 is not set
# CONFIG_SND_ES1688 is not set
# CONFIG_SND_ES18XX is not set
# CONFIG_SND_GUSCLASSIC is not set
# CONFIG_SND_GUSEXTREME is not set
# CONFIG_SND_GUSMAX is not set
# CONFIG_SND_INTERWAVE is not set
# CONFIG_SND_INTERWAVE_STB is not set
# CONFIG_SND_OPTI92X_AD1848 is not set
# CONFIG_SND_OPTI92X_CS4231 is not set
# CONFIG_SND_OPTI93X is not set
# CONFIG_SND_SB8 is not set
# CONFIG_SND_SB16 is not set
# CONFIG_SND_SBAWE is not set
# CONFIG_SND_WAVEFRONT is not set
# CONFIG_SND_CMI8330 is not set
# CONFIG_SND_OPL3SA2 is not set
# CONFIG_SND_SGALAXY is not set
# CONFIG_SND_SSCAPE is not set

#
# PCI devices
#
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_HDSP is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_YMFPCI is not set
# CONFIG_SND_ALS4000 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_ENS1370 is not set
CONFIG_SND_ENS1371=y
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_FM801 is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
CONFIG_SND_INTEL8X0=y
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VX222 is not set

#
# ALSA USB devices
#
# CONFIG_SND_USB_AUDIO is not set

#
# PCMCIA devices
#
# CONFIG_SND_VXPOCKET is not set
# CONFIG_SND_VXP440 is not set

#
# Open Sound System
#
# CONFIG_SOUND_PRIME is not set

#
# USB support
#
CONFIG_USB=y
# CONFIG_USB_DEBUG is not set

#
# Miscellaneous USB options
#
# CONFIG_USB_DEVICEFS is not set
# CONFIG_USB_BANDWIDTH is not set
# CONFIG_USB_DYNAMIC_MINORS is not set

#
# USB Host Controller Drivers
#
# CONFIG_USB_EHCI_HCD is not set
# CONFIG_USB_OHCI_HCD is not set
# CONFIG_USB_UHCI_HCD is not set

#
# USB Device Class drivers
#
# CONFIG_USB_AUDIO is not set
# CONFIG_USB_BLUETOOTH_TTY is not set
# CONFIG_USB_MIDI is not set
# CONFIG_USB_ACM is not set
# CONFIG_USB_PRINTER is not set
# CONFIG_USB_STORAGE is not set

#
# USB Human Interface Devices (HID)
#
# CONFIG_USB_HID is not set

#
# USB HID Boot Protocol drivers
#
# CONFIG_USB_KBD is not set
# CONFIG_USB_MOUSE is not set
# CONFIG_USB_AIPTEK is not set
# CONFIG_USB_WACOM is not set
# CONFIG_USB_KBTAB is not set
# CONFIG_USB_POWERMATE is not set
# CONFIG_USB_XPAD is not set

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_SCANNER is not set
# CONFIG_USB_MICROTEK is not set
# CONFIG_USB_HPUSBSCSI is not set

#
# USB Multimedia devices
#
# CONFIG_USB_DABUSB is not set

#
# Video4Linux support is needed for USB Multimedia device support
#

#
# USB Network adaptors
#
# CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_USBNET is not set

#
# USB port drivers
#
# CONFIG_USB_USS720 is not set

#
# USB Serial Converter support
#
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
# CONFIG_USB_TIGL is not set
# CONFIG_USB_AUERSWALD is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_BRLVGER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_GADGET is not set

#
# File systems
#
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
# CONFIG_EXT3_FS_POSIX_ACL is not set
# CONFIG_EXT3_FS_SECURITY is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
CONFIG_AUTOFS4_FS=y

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
# CONFIG_ZISOFS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_FAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
# CONFIG_DEVFS_FS is not set
CONFIG_DEVPTS_FS=y
# CONFIG_DEVPTS_FS_XATTR is not set
CONFIG_TMPFS=y
# CONFIG_HUGETLBFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y

#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set

#
# Network File Systems
#
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_DIRECTIO is not set
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V4 is not set
# CONFIG_NFSD_TCP is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=y
CONFIG_SUNRPC=y
# CONFIG_SUNRPC_GSS is not set
CONFIG_SMB_FS=y
# CONFIG_SMB_NLS_DEFAULT is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_INTERMEZZO_FS is not set
# CONFIG_AFS_FS is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_SMB_NLS=y
CONFIG_NLS=y

#
# Native Language Support
#
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_UTF8 is not set

#
# Profiling support
#
CONFIG_PROFILING=y
CONFIG_OPROFILE=y

#
# Kernel hacking
#
# CONFIG_DEBUG_KERNEL is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_FRAME_POINTER is not set

#
# Security options
#
# CONFIG_SECURITY is not set

#
# Cryptographic options
#
# CONFIG_CRYPTO is not set

#
# Library routines
#
CONFIG_CRC32=y
CONFIG_X86_BIOS_REBOOT=y
CONFIG_PC=y

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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 23:24       ` Martin J. Bligh
@ 2003-12-26 23:50         ` Martin Schlemmer
  2003-12-26 23:59           ` Martin J. Bligh
  0 siblings, 1 reply; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-26 23:50 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: Linux Kernel Mailing Lists

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

On Sat, 2003-12-27 at 01:24, Martin J. Bligh wrote:
> > Over here the your main one if not using oss emu is alsa-lib  I used
> > 0.9.8 for most of the time, but latest 1.0_rc[12] works as well.
> 
> Debian doesn't seem to have an alsa-lib exactly.
> 

Should provide /usr/lib/libasound.so.2.0.0 (version may differ).

> >  Also, does xmms use oss or alsa as output
> > driver - switching between the two may or may not improve things?
> 
> Errm. No idea which it uses, nor can I see anything in it that switches ;-)
> 

If you right click on xmms, and then select options->preferences, on the
first page to the bottom there should be output plugin.  If you cannot
select alsa, see if there is a xmms-alsa or libxmms-alsa plugin.  Sorry,
I do not know Debian that well.

Basically as sombody else noted - it might be with the OSS emulation,
so we want to use native alsa support with xmms ...


-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 23:50         ` Martin Schlemmer
@ 2003-12-26 23:59           ` Martin J. Bligh
  2003-12-27  0:44             ` Martin Schlemmer
                               ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-26 23:59 UTC (permalink / raw)
  To: azarah; +Cc: Linux Kernel Mailing Lists

> On Sat, 2003-12-27 at 01:24, Martin J. Bligh wrote:
>> > Over here the your main one if not using oss emu is alsa-lib  I used
>> > 0.9.8 for most of the time, but latest 1.0_rc[12] works as well.
>> 
>> Debian doesn't seem to have an alsa-lib exactly.
> 
> Should provide /usr/lib/libasound.so.2.0.0 (version may differ).

Aha, thanks ;-)

$ dpkg -S /usr/lib/libasound.so.2.0.0
libasound2: /usr/lib/libasound.so.2.0.0

Package: libasound2
Versions: 
0.9.0beta10a-3(/var/lib/apt/lists/ftp.debian.org_debian_dists_stable_main_binary-i386_Packages)(/var/lib/dpkg/status)

Which is probably horribly old, knowing Debian stable ;-)

>> >  Also, does xmms use oss or alsa as output
>> > driver - switching between the two may or may not improve things?
>> 
>> Errm. No idea which it uses, nor can I see anything in it that switches ;-)
>
> If you right click on xmms, and then select options->preferences, on the
> first page to the bottom there should be output plugin.  If you cannot
> select alsa, see if there is a xmms-alsa or libxmms-alsa plugin.  Sorry,
> I do not know Debian that well.

Thanks, it was on OSS - there's no ALSA selection, nor can I find one.
There's probably one in unstable somewhere, but ... see below.
 
> Basically as sombody else noted - it might be with the OSS emulation,
> so we want to use native alsa support with xmms ...

I'll play with it - should narrow things down. However, fundamentally,
it used to work in 2.5.74, and is broken as of test3 ... that strongly
implies to me there's a kernel problem. I'd rather fix OSS emulation
if possible, and save everybody migrating to 2.6 from this pain ... ;-)

M.


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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 23:59           ` Martin J. Bligh
@ 2003-12-27  0:44             ` Martin Schlemmer
  2003-12-27  0:53             ` Martin Schlemmer
  2003-12-27  4:48             ` Stan Bubrouski
  2 siblings, 0 replies; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-27  0:44 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: Linux Kernel Mailing Lists

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

On Sat, 2003-12-27 at 01:59, Martin J. Bligh wrote:

> > Basically as sombody else noted - it might be with the OSS emulation,
> > so we want to use native alsa support with xmms ...
> 
> I'll play with it - should narrow things down. However, fundamentally,
> it used to work in 2.5.74, and is broken as of test3 ... that strongly
> implies to me there's a kernel problem. I'd rather fix OSS emulation
> if possible, and save everybody migrating to 2.6 from this pain ... ;-)
> 

I was using esound compiled with alsa support, but I just killed it and
played with oss for some time now - seems still fine this side.

You might try to go to the preferences again, and configure oss plugin,
and up the buffer used.  On another note - did you try another player
than xmms?  Using xmms 1.2.8 here, so if Debian that far behind, it
may still be an xmms issue ...


-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 23:59           ` Martin J. Bligh
  2003-12-27  0:44             ` Martin Schlemmer
@ 2003-12-27  0:53             ` Martin Schlemmer
  2003-12-27  4:34               ` Martin J. Bligh
  2003-12-27  4:48             ` Stan Bubrouski
  2 siblings, 1 reply; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-27  0:53 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: Linux Kernel Mailing Lists

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

On Sat, 2003-12-27 at 01:59, Martin J. Bligh wrote:

> > If you right click on xmms, and then select options->preferences, on the
> > first page to the bottom there should be output plugin.  If you cannot
> > select alsa, see if there is a xmms-alsa or libxmms-alsa plugin.  Sorry,
> > I do not know Debian that well.
> 
> Thanks, it was on OSS - there's no ALSA selection, nor can I find one.
> There's probably one in unstable somewhere, but ... see below.

Btw, compile xmms yourself - should have alsa then =)  Not sure if
it will if you build with apt-get from source, or when they started
to ship the alsa module with xmms source - think it was not so long
ago.  Does with 1.2.8 though:

--
# qpkg -v -f /usr/lib/xmms/Output/libALSA.so
media-sound/xmms-1.2.8-r3 *
--


-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: 2.6.0 sound output - wierd effects
  2003-12-27  0:53             ` Martin Schlemmer
@ 2003-12-27  4:34               ` Martin J. Bligh
  2003-12-27 11:12                 ` Martin Schlemmer
  0 siblings, 1 reply; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-27  4:34 UTC (permalink / raw)
  To: azarah; +Cc: Linux Kernel Mailing Lists

>> > If you right click on xmms, and then select options->preferences, on the
>> > first page to the bottom there should be output plugin.  If you cannot
>> > select alsa, see if there is a xmms-alsa or libxmms-alsa plugin.  Sorry,
>> > I do not know Debian that well.
>> 
>> Thanks, it was on OSS - there's no ALSA selection, nor can I find one.
>> There's probably one in unstable somewhere, but ... see below.
> 
> Btw, compile xmms yourself - should have alsa then =)  Not sure if
> it will if you build with apt-get from source, or when they started
> to ship the alsa module with xmms source - think it was not so long
> ago.  Does with 1.2.8 though:

Oh, I understand I could work around the problem in userspace, but that's 
not the point - something broke in the kernel, presumably OSS emulation.
test2 works, test3 doesn't. 

I suspect this changeset:

ChangeSet@1.1046.572.2  2003-07-28 13:35:31+02:00  perex@cz:/home/perex/bk/linux-sound/linux-sound
all diffs ALSA 0.9.6 update
  - added __setup() to all midlevel modules
  - sequencer protocol 1.0.1
    - added timestamping flags for ports
  - OSS PCM emulation
    - fixed write() behaviour
    - added two new options no-silence & whole-frag
    - a try to fix OOPSes caused in the rate plugin
  - emu10k1 driver
    - more support for Audigy/Audigy2 EX
    - fixed soundfont locking
  - sb16 driver
    - fixed fm_res handling (and proc OOPS)
  - via82xx driver
    - fixed revision check for 8233A
  - usbaudio driver
    - added a workaround for M-Audio Audiophile USB

Particlarly the bit about OSS PCM emulation ;-)

M.


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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 23:59           ` Martin J. Bligh
  2003-12-27  0:44             ` Martin Schlemmer
  2003-12-27  0:53             ` Martin Schlemmer
@ 2003-12-27  4:48             ` Stan Bubrouski
  2003-12-27  4:57               ` Rob Love
  2003-12-27  7:50               ` OSS sound emulation broken between 2.6.0-test2 and test3 Martin J. Bligh
  2 siblings, 2 replies; 41+ messages in thread
From: Stan Bubrouski @ 2003-12-27  4:48 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: azarah, Linux Kernel Mailing Lists

On Fri, 2003-12-26 at 18:59, Martin J. Bligh wrote:
> I'll play with it - should narrow things down. However, fundamentally,
> it used to work in 2.5.74, and is broken as of test3 ... that strongly
> implies to me there's a kernel problem. I'd rather fix OSS emulation
> if possible, and save everybody migrating to 2.6 from this pain ... ;-)
> 

Please do, while it would be nice if OSS could be dropped altogether
there are a great many commercial and closed source apps that we all
need and only currently work with OSS.  For example flash player for
linux and real player, not to mention a myrid of open source apps that
have yet to move to ALSA support.  Right now its virtually impossible to
live with a kernel with no OSS for people like me who require use of
these apps on a daily basis.

-sb


> M.
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


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

* Re: 2.6.0 sound output - wierd effects
  2003-12-27  4:48             ` Stan Bubrouski
@ 2003-12-27  4:57               ` Rob Love
  2003-12-27  5:02                 ` Martin J. Bligh
  2003-12-27  7:50               ` OSS sound emulation broken between 2.6.0-test2 and test3 Martin J. Bligh
  1 sibling, 1 reply; 41+ messages in thread
From: Rob Love @ 2003-12-27  4:57 UTC (permalink / raw)
  To: Stan Bubrouski; +Cc: Martin J. Bligh, azarah, Linux Kernel Mailing Lists

On Fri, 2003-12-26 at 23:48, Stan Bubrouski wrote:

> Please do, while it would be nice if OSS could be dropped altogether
> there are a great many commercial and closed source apps that we all
> need and only currently work with OSS.  For example flash player for
> linux and real player, not to mention a myrid of open source apps that
> have yet to move to ALSA support.  Right now its virtually impossible to
> live with a kernel with no OSS for people like me who require use of
> these apps on a daily basis.

Why isn't the OSS emulation layer sufficient?

	Rob Love



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

* Re: 2.6.0 sound output - wierd effects
  2003-12-27  4:57               ` Rob Love
@ 2003-12-27  5:02                 ` Martin J. Bligh
  2003-12-27  5:10                   ` Rob Love
  0 siblings, 1 reply; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-27  5:02 UTC (permalink / raw)
  To: Rob Love, Stan Bubrouski; +Cc: azarah, Linux Kernel Mailing Lists

>> Please do, while it would be nice if OSS could be dropped altogether
>> there are a great many commercial and closed source apps that we all
>> need and only currently work with OSS.  For example flash player for
>> linux and real player, not to mention a myrid of open source apps that
>> have yet to move to ALSA support.  Right now its virtually impossible to
>> live with a kernel with no OSS for people like me who require use of
>> these apps on a daily basis.
> 
> Why isn't the OSS emulation layer sufficient?

Because someone broke it ... that's what this thread is about ;-)

Between test2 and test3. I'm guessing it's "ALSA 0.9.6 update" -
backing that out from test3 right now, and restesting ...

M.


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

* Re: 2.6.0 sound output - wierd effects
  2003-12-27  5:02                 ` Martin J. Bligh
@ 2003-12-27  5:10                   ` Rob Love
  2003-12-27  5:45                     ` Stan Bubrouski
  2003-12-27 22:44                     ` szonyi calin
  0 siblings, 2 replies; 41+ messages in thread
From: Rob Love @ 2003-12-27  5:10 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: Stan Bubrouski, azarah, Linux Kernel Mailing Lists

On Sat, 2003-12-27 at 00:02, Martin J. Bligh wrote:

> Because someone broke it ... that's what this thread is about ;-)

Right, sorry :-)

But what does that have to do with OSS remaining in the kernel and the
guy I was responding to having to continue to use OSS?

I mean, it is a bug, and we will fix it.  Keeping OSS is orthogonal. 
That was my point.

	Rob Love



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

* Re: 2.6.0 sound output - wierd effects
  2003-12-27  5:10                   ` Rob Love
@ 2003-12-27  5:45                     ` Stan Bubrouski
  2003-12-27 22:44                     ` szonyi calin
  1 sibling, 0 replies; 41+ messages in thread
From: Stan Bubrouski @ 2003-12-27  5:45 UTC (permalink / raw)
  To: Rob Love; +Cc: Martin J. Bligh, azarah, Linux Kernel Mailing Lists

On Sat, 2003-12-27 at 00:10, Rob Love wrote:
> On Sat, 2003-12-27 at 00:02, Martin J. Bligh wrote:
> 
> > Because someone broke it ... that's what this thread is about ;-)
> 
> Right, sorry :-)
> 

Heh.

> But what does that have to do with OSS remaining in the kernel and the
> guy I was responding to having to continue to use OSS?
> 

I'm the guy, I was talking about keeping the emulation layer working,
sorry its late specificity has never been a strong point of mine, and
tonight is no exception.

> I mean, it is a bug, and we will fix it.  Keeping OSS is orthogonal. 
> That was my point.
> 

Agreed.

> 	Rob Love
> 
> 

-sb


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

* OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27  4:48             ` Stan Bubrouski
  2003-12-27  4:57               ` Rob Love
@ 2003-12-27  7:50               ` Martin J. Bligh
  2003-12-27 11:11                 ` Martin Schlemmer
  2003-12-28  5:06                 ` Joshua Schmidlkofer
  1 sibling, 2 replies; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-27  7:50 UTC (permalink / raw)
  To: perex, alsa-devel
  Cc: azarah, Linux Kernel Mailing Lists, Rob Love, Andrew Morton,
	Stan Bubrouski

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

Something appears to have broken OSS sound emulation between 
test2 and test3. Best I can tell (despite the appearance of the BK logs), 
that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
understands the sound architecture better than I can fix this?

If I leave xmms playing (in random shuffle mode) every 2 minutes or so,
I'll get some wierd effect for a few seconds, either static, or the track
will mysteriously speed up or slow down. Then all is back to normal for
another couple of minutes.

I cut the core-looking ALSA changes out of test3, and attatch them here.
Backing out this patch from test3 makes the problem go away, and sound
emulation works normally again. But now I'm stuck - I can't split it
further than this. Changelogs for 0.9.5 and 0.9.6 include:

	  - PCM OSS interface
	    - implemented POST ioctl
	    - fixed read() semantics according original OSS API

	  - OSS PCM emulation
	    - fixed write() behaviour
	    - added two new options no-silence & whole-frag
	    - a try to fix OOPSes caused in the rate plugin

I'll test patches if anyone can come up with anything.

Thanks,

M.

[-- Attachment #2: alsa --]
[-- Type: text/plain, Size: 49323 bytes --]

Return-Path: <mbligh@w-mbligh>
X-Sieve: cmu-sieve 2.0
Return-path: <bk-commits-head-owner@vger.kernel.org>
Envelope-to: mbligh@localhost
Delivery-date: Thu, 31 Jul 2003 23:25:47 -0700
Received: from w-mbligh.beaverton.ibm.com
	([127.0.0.1] helo=mail.aracnet.com ident=mbligh)
	by w-mbligh.beaverton.ibm.com with esmtp (Exim 3.35 #1 (Debian))
	id 19iTMH-0006Y5-00
	for <mbligh@localhost>; Thu, 31 Jul 2003 23:25:45 -0700
Received: from psmtp.com (exprod5mx38.postini.com [12.158.34.195])
	by obsidian.spiritone.com (8.12.9/8.12.8) with SMTP id h716Plgu017805
	for <mbligh@aracnet.com>; Thu, 31 Jul 2003 23:25:47 -0700
Delivered-To: <mbligh@aracnet.com>
Received: from source ([67.72.78.212]) by exprod5mx38.postini.com ([12.158.34.245]) with SMTP;
	Thu, 31 Jul 2003 23:24:50 PDT
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S274837AbTHAGYB (ORCPT <rfc822;mbligh@aracnet.com>);
	Fri, 1 Aug 2003 02:24:01 -0400
Received: (majordomo@vger.kernel.org) by vger.kernel.org id S275118AbTHAGYB
	(ORCPT <rfc822;bk-commits-head-outgoing>);
	Fri, 1 Aug 2003 02:24:01 -0400
Received: from hera.kernel.org ([63.209.29.2]:3986 "EHLO hera.kernel.org")
	by vger.kernel.org with ESMTP id S274837AbTHAGQl (ORCPT
	<rfc822;bk-commits-head@vger.kernel.org>);
	Fri, 1 Aug 2003 02:16:41 -0400
Received: from hera.kernel.org (dwmw2@localhost [127.0.0.1])
	by hera.kernel.org (8.12.8/8.12.8) with ESMTP id h716GeUk003941
	for <bk-commits-head@vger.kernel.org>; Thu, 31 Jul 2003 23:16:40 -0700
Received: (from dwmw2@localhost)
	by hera.kernel.org (8.12.8/8.12.8/Submit) id h716GasI003916
	for bk-commits-head@vger.kernel.org; Thu, 31 Jul 2003 23:16:36 -0700
Message-Id: <200308010616.h716GasI003916@hera.kernel.org>
Subject: ALSA 0.9.6 update
Date: 	Mon, 28 Jul 2003 11:35:31 +0000
From: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
To: bk-commits-head@vger.kernel.org
X-BK-Repository: hera.kernel.org:/home/dwmw2/BK/linus-2.5
X-BK-ChangeSetKey: perex@suse.cz|ChangeSet|20030728113531|60648
Sender: bk-commits-head-owner@vger.kernel.org
Precedence: bulk
X-Mailing-List: 	bk-commits-head@vger.kernel.org

ChangeSet 1.1595.3.2, 2003/07/28 13:35:31+02:00, perex@suse.cz

	ALSA 0.9.6 update
	  - added __setup() to all midlevel modules
	  - sequencer protocol 1.0.1
	    - added timestamping flags for ports
	  - OSS PCM emulation
	    - fixed write() behaviour
	    - added two new options no-silence & whole-frag
	    - a try to fix OOPSes caused in the rate plugin
	  - emu10k1 driver
	    - more support for Audigy/Audigy2 EX
	    - fixed soundfont locking
	  - sb16 driver
	    - fixed fm_res handling (and proc OOPS)
	  - via82xx driver
	    - fixed revision check for 8233A
	  - usbaudio driver
	    - added a workaround for M-Audio Audiophile USB


# This patch includes the following deltas:
#	           ChangeSet	1.1595.3.1 -> 1.1595.3.2
#	sound/pci/emu10k1/emu10k1.c	1.11    -> 1.12   
#	Documentation/sound/alsa/ALSA-Configuration.txt	1.10    -> 1.11   
#	sound/core/seq/seq_clientmgr.c	1.18    -> 1.19   
#	sound/core/rawmidi.c	1.26    -> 1.27   
#	include/sound/emu10k1.h	1.16    -> 1.17   
#	sound/core/oss/pcm_plugin.c	1.5     -> 1.6    
#	sound/core/oss/plugin_ops.h	1.1     -> 1.2    
#	sound/core/pcm_native.c	1.36    -> 1.37   
#	include/sound/version.h	1.61    -> 1.62   
#	sound/core/pcm_lib.c	1.22    -> 1.23   
#	sound/core/oss/rate.c	1.3     -> 1.4    
#	sound/pci/emu10k1/emufx.c	1.23    -> 1.24   
#	include/sound/asequencer.h	1.5     -> 1.6    
#	sound/pci/maestro3.c	1.23    -> 1.24   
#	sound/pci/intel8x0.c	1.36    -> 1.37   
#	  sound/core/timer.c	1.19    -> 1.20   
#	include/sound/asound.h	1.15    -> 1.16   
#	  sound/core/sound.c	1.30    -> 1.31   
#	sound/core/pcm_memory.c	1.10    -> 1.11   
#	sound/core/seq/seq_ports.h	1.2     -> 1.3    
#	sound/core/seq/seq_ports.c	1.10    -> 1.11   
#	include/sound/pcm_oss.h	1.2     -> 1.3    
#	sound/pci/emu10k1/irq.c	1.7     -> 1.8    
#	sound/usb/usbaudio.c	1.40    -> 1.41   
#	sound/synth/emux/soundfont.c	1.4     -> 1.5    
#	sound/core/oss/pcm_plugin.h	1.2     -> 1.3    
#	 sound/isa/sb/sb16.c	1.18    -> 1.19   
#	sound/core/rtctimer.c	1.14    -> 1.15   
#	 sound/pci/via82xx.c	1.33    -> 1.34   
#	sound/pci/emu10k1/emumixer.c	1.8     -> 1.9    
#	sound/core/oss/pcm_oss.c	1.25    -> 1.26   
#	sound/drivers/dummy.c	1.17    -> 1.18   
#	sound/pci/ac97/ac97_patch.c	1.15    -> 1.16   
#	sound/core/oss/route.c	1.3     -> 1.4    
#	sound/pci/emu10k1/emu10k1_main.c	1.13    -> 1.14   
#	sound/core/memalloc.c	1.9     -> 1.10   
#	include/sound/soundfont.h	1.2     -> 1.3    
#

 Documentation/sound/alsa/ALSA-Configuration.txt |    3 
 include/sound/asequencer.h                      |    7 +-
 include/sound/asound.h                          |    3 
 include/sound/emu10k1.h                         |    1 
 include/sound/pcm_oss.h                         |    4 -
 include/sound/soundfont.h                       |    1 
 include/sound/version.h                         |    4 -
 sound/core/memalloc.c                           |   19 +++++
 sound/core/oss/pcm_oss.c                        |   52 +++++++++++++--
 sound/core/oss/pcm_plugin.c                     |   23 +++++-
 sound/core/oss/pcm_plugin.h                     |    1 
 sound/core/oss/plugin_ops.h                     |    2 
 sound/core/oss/rate.c                           |   22 +-----
 sound/core/oss/route.c                          |    4 +
 sound/core/pcm_lib.c                            |    9 --
 sound/core/pcm_memory.c                         |   16 ++++
 sound/core/pcm_native.c                         |   12 ++-
 sound/core/rawmidi.c                            |   20 +++++
 sound/core/rtctimer.c                           |   14 +++-
 sound/core/seq/seq_clientmgr.c                  |   56 +++++++++-------
 sound/core/seq/seq_ports.c                      |   14 ++++
 sound/core/seq/seq_ports.h                      |    3 
 sound/core/sound.c                              |   18 +++++
 sound/core/timer.c                              |   14 +++-
 sound/drivers/dummy.c                           |   26 +++++--
 sound/isa/sb/sb16.c                             |   16 ++++
 sound/pci/ac97/ac97_patch.c                     |   22 ++++++
 sound/pci/emu10k1/emu10k1.c                     |    8 --
 sound/pci/emu10k1/emu10k1_main.c                |    8 ++
 sound/pci/emu10k1/emufx.c                       |   23 ++++--
 sound/pci/emu10k1/emumixer.c                    |   82 ++++++++++++++++++++----
 sound/pci/emu10k1/irq.c                         |   45 ++++++-------
 sound/pci/intel8x0.c                            |    3 
 sound/pci/maestro3.c                            |    7 +-
 sound/pci/via82xx.c                             |    6 -
 sound/synth/emux/soundfont.c                    |   18 +----
 sound/usb/usbaudio.c                            |    8 ++
 37 files changed, 456 insertions(+), 138 deletions(-)


diff -Nru a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
--- a/Documentation/sound/alsa/ALSA-Configuration.txt	Thu Jul 31 23:16:39 2003
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt	Thu Jul 31 23:16:39 2003
@@ -1303,6 +1303,9 @@
 	  - direct    don't use plugins
 	  - block     force block mode (rvplayer)
 	  - non-block force non-block mode
+	  - whole-frag  write only whole fragments (optimization affecting
+			playback only)
+	  - no-silence  do not fill silence ahead to avoid clicks
 
   Example: echo "x11amp 128 16384" > /proc/asound/card0/pcm0p/oss
            echo "squake 0 0 disable" > /proc/asound/card0/pcm0c/oss
diff -Nru a/include/sound/asequencer.h b/include/sound/asequencer.h
--- a/include/sound/asequencer.h	Thu Jul 31 23:16:39 2003
+++ b/include/sound/asequencer.h	Thu Jul 31 23:16:39 2003
@@ -29,7 +29,7 @@
 #include <sound/asound.h>
 
 /** version of the sequencer */
-#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 0)
+#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
 
 /**
  * definition of sequencer event types
@@ -604,6 +604,8 @@
 
 /* misc. conditioning flags */
 #define SNDRV_SEQ_PORT_FLG_GIVEN_PORT	(1<<0)
+#define SNDRV_SEQ_PORT_FLG_TIMESTAMP	(1<<1)
+#define SNDRV_SEQ_PORT_FLG_TIME_REAL	(1<<1)
 
 struct sndrv_seq_port_info {
 	struct sndrv_seq_addr addr;	/* client/port numbers */
@@ -620,7 +622,8 @@
 
 	void *kernel;			/* reserved for kernel use (must be NULL) */
 	unsigned int flags;		/* misc. conditioning */
-	char reserved[60];		/* for future use */
+	unsigned char time_queue;	/* queue # for timestamping */
+	char reserved[59];		/* for future use */
 };
 
 
diff -Nru a/include/sound/asound.h b/include/sound/asound.h
--- a/include/sound/asound.h	Thu Jul 31 23:16:39 2003
+++ b/include/sound/asound.h	Thu Jul 31 23:16:39 2003
@@ -105,9 +105,10 @@
 	SNDRV_HWDEP_IFACE_ICS2115,	/* Wavetable synth */
 	SNDRV_HWDEP_IFACE_SSCAPE,	/* Ensoniq SoundScape ISA card (MC68EC000) */
 	SNDRV_HWDEP_IFACE_VX,		/* Digigram VX cards */
+	SNDRV_HWDEP_IFACE_MIXART,	/* Digigram miXart cards */
 
 	/* Don't forget to change the following: */
-	SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_VX,
+	SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_MIXART,
 };
 
 struct sndrv_hwdep_info {
diff -Nru a/include/sound/emu10k1.h b/include/sound/emu10k1.h
--- a/include/sound/emu10k1.h	Thu Jul 31 23:16:39 2003
+++ b/include/sound/emu10k1.h	Thu Jul 31 23:16:39 2003
@@ -931,6 +931,7 @@
 	unsigned long port;			/* I/O port number */
 	struct resource *res_port;
 	int APS: 1,				/* APS flag */
+	    no_ac97: 1,				/* no AC'97 */
 	    tos_link: 1;			/* tos link detected */
 	unsigned int audigy;			/* is Audigy? */
 	unsigned int revision;			/* chip revision */
diff -Nru a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h
--- a/include/sound/pcm_oss.h	Thu Jul 31 23:16:39 2003
+++ b/include/sound/pcm_oss.h	Thu Jul 31 23:16:39 2003
@@ -30,7 +30,9 @@
 	unsigned int disable:1,
 		     direct:1,
 		     block:1,
-		     nonblock:1;
+		     nonblock:1,
+		     wholefrag:1,
+		     nosilence:1;
 	unsigned int periods;
 	unsigned int period_size;
 	snd_pcm_oss_setup_t *next;
diff -Nru a/include/sound/soundfont.h b/include/sound/soundfont.h
--- a/include/sound/soundfont.h	Thu Jul 31 23:16:39 2003
+++ b/include/sound/soundfont.h	Thu Jul 31 23:16:39 2003
@@ -95,7 +95,6 @@
 	int zone_locked;	/* locked time for zone */
 	int sample_locked;	/* locked time for sample */
 	snd_sf_callback_t callback;	/* callback functions */
-	char sf_locked;		/* font lock flag */
 	struct semaphore presets_mutex;
 	spinlock_t lock;
 	snd_util_memhdr_t *memhdr;
diff -Nru a/include/sound/version.h b/include/sound/version.h
--- a/include/sound/version.h	Thu Jul 31 23:16:39 2003
+++ b/include/sound/version.h	Thu Jul 31 23:16:39 2003
@@ -1,3 +1,3 @@
 /* include/version.h.  Generated by configure.  */
-#define CONFIG_SND_VERSION "0.9.5"
-#define CONFIG_SND_DATE " (Mon Jul 21 08:59:59 2003 UTC)"
+#define CONFIG_SND_VERSION "0.9.6"
+#define CONFIG_SND_DATE " (Mon Jul 28 11:08:42 2003 UTC)"
diff -Nru a/sound/core/memalloc.c b/sound/core/memalloc.c
--- a/sound/core/memalloc.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/memalloc.c	Thu Jul 31 23:16:39 2003
@@ -946,6 +946,25 @@
 module_exit(snd_mem_exit)
 
 
+#ifndef MODULE
+
+/* format is: snd-page-alloc=enable */
+
+static int __init snd_mem_setup(char *str)
+{
+	static unsigned __initdata nr_dev = 0;
+
+	if (nr_dev >= SNDRV_CARDS)
+		return 0;
+	(void)(get_option(&str,&enable[nr_dev]) == 2);
+	nr_dev++;
+	return 1;
+}
+
+__setup("snd-page-alloc=", snd_mem_setup);
+
+#endif
+
 /*
  * exports
  */
diff -Nru a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
--- a/sound/core/oss/pcm_oss.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/oss/pcm_oss.c	Thu Jul 31 23:16:39 2003
@@ -454,8 +454,18 @@
 	sw_params->sleep_min = 0;
 	sw_params->avail_min = runtime->period_size;
 	sw_params->xfer_align = 1;
-	sw_params->silence_threshold = 0;
-	sw_params->silence_size = 0;
+	if (atomic_read(&runtime->mmap_count) ||
+	    (substream->oss.setup && substream->oss.setup->nosilence)) {
+		sw_params->silence_threshold = 0;
+		sw_params->silence_size = 0;
+	} else {
+		snd_pcm_uframes_t frames;
+		frames = runtime->period_size + 16;
+		if (frames > runtime->buffer_size)
+			frames = runtime->buffer_size;
+		sw_params->silence_threshold = frames;
+		sw_params->silence_size = frames;
+	}
 
 	if ((err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_SW_PARAMS, sw_params)) < 0) {
 		snd_printd("SW_PARAMS failed: %i\n", err);
@@ -581,7 +591,7 @@
 		if (err < 0)
 			break;
 		runtime = substream->runtime;
-		if (*delay <= runtime->buffer_size)
+		if (*delay <= (snd_pcm_sframes_t)runtime->buffer_size)
 			break;
 		/* in case of overrun, skip whole periods like OSS/Linux driver does */
 		/* until avail(delay) <= buffer_size */
@@ -802,8 +812,9 @@
 			buf += tmp;
 			bytes -= tmp;
 			xfer += tmp;
-			if (runtime->oss.buffer_used == runtime->oss.period_bytes) {
-				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.period_bytes, 1);
+			if (substream->oss.setup == NULL || !substream->oss.setup->wholefrag ||
+			    runtime->oss.buffer_used == runtime->oss.period_bytes) {
+				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.buffer_used, 1);
 				if (tmp <= 0)
 					return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
 				runtime->oss.bytes += tmp;
@@ -2108,14 +2119,16 @@
 	snd_pcm_oss_setup_t *setup = pstr->oss.setup_list;
 	down(&pstr->oss.setup_mutex);
 	while (setup) {
-		snd_iprintf(buffer, "%s %u %u%s%s%s%s\n",
+		snd_iprintf(buffer, "%s %u %u%s%s%s%s%s%s\n",
 			    setup->task_name,
 			    setup->periods,
 			    setup->period_size,
 			    setup->disable ? " disable" : "",
 			    setup->direct ? " direct" : "",
 			    setup->block ? " block" : "",
-			    setup->nonblock ? " non-block" : "");
+			    setup->nonblock ? " non-block" : "",
+			    setup->wholefrag ? " whole-frag" : "",
+			    setup->nosilence ? " no-silence" : "");
 		setup = setup->next;
 	}
 	up(&pstr->oss.setup_mutex);
@@ -2181,6 +2194,10 @@
 				template.block = 1;
 			} else if (!strcmp(str, "non-block")) {
 				template.nonblock = 1;
+			} else if (!strcmp(str, "whole-frag")) {
+				template.wholefrag = 1;
+			} else if (!strcmp(str, "no-silence")) {
+				template.nosilence = 1;
 			}
 		} while (*str);
 		if (setup == NULL) {
@@ -2372,3 +2389,24 @@
 
 module_init(alsa_pcm_oss_init)
 module_exit(alsa_pcm_oss_exit)
+
+#ifndef MODULE
+
+/* format is: snd-pcm-oss=dsp_map,adsp_map[,nonblock_open] */
+
+static int __init alsa_pcm_oss_setup(char *str)
+{
+	static unsigned __initdata nr_dev = 0;
+
+	if (nr_dev >= SNDRV_CARDS)
+		return 0;
+	(void)(get_option(&str,&dsp_map[nr_dev]) == 2 &&
+	       get_option(&str,&adsp_map[nr_dev]) == 2);
+	(void)(get_option(&str,&nonblock_open) == 2);
+	nr_dev++;
+	return 1;
+}
+
+__setup("snd-pcm-oss=", alsa_pcm_oss_setup);
+
+#endif /* !MODULE */
diff -Nru a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
--- a/sound/core/oss/pcm_plugin.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/oss/pcm_plugin.c	Thu Jul 31 23:16:39 2003
@@ -56,6 +56,17 @@
 	return 0;
 }
 
+/*
+ *  because some cards might have rates "very close", we ignore
+ *  all "resampling" requests within +-5%
+ */
+static int rate_match(unsigned int src_rate, unsigned int dst_rate)
+{
+	unsigned int low = (src_rate * 95) / 100;
+	unsigned int high = (src_rate * 105) / 100;
+	return dst_rate >= low && dst_rate <= high;
+}
+
 static int snd_pcm_plugin_alloc(snd_pcm_plugin_t *plugin, snd_pcm_uframes_t frames)
 {
 	snd_pcm_plugin_format_t *format;
@@ -80,11 +91,14 @@
 		plugin->buf = vmalloc(size);
 		plugin->buf_frames = frames;
 	}
-	if (!plugin->buf)
+	if (!plugin->buf) {
+		plugin->buf_frames = 0;
 		return -ENOMEM;
+	}
 	c = plugin->buf_channels;
 	if (plugin->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) {
 		for (channel = 0; channel < format->channels; channel++, c++) {
+			c->frames = frames;
 			c->enabled = 1;
 			c->wanted = 0;
 			c->area.addr = plugin->buf;
@@ -95,6 +109,7 @@
 		snd_assert((size % format->channels) == 0,);
 		size /= format->channels;
 		for (channel = 0; channel < format->channels; channel++, c++) {
+			c->frames = frames;
 			c->enabled = 1;
 			c->wanted = 0;
 			c->area.addr = plugin->buf + (channel * size);
@@ -420,7 +435,7 @@
 
 	/* Format change (linearization) */
 	if ((srcformat.format != dstformat.format ||
-	     srcformat.rate != dstformat.rate ||
+	     !rate_match(srcformat.rate, dstformat.rate) ||
 	     srcformat.channels != dstformat.channels) &&
 	    !snd_pcm_format_linear(srcformat.format)) {
 		if (snd_pcm_format_linear(dstformat.format))
@@ -468,7 +483,7 @@
 				ttable[v * sv + v] = FULL;
 		}
 		tmpformat.channels = dstformat.channels;
-		if (srcformat.rate == dstformat.rate &&
+		if (rate_match(srcformat.rate, dstformat.rate) &&
 		    snd_pcm_format_linear(dstformat.format))
 			tmpformat.format = dstformat.format;
 		err = snd_pcm_plugin_build_route(plug,
@@ -490,7 +505,7 @@
 	}
 
 	/* rate resampling */
-	if (srcformat.rate != dstformat.rate) {
+	if (!rate_match(srcformat.rate, dstformat.rate)) {
 		tmpformat.rate = dstformat.rate;
 		if (srcformat.channels == dstformat.channels &&
 		    snd_pcm_format_linear(dstformat.format))
diff -Nru a/sound/core/oss/pcm_plugin.h b/sound/core/oss/pcm_plugin.h
--- a/sound/core/oss/pcm_plugin.h	Thu Jul 31 23:16:39 2003
+++ b/sound/core/oss/pcm_plugin.h	Thu Jul 31 23:16:39 2003
@@ -106,6 +106,7 @@
 typedef struct _snd_pcm_plugin_channel {
 	void *aptr;			/* pointer to the allocated area */
 	snd_pcm_channel_area_t area;
+	snd_pcm_uframes_t frames;	/* allocated frames */
 	unsigned int enabled:1;		/* channel need to be processed */
 	unsigned int wanted:1;		/* channel is wanted */
 } snd_pcm_plugin_channel_t;
diff -Nru a/sound/core/oss/plugin_ops.h b/sound/core/oss/plugin_ops.h
--- a/sound/core/oss/plugin_ops.h	Thu Jul 31 23:16:39 2003
+++ b/sound/core/oss/plugin_ops.h	Thu Jul 31 23:16:39 2003
@@ -323,7 +323,7 @@
 
 #ifdef PUT_S16_LABELS
 /* dst_wid dst_endswap unsigned */
-static void *put_s16_labels[4 * 2 * 2 * 4 * 2] = {
+static void *put_s16_labels[4 * 2 * 2] = {
 	&&put_s16_xx12_xxx1,	 /* 16h ->  8h */
 	&&put_s16_xx12_xxx9,	 /* 16h ^>  8h */
 	&&put_s16_xx12_xxx1,	 /* 16h ->  8s */
diff -Nru a/sound/core/oss/rate.c b/sound/core/oss/rate.c
--- a/sound/core/oss/rate.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/oss/rate.c	Thu Jul 31 23:16:39 2003
@@ -85,11 +85,7 @@
 #undef PUT_S16_LABELS
 	void *get = get_s16_labels[data->get];
 	void *put = put_s16_labels[data->put];
-	void *get_s16_end = 0;
 	signed short sample = 0;
-#define GET_S16_END *get_s16_end
-#include "plugin_ops.h"
-#undef GET_S16_END
 	
 	for (channel = 0; channel < plugin->src_format.channels; channel++) {
 		pos = data->pos;
@@ -108,24 +104,16 @@
 		dst_step = dst_channels[channel].area.step / 8;
 		src_frames1 = src_frames;
 		dst_frames1 = dst_frames;
-		if (pos & ~R_MASK) {
-			get_s16_end = &&after_get1;
-			goto *get;
-		after_get1:
-			pos &= R_MASK;
-			S1 = S2;
-			S2 = sample;
-			src += src_step;
-			src_frames1--;
-		}
 		while (dst_frames1-- > 0) {
 			if (pos & ~R_MASK) {
 				pos &= R_MASK;
 				S1 = S2;
 				if (src_frames1-- > 0) {
-					get_s16_end = &&after_get2;
 					goto *get;
-				after_get2:
+#define GET_S16_END after_get
+#include "plugin_ops.h"
+#undef GET_S16_END
+				after_get:
 					S2 = sample;
 					src += src_step;
 				}
@@ -318,6 +306,8 @@
 #endif
 
 	dst_frames = rate_dst_frames(plugin, frames);
+	if (dst_frames > dst_channels[0].frames)
+		dst_frames = dst_channels[0].frames;
 	data = (rate_t *)plugin->extra_data;
 	data->func(plugin, src_channels, dst_channels, frames, dst_frames);
 	return dst_frames;
diff -Nru a/sound/core/oss/route.c b/sound/core/oss/route.c
--- a/sound/core/oss/route.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/oss/route.c	Thu Jul 31 23:16:39 2003
@@ -518,6 +518,10 @@
 	int sign, width, endian;
 	sign = !snd_pcm_format_signed(format);
 	width = snd_pcm_format_width(format) / 8 - 1;
+	if (width < 0 || width > 3) {
+		snd_printk(KERN_ERR "snd-pcm-oss: invalid format %d\n", format);
+		width = 0;
+	}
 #ifdef SNDRV_LITTLE_ENDIAN
 	endian = snd_pcm_format_big_endian(format);
 #else
diff -Nru a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
--- a/sound/core/pcm_lib.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/pcm_lib.c	Thu Jul 31 23:16:39 2003
@@ -60,13 +60,11 @@
 			return;
 		snd_assert(runtime->silence_filled <= runtime->buffer_size, return);
 		noise_dist = snd_pcm_playback_hw_avail(runtime) + runtime->silence_filled;
-		if (noise_dist > (snd_pcm_sframes_t) runtime->silence_threshold)
+		if (noise_dist >= (snd_pcm_sframes_t) runtime->silence_threshold)
 			return;
 		frames = runtime->silence_threshold - noise_dist;
 		if (frames > runtime->silence_size)
 			frames = runtime->silence_size;
-		else
-			frames = runtime->silence_threshold;
 	} else {
 		if (new_hw_ptr == ULONG_MAX) {	/* initialization */
 			runtime->silence_filled = 0;
@@ -86,10 +84,9 @@
 			if ((snd_pcm_sframes_t)runtime->silence_start < 0)
 				runtime->silence_start += runtime->boundary;
 		}
-		frames = runtime->buffer_size;
+		frames = runtime->buffer_size - runtime->silence_filled;
 	}
-	snd_assert(frames >= runtime->silence_filled, return);
-	frames -= runtime->silence_filled;
+	snd_assert(frames <= runtime->buffer_size, return);
 	if (frames == 0)
 		return;
 	ofs = (runtime->silence_start + runtime->silence_filled) % runtime->buffer_size;
diff -Nru a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c
--- a/sound/core/pcm_memory.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/pcm_memory.c	Thu Jul 31 23:16:39 2003
@@ -22,6 +22,7 @@
 #include <sound/driver.h>
 #include <asm/io.h>
 #include <linux/time.h>
+#include <linux/init.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/info.h>
@@ -568,3 +569,18 @@
 }
 
 #endif /* CONFIG_PCI */
+
+#ifndef MODULE
+
+/* format is: snd-pcm=preallocate_dma,maximum_substreams */
+
+static int __init alsa_pcm_setup(char *str)
+{
+	(void)(get_option(&str,&preallocate_dma) == 2 &&
+	       get_option(&str,&maximum_substreams) == 2);
+	return 1;
+}
+
+__setup("snd-pcm=", alsa_pcm_setup);
+
+#endif /* ifndef MODULE */
diff -Nru a/sound/core/pcm_native.c b/sound/core/pcm_native.c
--- a/sound/core/pcm_native.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/pcm_native.c	Thu Jul 31 23:16:39 2003
@@ -461,9 +461,15 @@
 	if (params->xfer_align == 0 ||
 	    params->xfer_align % runtime->min_align != 0)
 		return -EINVAL;
-	if ((params->silence_threshold != 0 || params->silence_size < runtime->boundary) &&
-	    (params->silence_threshold + params->silence_size > runtime->buffer_size))
-		return -EINVAL;
+	if (params->silence_size >= runtime->boundary) {
+		if (params->silence_threshold != 0)
+			return -EINVAL;
+	} else {
+		if (params->silence_size > params->silence_threshold)
+			return -EINVAL;
+		if (params->silence_threshold > runtime->buffer_size)
+			return -EINVAL;
+	}
 	snd_pcm_stream_lock_irq(substream);
 	runtime->tstamp_mode = params->tstamp_mode;
 	runtime->sleep_min = params->sleep_min;
diff -Nru a/sound/core/rawmidi.c b/sound/core/rawmidi.c
--- a/sound/core/rawmidi.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/rawmidi.c	Thu Jul 31 23:16:39 2003
@@ -1630,6 +1630,26 @@
 module_init(alsa_rawmidi_init)
 module_exit(alsa_rawmidi_exit)
 
+#ifndef MODULE
+#ifdef CONFIG_SND_OSSEMUL
+/* format is: snd-rawmidi=midi_map,amidi_map */
+
+static int __init alsa_rawmidi_setup(char *str)
+{
+	static unsigned __initdata nr_dev = 0;
+
+	if (nr_dev >= SNDRV_CARDS)
+		return 0;
+	(void)(get_option(&str,&midi_map[nr_dev]) == 2 &&
+	       get_option(&str,&amidi_map[nr_dev]) == 2);
+	nr_dev++;
+	return 1;
+}
+
+__setup("snd-rawmidi=", alsa_rawmidi_setup);
+#endif /* CONFIG_SND_OSSEMUL */
+#endif /* ifndef MODULE */
+
 EXPORT_SYMBOL(snd_rawmidi_output_params);
 EXPORT_SYMBOL(snd_rawmidi_input_params);
 EXPORT_SYMBOL(snd_rawmidi_drop_output);
diff -Nru a/sound/core/rtctimer.c b/sound/core/rtctimer.c
--- a/sound/core/rtctimer.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/rtctimer.c	Thu Jul 31 23:16:39 2003
@@ -57,7 +57,7 @@
 	.stop =		rtctimer_stop,
 };
 
-int rtctimer_freq = RTC_FREQ;		/* frequency */
+static int rtctimer_freq = RTC_FREQ;		/* frequency */
 static snd_timer_t *rtctimer;
 static atomic_t rtc_inc = ATOMIC_INIT(0);
 static rtc_task_t rtc_task;
@@ -181,5 +181,17 @@
 MODULE_PARM_DESC(rtctimer_freq, "timer frequency in Hz");
 
 MODULE_LICENSE("GPL");
+
+#ifndef MODULE
+/* format is: snd-rtctimer=freq */
+
+static int __init rtctimer_setup(char *str)
+{
+	(void)(get_option(&str,&rtctimer_freq) == 2);
+	return 1;
+}
+
+__setup("snd-rtctimer=", rtctimer_setup);
+#endif /* ifndef MODULE */
 
 #endif /* CONFIG_RTC || CONFIG_RTC_MODULE */
diff -Nru a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
--- a/sound/core/seq/seq_clientmgr.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/seq/seq_clientmgr.c	Thu Jul 31 23:16:39 2003
@@ -521,6 +521,32 @@
 
 
 /*
+ * rewrite the time-stamp of the event record with the curren time
+ * of the given queue.
+ * return non-zero if updated.
+ */
+static int update_timestamp_of_queue(snd_seq_event_t *event, int queue, int real_time)
+{
+	queue_t *q;
+
+	q = queueptr(queue);
+	if (! q)
+		return 0;
+	event->queue = queue;
+	event->flags &= ~SNDRV_SEQ_TIME_STAMP_MASK;
+	if (real_time) {
+		event->time.time = snd_seq_timer_get_cur_time(q->timer);
+		event->flags |= SNDRV_SEQ_TIME_STAMP_REAL;
+	} else {
+		event->time.tick = snd_seq_timer_get_cur_tick(q->timer);
+		event->flags |= SNDRV_SEQ_TIME_STAMP_TICK;
+	}
+	queuefree(q);
+	return 1;
+}
+
+
+/*
  * deliver an event to the specified destination.
  * if filter is non-zero, client filter bitmap is tested.
  *
@@ -551,6 +577,10 @@
 		goto __skip;
 	}
 		
+	if (dest_port->timestamping)
+		update_timestamp_of_queue(event, dest_port->time_queue,
+					  dest_port->time_real);
+
 	/* expand the quoted event */
 	if (event->type == SNDRV_SEQ_EVENT_KERNEL_QUOTE) {
 		quoted = 1;
@@ -597,27 +627,6 @@
 }
 
 
-static void snd_seq_subs_update_event_header(subscribers_t *subs, snd_seq_event_t *event)
-{
-	if (subs->info.flags & SNDRV_SEQ_PORT_SUBS_TIMESTAMP) {
-		/* convert time according to flag with subscription */
-		queue_t *q;
-		q = queueptr(subs->info.queue);
-		if (q) {
-			event->queue = subs->info.queue;
-			event->flags &= ~SNDRV_SEQ_TIME_STAMP_MASK;
-			if (subs->info.flags & SNDRV_SEQ_PORT_SUBS_TIME_REAL) {
-				event->time.time = snd_seq_timer_get_cur_time(q->timer);
-				event->flags |= SNDRV_SEQ_TIME_STAMP_REAL;
-			} else {
-				event->time.tick = snd_seq_timer_get_cur_tick(q->timer);
-				event->flags |= SNDRV_SEQ_TIME_STAMP_TICK;
-			}
-			queuefree(q);
-		}
-	}
-}
-
 /*
  * send the event to all subscribers:
  */
@@ -647,7 +656,10 @@
 	list_for_each(p, &grp->list_head) {
 		subs = list_entry(p, subscribers_t, src_list);
 		event->dest = subs->info.dest;
-		snd_seq_subs_update_event_header(subs, event);
+		if (subs->info.flags & SNDRV_SEQ_PORT_SUBS_TIMESTAMP)
+			/* convert time according to flag with subscription */
+			update_timestamp_of_queue(event, subs->info.queue,
+						  subs->info.flags & SNDRV_SEQ_PORT_SUBS_TIME_REAL);
 		err = snd_seq_deliver_single_event(client, event,
 						   0, atomic, hop);
 		if (err < 0)
diff -Nru a/sound/core/seq/seq_ports.c b/sound/core/seq/seq_ports.c
--- a/sound/core/seq/seq_ports.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/seq/seq_ports.c	Thu Jul 31 23:16:39 2003
@@ -352,6 +352,11 @@
 	port->midi_voices = info->midi_voices;
 	port->synth_voices = info->synth_voices;
 
+	/* timestamping */
+	port->timestamping = (info->flags & SNDRV_SEQ_PORT_FLG_TIMESTAMP) ? 1 : 0;
+	port->time_real = (info->flags & SNDRV_SEQ_PORT_FLG_TIME_REAL) ? 1 : 0;
+	port->time_queue = info->time_queue;
+
 	return 0;
 }
 
@@ -378,6 +383,15 @@
 	info->read_use = port->c_src.count;
 	info->write_use = port->c_dest.count;
 	
+	/* timestamping */
+	info->flags = 0;
+	if (port->timestamping) {
+		info->flags |= SNDRV_SEQ_PORT_FLG_TIMESTAMP;
+		if (port->time_real)
+			info->flags |= SNDRV_SEQ_PORT_FLG_TIME_REAL;
+		info->time_queue = port->time_queue;
+	}
+
 	return 0;
 }
 
diff -Nru a/sound/core/seq/seq_ports.h b/sound/core/seq/seq_ports.h
--- a/sound/core/seq/seq_ports.h	Thu Jul 31 23:16:39 2003
+++ b/sound/core/seq/seq_ports.h	Thu Jul 31 23:16:39 2003
@@ -74,6 +74,9 @@
 	void *private_data;
 	unsigned int callback_all : 1;
 	unsigned int closing : 1;
+	unsigned int timestamping: 1;
+	unsigned int time_real: 1;
+	int time_queue;
 	
 	/* capability, inport, output, sync */
 	unsigned int capability;	/* port capability bits */
diff -Nru a/sound/core/sound.c b/sound/core/sound.c
--- a/sound/core/sound.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/sound.c	Thu Jul 31 23:16:39 2003
@@ -389,6 +389,24 @@
 module_init(alsa_sound_init)
 module_exit(alsa_sound_exit)
 
+#ifndef MODULE
+
+/* format is: snd=major,cards_limit[,device_mode] */
+
+static int __init alsa_sound_setup(char *str)
+{
+	(void)(get_option(&str,&major) == 2 &&
+	       get_option(&str,&cards_limit) == 2);
+#ifdef CONFIG_DEVFS_FS
+	(void)(get_option(&str,&device_mode) == 2);
+#endif
+	return 1;
+}
+
+__setup("snd=", alsa_sound_setup);
+
+#endif /* ifndef MODULE */
+
   /* sound.c */
 EXPORT_SYMBOL(snd_major);
 EXPORT_SYMBOL(snd_ecards_limit);
diff -Nru a/sound/core/timer.c b/sound/core/timer.c
--- a/sound/core/timer.c	Thu Jul 31 23:16:39 2003
+++ b/sound/core/timer.c	Thu Jul 31 23:16:39 2003
@@ -41,7 +41,7 @@
 #define DEFAULT_TIMER_LIMIT 2
 #endif
 
-int timer_limit = DEFAULT_TIMER_LIMIT;
+static int timer_limit = DEFAULT_TIMER_LIMIT;
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Takashi Iwai <tiwai@suse.de>");
 MODULE_DESCRIPTION("ALSA timer interface");
 MODULE_LICENSE("GPL");
@@ -1805,6 +1805,18 @@
 
 module_init(alsa_timer_init)
 module_exit(alsa_timer_exit)
+
+#ifndef MODULE
+/* format is: snd-timer=timer_limit */
+
+static int __init alsa_timer_setup(char *str)
+{
+	(void)(get_option(&str,&timer_limit) == 2);
+	return 1;
+}
+
+__setup("snd-timer=", alsa_timer_setup);
+#endif /* ifndef MODULE */
 
 EXPORT_SYMBOL(snd_timer_open);
 EXPORT_SYMBOL(snd_timer_close);
diff -Nru a/sound/drivers/dummy.c b/sound/drivers/dummy.c
--- a/sound/drivers/dummy.c	Thu Jul 31 23:16:39 2003
+++ b/sound/drivers/dummy.c	Thu Jul 31 23:16:39 2003
@@ -69,6 +69,15 @@
 #define USE_PERIODS_MAX		255
 #endif
 
+#if 0 /* simple AC97 bridge (intel8x0) with 48kHz AC97 only codec */
+#define USE_FORMATS		SNDRV_PCM_FMTBIT_S16_LE
+#define USE_CHANNELS_MIN	2
+#define USE_CHANNELS_MAX	2
+#define USE_RATE		SNDRV_PCM_RATE_48000
+#define USE_RATE_MIN		48000
+#define USE_RATE_MAX		48000
+#endif
+
 
 /* defaults */
 #ifndef MAX_BUFFER_SIZE
@@ -77,6 +86,11 @@
 #ifndef USE_FORMATS
 #define USE_FORMATS 		(SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE)
 #endif
+#ifndef USE_RATE
+#define USE_RATE		SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000
+#define USE_RATE_MIN		5500
+#define USE_RATE_MAX		48000
+#endif
 #ifndef USE_CHANNELS_MIN
 #define USE_CHANNELS_MIN 	1
 #endif
@@ -271,9 +285,9 @@
 	.info =			(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
 				 SNDRV_PCM_INFO_MMAP_VALID),
 	.formats =		USE_FORMATS,
-	.rates =		SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
-	.rate_min =		5500,
-	.rate_max =		48000,
+	.rates =		USE_RATE,
+	.rate_min =		USE_RATE_MIN,
+	.rate_max =		USE_RATE_MAX,
 	.channels_min =		USE_CHANNELS_MIN,
 	.channels_max =		USE_CHANNELS_MAX,
 	.buffer_bytes_max =	MAX_BUFFER_SIZE,
@@ -289,9 +303,9 @@
 	.info =			(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
 				 SNDRV_PCM_INFO_MMAP_VALID),
 	.formats =		USE_FORMATS,
-	.rates =		SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
-	.rate_min =		5500,
-	.rate_max =		48000,
+	.rates =		USE_RATE,
+	.rate_min =		USE_RATE_MIN,
+	.rate_max =		USE_RATE_MAX,
 	.channels_min =		USE_CHANNELS_MIN,
 	.channels_max =		USE_CHANNELS_MAX,
 	.buffer_bytes_max =	MAX_BUFFER_SIZE,
diff -Nru a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c
--- a/sound/isa/sb/sb16.c	Thu Jul 31 23:16:39 2003
+++ b/sound/isa/sb/sb16.c	Thu Jul 31 23:16:39 2003
@@ -350,6 +350,18 @@
 
 #endif /* CONFIG_PNP */
 
+static void snd_sb16_free(snd_card_t *card)
+{
+	struct snd_card_sb16 *acard = (struct snd_card_sb16 *)card->private_data;
+        
+	if (acard == NULL)
+		return;
+	if (acard->fm_res) {
+		release_resource(acard->fm_res);
+		kfree_nocheck(acard->fm_res);
+	}
+}
+
 static int __init snd_sb16_probe(int dev,
 				 struct pnp_card_link *pcard,
 				 const struct pnp_card_device_id *pid)
@@ -374,6 +386,7 @@
 	if (card == NULL)
 		return -ENOMEM;
 	acard = (struct snd_card_sb16 *) card->private_data;
+	card->private_free = snd_sb16_free;
 #ifdef CONFIG_PNP
 	if (isapnp[dev]) {
 		if ((err = snd_card_sb16_pnp(dev, acard, pcard, pid))) {
@@ -464,7 +477,8 @@
 
 	if (fm_port[dev] > 0) {
 		if (snd_opl3_create(card, fm_port[dev], fm_port[dev] + 2,
-				    OPL3_HW_OPL3, fm_port[dev] == port[dev],
+				    OPL3_HW_OPL3,
+				    fm_port[dev] == port[dev] || fm_port[dev] == 0x388,
 				    &opl3) < 0) {
 			snd_printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx\n",
 				   fm_port[dev], fm_port[dev] + 2);
diff -Nru a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
--- a/sound/pci/ac97/ac97_patch.c	Thu Jul 31 23:16:39 2003
+++ b/sound/pci/ac97/ac97_patch.c	Thu Jul 31 23:16:39 2003
@@ -650,6 +650,26 @@
 	return 0;
 }
 
+static const snd_kcontrol_new_t snd_ac97_controls_ad1885[] = {
+	AC97_SINGLE("Digital Mono Direct", AC97_AD_MISC, 11, 1, 0),
+	AC97_SINGLE("Digital Audio Mode", AC97_AD_MISC, 12, 1, 0),
+	AC97_SINGLE("Low Power Mixer", AC97_AD_MISC, 14, 1, 0),
+	AC97_SINGLE("Zero Fill DAC", AC97_AD_MISC, 15, 1, 0),
+};
+
+static int patch_ad1885_specific(ac97_t * ac97)
+{
+	int err;
+
+	if ((err = patch_build_controls(ac97, snd_ac97_controls_ad1885, ARRAY_SIZE(snd_ac97_controls_ad1885))) < 0)
+		return err;
+	return 0;
+}
+
+static struct snd_ac97_build_ops patch_ad1885_build_ops = {
+	.build_specific = &patch_ad1885_specific
+};
+
 int patch_ad1885(ac97_t * ac97)
 {
 	unsigned short jack;
@@ -661,6 +681,8 @@
 	/* turn off jack sense bits D8 & D9 */
 	jack = snd_ac97_read(ac97, AC97_AD_JACK_SPDIF);
 	snd_ac97_write_cache(ac97, AC97_AD_JACK_SPDIF, jack | 0x0300);
+
+	ac97->build_ops = &patch_ad1885_build_ops;
 	return 0;
 }
 
diff -Nru a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
--- a/sound/pci/emu10k1/emu10k1.c	Thu Jul 31 23:16:39 2003
+++ b/sound/pci/emu10k1/emu10k1.c	Thu Jul 31 23:16:39 2003
@@ -135,11 +135,9 @@
 		snd_card_free(card);
 		return err;
 	}		
-	if (!emu->APS) {	/* APS board has not an AC97 mixer */
-		if ((err = snd_emu10k1_mixer(emu)) < 0) {
-			snd_card_free(card);
-			return err;
-		}		
+	if ((err = snd_emu10k1_mixer(emu)) < 0) {
+		snd_card_free(card);
+		return err;
 	}
 	if (emu->audigy) {
 		if ((err = snd_emu10k1_audigy_midi(emu)) < 0) {
diff -Nru a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
--- a/sound/pci/emu10k1/emu10k1_main.c	Thu Jul 31 23:16:39 2003
+++ b/sound/pci/emu10k1/emu10k1_main.c	Thu Jul 31 23:16:39 2003
@@ -674,6 +674,14 @@
 	if (emu->serial == 0x40011102) {
 		emu->card_type = EMU10K1_CARD_EMUAPS;
 		emu->APS = 1;
+		emu->no_ac97 = 1; /* APS has no AC97 chip */
+	}
+	else if (emu->revision == 4 && emu->serial == 0x10051102) {
+		/* Audigy 2 EX has apparently no effective AC97 controls
+		 * (for both input and output), so we skip the AC97 detections
+		 */
+		snd_printdd(KERN_INFO "Audigy2 EX is detected. skpping ac97.\n");
+		emu->no_ac97 = 1;
 	}
 	
 	emu->fx8010.fxbus_mask = 0x303f;
diff -Nru a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
--- a/sound/pci/emu10k1/emufx.c	Thu Jul 31 23:16:39 2003
+++ b/sound/pci/emu10k1/emufx.c	Thu Jul 31 23:16:39 2003
@@ -1238,7 +1238,10 @@
 
 static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu)
 {
-	int err, i, z, gpr, tmp, playback, capture, nctl;
+	int err, i, z, gpr, nctl;
+	const int playback = 10;
+	const int capture = playback + (SND_EMU10K1_PLAYBACK_CHANNELS * 2); /* we reserve 10 voices */
+	const int tmp = 0x88;
 	u32 ptr;
 	emu10k1_fx8010_code_t *icode;
 	emu10k1_fx8010_control_gpr_t *controls, *ctl;
@@ -1261,19 +1264,15 @@
 	strcpy(icode->name, "Audigy DSP code for ALSA");
 	ptr = 0;
 	nctl = 0;
-	playback = 10;
-	capture = playback + (SND_EMU10K1_PLAYBACK_CHANNELS * 2); /* we reserve 10 voices */
 	gpr = capture + 10;
-	tmp = 0x88;
 
 	/* stop FX processor */
 	snd_emu10k1_ptr_write(emu, A_DBG, 0, (emu->fx8010.dbg = 0) | A_DBG_SINGLE_STEP);
 
-	/* Wave Playback */
+	/* Wave Playback Volume */
 	A_OP(icode, &ptr, iMAC0, A_GPR(playback), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT));
 	A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT));
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Playback Volume", gpr,
-					emu->revision == 4 ? 50 : 100);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Playback Volume", gpr, 100);
 	gpr += 2;
 
 	/* Wave Surround Playback */
@@ -1497,6 +1496,14 @@
 	snd_emu10k1_init_stereo_onoff_control(controls + nctl++, "Tone Control - Switch", gpr, 0);
 	gpr += 2;
 
+	/* Master volume for audigy2 */
+	if (emu->revision == 4) {
+		A_OP(icode, &ptr, iMAC0, A_GPR(playback+0+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr), A_GPR(playback+0+SND_EMU10K1_PLAYBACK_CHANNELS));
+		A_OP(icode, &ptr, iMAC0, A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS));
+		snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Master Playback Volume", gpr, 0);
+		gpr += 2;
+	}
+
 	/* digital outputs */
 	A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
 	A_PUT_STEREO_OUTPUT(A_EXTOUT_REAR_L, A_EXTOUT_REAR_R, playback+2 + SND_EMU10K1_PLAYBACK_CHANNELS);
@@ -1504,7 +1511,7 @@
 	A_PUT_OUTPUT(A_EXTOUT_LFE, playback+5 + SND_EMU10K1_PLAYBACK_CHANNELS);
 
 	/* analog speakers */
-	if (emu->audigy && emu->revision == 4) { /* audigy2 */
+	if (emu->revision == 4) { /* audigy2 */
 		A_PUT_STEREO_OUTPUT(A_EXTOUT_AFRONT_L, A_EXTOUT_AFRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
 	} else {
 		A_PUT_STEREO_OUTPUT(A_EXTOUT_AC97_L, A_EXTOUT_AC97_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
diff -Nru a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
--- a/sound/pci/emu10k1/emumixer.c	Thu Jul 31 23:16:39 2003
+++ b/sound/pci/emu10k1/emumixer.c	Thu Jul 31 23:16:39 2003
@@ -423,6 +423,36 @@
 	emu->ac97 = NULL;
 }
 
+/*
+ */
+static int remove_ctl(snd_card_t *card, const char *name)
+{
+	snd_ctl_elem_id_t id;
+	memset(&id, 0, sizeof(id));
+	strcpy(id.name, name);
+	id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
+	return snd_ctl_remove_id(card, &id);
+}
+
+static snd_kcontrol_t *ctl_find(snd_card_t *card, const char *name)
+{
+	snd_ctl_elem_id_t sid;
+	memset(&sid, 0, sizeof(sid));
+	strcpy(sid.name, name);
+	sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
+	return snd_ctl_find_id(card, &sid);
+}
+
+static int rename_ctl(snd_card_t *card, const char *src, const char *dst)
+{
+	snd_kcontrol_t *kctl = ctl_find(card, src);
+	if (kctl) {
+		strcpy(kctl->id.name, dst);
+		return 0;
+	}
+	return -ENOENT;
+}
+
 int __devinit snd_emu10k1_mixer(emu10k1_t *emu)
 {
 	ac97_t ac97;
@@ -430,7 +460,7 @@
 	snd_kcontrol_t *kctl;
 	snd_card_t *card = emu->card;
 
-	if (!emu->APS) {
+	if (!emu->no_ac97) {
 		memset(&ac97, 0, sizeof(ac97));
 		ac97.write = snd_emu10k1_ac97_write;
 		ac97.read = snd_emu10k1_ac97_read;
@@ -438,8 +468,33 @@
 		ac97.private_free = snd_emu10k1_mixer_free_ac97;
 		if ((err = snd_ac97_mixer(emu->card, &ac97, &emu->ac97)) < 0)
 			return err;
+		if (emu->audigy && emu->revision == 4) {
+			/* Master/PCM controls on ac97 of Audigy2 has no effect */
+			/* FIXME: keep master volume/switch to be sure.
+			 * once after we check that they play really no roles,
+			 * they shall be removed.
+			 */
+			rename_ctl(card, "Master Playback Switch", "AC97 Master Playback Switch");
+			rename_ctl(card, "Master Playback Volume", "AC97 Master Playback Volume");
+			/* pcm controls are removed */
+			remove_ctl(card, "PCM Playback Switch");
+			remove_ctl(card, "PCM Playback Volume");
+		}
 	} else {
-		strcpy(emu->card->mixername, "EMU APS");
+		if (emu->APS)
+			strcpy(emu->card->mixername, "EMU APS");
+		else if (emu->audigy)
+			strcpy(emu->card->mixername, "SB Audigy");
+		else
+			strcpy(emu->card->mixername, "Emu10k1");
+	}
+
+	if (emu->audigy && emu->revision == 4) {
+		/* Audigy2 and Audigy2 EX */
+		/* use the conventional names */
+		rename_ctl(card, "Wave Playback Volume", "PCM Playback Volume");
+		rename_ctl(card, "Wave Playback Volume", "PCM Capture Volume");
+		rename_ctl(card, "Wave Master Playback Volume", "Master Playback Volume");
 	}
 
 	if ((kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu)) == NULL)
@@ -455,6 +510,7 @@
 	if ((err = snd_ctl_add(card, kctl)))
 		return err;
 
+	/* intiailize the routing and volume table for each pcm playback stream */
 	for (pcm = 0; pcm < 32; pcm++) {
 		emu10k1_pcm_mixer_t *mix;
 		int v;
@@ -474,21 +530,25 @@
 		mix->attn[0] = mix->attn[1] = mix->attn[2] = 0xffff;
 	}
 	
-	if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu)) == NULL)
-		return -ENOMEM;
-	if ((err = snd_ctl_add(card, kctl)))
-		return err;
-	if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_control, emu)) == NULL)
-		return -ENOMEM;
-	if ((err = snd_ctl_add(card, kctl)))
-		return err;
+	if (! emu->APS) { /* FIXME: APS has these controls? */
+		/* sb live! and audigy */
+		if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu)) == NULL)
+			return -ENOMEM;
+		if ((err = snd_ctl_add(card, kctl)))
+			return err;
+		if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_control, emu)) == NULL)
+			return -ENOMEM;
+		if ((err = snd_ctl_add(card, kctl)))
+			return err;
+	}
 
 	if (emu->audigy) {
 		if ((kctl = snd_ctl_new1(&snd_audigy_shared_spdif, emu)) == NULL)
 			return -ENOMEM;
 		if ((err = snd_ctl_add(card, kctl)))
 			return err;
-	} else {
+	} else if (! emu->APS) {
+		/* sb live! */
 		if ((kctl = snd_ctl_new1(&snd_emu10k1_shared_spdif, emu)) == NULL)
 			return -ENOMEM;
 		if ((err = snd_ctl_add(card, kctl)))
diff -Nru a/sound/pci/emu10k1/irq.c b/sound/pci/emu10k1/irq.c
--- a/sound/pci/emu10k1/irq.c	Thu Jul 31 23:16:39 2003
+++ b/sound/pci/emu10k1/irq.c	Thu Jul 31 23:16:39 2003
@@ -55,15 +55,13 @@
 		if (status & IPR_CHANNELLOOP) {
 			int voice;
 			int voice_max = status & IPR_CHANNELNUMBERMASK;
-			int voice_max_l;
 			u32 val;
 			emu10k1_voice_t *pvoice = emu->voices;
 
 			val = snd_emu10k1_ptr_read(emu, CLIPL, 0);
-			voice_max_l = voice_max;
-			if (voice_max_l >= 0x20)
-				voice_max_l = 0x1f;
-			for (voice = 0; voice <= voice_max_l; voice++) {
+			for (voice = 0; voice <= voice_max; voice++) {
+				if (voice == 0x20)
+					val = snd_emu10k1_ptr_read(emu, CLIPH, 0);
 				if (val & 1) {
 					if (pvoice->use && pvoice->interrupt != NULL) {
 						pvoice->interrupt(emu, pvoice);
@@ -75,21 +73,6 @@
 				val >>= 1;
 				pvoice++;
 			}
-			if (voice_max > 0x1f) {
-				val = snd_emu10k1_ptr_read(emu, CLIPH, 0);
-				for (; voice <= voice_max; voice++) {
-					if(val & 1) {
-						if (pvoice->use && pvoice->interrupt != NULL) {
-							pvoice->interrupt(emu, pvoice);
-							snd_emu10k1_voice_intr_ack(emu, voice);
-						} else {
-							snd_emu10k1_voice_intr_disable(emu, voice);
-						}
-					}
-					val >>= 1;
-					pvoice++;
-				}
-			}
 			status &= ~IPR_CHANNELLOOP;
 		}
 		status &= ~IPR_CHANNELNUMBERMASK;
@@ -150,9 +133,27 @@
 			status &= ~IPR_FXDSP;
 		}
 		if (status) {
-			snd_printd(KERN_WARNING "emu10k1: unhandled interrupt: 0x%08x\n", status);
+			unsigned int bits;
+			snd_printk(KERN_ERR "emu10k1: unhandled interrupt: 0x%08x\n", status);
+			//make sure any interrupts we don't handle are disabled:
+			bits = INTE_FXDSPENABLE |
+				INTE_PCIERRORENABLE |
+				INTE_VOLINCRENABLE |
+				INTE_VOLDECRENABLE |
+				INTE_MUTEENABLE |
+				INTE_MICBUFENABLE |
+				INTE_ADCBUFENABLE |
+				INTE_EFXBUFENABLE |
+				INTE_GPSPDIFENABLE |
+				INTE_CDSPDIFENABLE |
+				INTE_INTERVALTIMERENB |
+				INTE_MIDITXENABLE |
+				INTE_MIDIRXENABLE;
+			if (emu->audigy)
+				bits |= INTE_A_MIDITXENABLE2 | INTE_A_MIDIRXENABLE2;
+			snd_emu10k1_intr_disable(emu, bits);
 		}
-		outl(orig_status, emu->port + IPR); /* ack */
+		outl(orig_status, emu->port + IPR); /* ack all */
 	}
 	return IRQ_RETVAL(handled);
 }
diff -Nru a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
--- a/sound/pci/intel8x0.c	Thu Jul 31 23:16:39 2003
+++ b/sound/pci/intel8x0.c	Thu Jul 31 23:16:39 2003
@@ -1002,7 +1002,7 @@
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	static unsigned int i, rates[] = {
 		/* ATTENTION: these values depend on the definition in pcm.h! */
-		5512, 8000, 11025, 16000, 22050, 32000, 44100, 480000
+		5512, 8000, 11025, 16000, 22050, 32000, 44100, 48000
 	};
 	int err;
 
@@ -1558,6 +1558,7 @@
 	{ 0x1028, 0x0126, "Dell Optiplex GX260", AC97_TUNE_HP_ONLY },
 	{ 0x1734, 0x0088, "Fujitsu-Siemens D1522", AC97_TUNE_HP_ONLY },
 	{ 0x10f1, 0x2665, "Fujitsu-Siemens Celcius", AC97_TUNE_HP_ONLY },
+	{ 0x110a, 0x0056, "Fujitsu-Siemens Scenic", AC97_TUNE_HP_ONLY },
 	{ 0x8086, 0x4d44, "Intel D850EMV2", AC97_TUNE_HP_ONLY },
 	/* { 0x4144, 0x5360, "AMD64 Motherboard", AC97_TUNE_HP_ONLY }, */ /* FIXME: this seems invalid */
 	{ 0x1043, 0x80b0, "ASUS P4PE Mobo", AC97_TUNE_SWAP_SURROUND },
diff -Nru a/sound/pci/maestro3.c b/sound/pci/maestro3.c
--- a/sound/pci/maestro3.c	Thu Jul 31 23:16:39 2003
+++ b/sound/pci/maestro3.c	Thu Jul 31 23:16:39 2003
@@ -1535,9 +1535,14 @@
 snd_m3_pcm_pointer(snd_pcm_substream_t * subs)
 {
 	m3_t *chip = snd_pcm_substream_chip(subs);
+	unsigned int ptr;
 	m3_dma_t *s = (m3_dma_t*)subs->runtime->private_data;
 	snd_assert(s != NULL, return 0);
-	return bytes_to_frames(subs->runtime, snd_m3_get_pointer(chip, s, subs));
+
+	spin_lock(&chip->reg_lock);
+	ptr = snd_m3_get_pointer(chip, s, subs);
+	spin_unlock(&chip->reg_lock);
+	return bytes_to_frames(subs->runtime, ptr);
 }
 
 
diff -Nru a/sound/pci/via82xx.c b/sound/pci/via82xx.c
--- a/sound/pci/via82xx.c	Thu Jul 31 23:16:39 2003
+++ b/sound/pci/via82xx.c	Thu Jul 31 23:16:39 2003
@@ -886,7 +886,7 @@
 		snd_ac97_set_rate(chip->ac97, AC97_PCM_LFE_DAC_RATE, runtime->rate);
 		snd_ac97_set_rate(chip->ac97, AC97_SPDIF, runtime->rate);
 	}
-	if (chip->chip_type == TYPE_VIA8233A)
+	if (chip->revision == VIA_REV_8233A)
 		rbits = 0;
 	else
 		rbits = (0xfffff / 48000) * runtime->rate + ((0xfffff % 48000) * runtime->rate) / 48000;
@@ -928,7 +928,7 @@
 	fmt = (runtime->format == SNDRV_PCM_FORMAT_S16_LE) ? VIA_REG_MULTPLAY_FMT_16BIT : VIA_REG_MULTPLAY_FMT_8BIT;
 	fmt |= runtime->channels << 4;
 	outb(fmt, VIADEV_REG(viadev, OFS_MULTPLAY_FORMAT));
-	if (chip->chip_type == TYPE_VIA8233A)
+	if (chip->revision == VIA_REV_8233A)
 		slots = 0;
 	else {
 		/* set sample number to slot 3, 4, 7, 8, 6, 9 (for VIA8233/C,8235) */
@@ -1108,7 +1108,7 @@
 	if ((err = snd_via82xx_pcm_open(chip, viadev, substream)) < 0)
 		return err;
 	substream->runtime->hw.channels_max = 6;
-	if (chip->chip_type == TYPE_VIA8233A)
+	if (chip->revision == VIA_REV_8233A)
 		snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels);
 	return 0;
 }
diff -Nru a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
--- a/sound/synth/emux/soundfont.c	Thu Jul 31 23:16:39 2003
+++ b/sound/synth/emux/soundfont.c	Thu Jul 31 23:16:39 2003
@@ -66,15 +66,11 @@
 static int
 lock_preset(snd_sf_list_t *sflist, int nonblock)
 {
-	unsigned long flags;
-	spin_lock_irqsave(&sflist->lock, flags);
-	if (sflist->sf_locked && nonblock) {
-		spin_unlock_irqrestore(&sflist->lock, flags);
-		return -EBUSY;
-	}
-	spin_unlock_irqrestore(&sflist->lock, flags);
-	down(&sflist->presets_mutex);
-	sflist->sf_locked = 1;
+	if (nonblock) {
+		if (down_trylock(&sflist->presets_mutex))
+			return -EBUSY;
+	} else 
+		down(&sflist->presets_mutex);
 	return 0;
 }
 
@@ -86,7 +82,6 @@
 unlock_preset(snd_sf_list_t *sflist)
 {
 	up(&sflist->presets_mutex);
-	sflist->sf_locked = 0;
 }
 
 
@@ -1356,7 +1351,6 @@
 
 	init_MUTEX(&sflist->presets_mutex);
 	spin_lock_init(&sflist->lock);
-	sflist->sf_locked = 0;
 	sflist->memhdr = hdr;
 
 	if (callback)
@@ -1403,7 +1397,7 @@
 
 /*
  * Remove unlocked samples.
- * The soundcard should be silet before calling this function.
+ * The soundcard should be silent before calling this function.
  */
 int
 snd_soundfont_remove_unlocked(snd_sf_list_t *sflist)
diff -Nru a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
--- a/sound/usb/usbaudio.c	Thu Jul 31 23:16:39 2003
+++ b/sound/usb/usbaudio.c	Thu Jul 31 23:16:39 2003
@@ -2297,6 +2297,14 @@
 			 */
 			fp->attributes &= ~EP_CS_ATTR_SAMPLE_RATE;
 		}
+
+		/* workaround for M-Audio Audiophile USB */
+		if (dev->descriptor.idVendor == 0x0763 &&
+		    dev->descriptor.idProduct == 0x2003) {
+			/* doesn't set the sample rate attribute, but supports it */
+			fp->attributes |= EP_CS_ATTR_SAMPLE_RATE;
+		}
+
 		/*
 		 * plantronics headset and Griffin iMic have set adaptive-in
 		 * although it's really not...
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27  7:50               ` OSS sound emulation broken between 2.6.0-test2 and test3 Martin J. Bligh
@ 2003-12-27 11:11                 ` Martin Schlemmer
  2003-12-27 11:44                   ` Edward Tandi
  2003-12-28  5:06                 ` Joshua Schmidlkofer
  1 sibling, 1 reply; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-27 11:11 UTC (permalink / raw)
  To: Martin J. Bligh
  Cc: perex, alsa-devel, Linux Kernel Mailing Lists, Rob Love,
	Andrew Morton, Stan Bubrouski

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

On Sat, 2003-12-27 at 09:50, Martin J. Bligh wrote:
> Something appears to have broken OSS sound emulation between 
> test2 and test3. Best I can tell (despite the appearance of the BK logs), 
> that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
> understands the sound architecture better than I can fix this?
> 

I wont say I understand it, but a quick look seems the major change is
the addition of the 'whole-frag' and 'no-silence' opts.  You might try
the following to revert what 'no-silence' change at least does:

--
 # echo 'xmms 0 0 no-silence' > /proc/asound/card0/pcm0p/oss
 # echo 'xmms 0 0 whole-frag' > /proc/asound/card0/pcm0p/oss
--

and restart xmms.  If that do not work, then one of the alsa guys will
have to have a look.


-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: 2.6.0 sound output - wierd effects
  2003-12-27  4:34               ` Martin J. Bligh
@ 2003-12-27 11:12                 ` Martin Schlemmer
  2003-12-27 16:17                   ` Martin J. Bligh
  0 siblings, 1 reply; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-27 11:12 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: Linux Kernel Mailing Lists

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

On Sat, 2003-12-27 at 06:34, Martin J. Bligh wrote:
> >> > If you right click on xmms, and then select options->preferences, on the
> >> > first page to the bottom there should be output plugin.  If you cannot
> >> > select alsa, see if there is a xmms-alsa or libxmms-alsa plugin.  Sorry,
> >> > I do not know Debian that well.
> >> 
> >> Thanks, it was on OSS - there's no ALSA selection, nor can I find one.
> >> There's probably one in unstable somewhere, but ... see below.
> > 
> > Btw, compile xmms yourself - should have alsa then =)  Not sure if
> > it will if you build with apt-get from source, or when they started
> > to ship the alsa module with xmms source - think it was not so long
> > ago.  Does with 1.2.8 though:
> 
> Oh, I understand I could work around the problem in userspace, but that's 
> not the point - something broke in the kernel, presumably OSS emulation.
> test2 works, test3 doesn't. 
> 

It might be that there always was a problem in userspace ... Like I said
in another mail - its working here now.  Also, _did_ you try something
else than xmms ... it may be an xmms issue, and not a alsa one ... ?


-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 11:11                 ` Martin Schlemmer
@ 2003-12-27 11:44                   ` Edward Tandi
  2003-12-27 12:24                     ` Martin Schlemmer
                                       ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Edward Tandi @ 2003-12-27 11:44 UTC (permalink / raw)
  To: azarah
  Cc: Martin J. Bligh, perex, alsa-devel, Linux Kernel Mailing Lists,
	Rob Love, Andrew Morton, Stan Bubrouski

On Sat, 2003-12-27 at 11:11, Martin Schlemmer wrote:
> On Sat, 2003-12-27 at 09:50, Martin J. Bligh wrote:
> > Something appears to have broken OSS sound emulation between 
> > test2 and test3. Best I can tell (despite the appearance of the BK logs), 
> > that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
> > understands the sound architecture better than I can fix this?
> > 
> 
> I wont say I understand it, but a quick look seems the major change is
> the addition of the 'whole-frag' and 'no-silence' opts.  You might try
> the following to revert what 'no-silence' change at least does:
> 
> --
>  # echo 'xmms 0 0 no-silence' > /proc/asound/card0/pcm0p/oss
>  # echo 'xmms 0 0 whole-frag' > /proc/asound/card0/pcm0p/oss
> --

Thanks, that fixes it for me. I too have been seeing terrible problems
with XMMS since the early 2.6 pre- kernels.

Because it only happens in XMMS I thought it was one of those
application bugs brought out by scheduler changes. I now use Zinf BTW
-It's better for large music collections (although not as stable or
flash).

I guess someone ought to revert the standard behaviour.

Ed-T.


> and restart xmms.  If that do not work, then one of the alsa guys will
> have to have a look.



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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 11:44                   ` Edward Tandi
@ 2003-12-27 12:24                     ` Martin Schlemmer
  2003-12-27 13:08                       ` Edward Tandi
  2003-12-27 18:35                     ` Martin J. Bligh
  2004-01-03  0:53                     ` Chris Shafer
  2 siblings, 1 reply; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-27 12:24 UTC (permalink / raw)
  To: Edward Tandi
  Cc: Martin J. Bligh, perex, alsa-devel, Linux Kernel Mailing Lists,
	Rob Love, Andrew Morton, Stan Bubrouski

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

On Sat, 2003-12-27 at 13:44, Edward Tandi wrote:
> On Sat, 2003-12-27 at 11:11, Martin Schlemmer wrote:
> > On Sat, 2003-12-27 at 09:50, Martin J. Bligh wrote:
> > > Something appears to have broken OSS sound emulation between 
> > > test2 and test3. Best I can tell (despite the appearance of the BK logs), 
> > > that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
> > > understands the sound architecture better than I can fix this?
> > > 
> > 
> > I wont say I understand it, but a quick look seems the major change is
> > the addition of the 'whole-frag' and 'no-silence' opts.  You might try
> > the following to revert what 'no-silence' change at least does:
> > 
> > --
> >  # echo 'xmms 0 0 no-silence' > /proc/asound/card0/pcm0p/oss
> >  # echo 'xmms 0 0 whole-frag' > /proc/asound/card0/pcm0p/oss
> > --
> 
> Thanks, that fixes it for me. I too have been seeing terrible problems
> with XMMS since the early 2.6 pre- kernels.
> 
> Because it only happens in XMMS I thought it was one of those
> application bugs brought out by scheduler changes. I now use Zinf BTW
> -It's better for large music collections (although not as stable or
> flash).
> 

Can you check which one actually fixes it ?


Thanks,

-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 12:24                     ` Martin Schlemmer
@ 2003-12-27 13:08                       ` Edward Tandi
  2003-12-27 14:33                         ` Martin Schlemmer
  0 siblings, 1 reply; 41+ messages in thread
From: Edward Tandi @ 2003-12-27 13:08 UTC (permalink / raw)
  To: azarah
  Cc: Martin J. Bligh, perex, alsa-devel, Linux Kernel Mailing Lists,
	Rob Love, Andrew Morton, Stan Bubrouski

On Sat, 2003-12-27 at 12:24, Martin Schlemmer wrote:
> On Sat, 2003-12-27 at 13:44, Edward Tandi wrote:
> > On Sat, 2003-12-27 at 11:11, Martin Schlemmer wrote:
> > > On Sat, 2003-12-27 at 09:50, Martin J. Bligh wrote:
> > > > Something appears to have broken OSS sound emulation between 
> > > > test2 and test3. Best I can tell (despite the appearance of the BK logs), 
> > > > that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
> > > > understands the sound architecture better than I can fix this?
> > > > 
> > > 
> > > I wont say I understand it, but a quick look seems the major change is
> > > the addition of the 'whole-frag' and 'no-silence' opts.  You might try
> > > the following to revert what 'no-silence' change at least does:
> > > 
> > > --
> > >  # echo 'xmms 0 0 no-silence' > /proc/asound/card0/pcm0p/oss
> > >  # echo 'xmms 0 0 whole-frag' > /proc/asound/card0/pcm0p/oss
> > > --
> > 
> > Thanks, that fixes it for me. I too have been seeing terrible problems
> > with XMMS since the early 2.6 pre- kernels.
> > 
> > Because it only happens in XMMS I thought it was one of those
> > application bugs brought out by scheduler changes. I now use Zinf BTW
> > -It's better for large music collections (although not as stable or
> > flash).
> > 
> 
> Can you check which one actually fixes it ?

Yes, its the 'whole-frag' line.

Ed-T.



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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 13:08                       ` Edward Tandi
@ 2003-12-27 14:33                         ` Martin Schlemmer
  2003-12-27 16:55                           ` Edward Tandi
  0 siblings, 1 reply; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-27 14:33 UTC (permalink / raw)
  To: Edward Tandi
  Cc: Martin J. Bligh, perex, alsa-devel, Linux Kernel Mailing Lists,
	Rob Love, Andrew Morton, Stan Bubrouski

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

On Sat, 2003-12-27 at 15:08, Edward Tandi wrote:
> On Sat, 2003-12-27 at 12:24, Martin Schlemmer wrote:
> > On Sat, 2003-12-27 at 13:44, Edward Tandi wrote:
> > > On Sat, 2003-12-27 at 11:11, Martin Schlemmer wrote:
> > > > On Sat, 2003-12-27 at 09:50, Martin J. Bligh wrote:
> > > > > Something appears to have broken OSS sound emulation between 
> > > > > test2 and test3. Best I can tell (despite the appearance of the BK logs), 
> > > > > that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
> > > > > understands the sound architecture better than I can fix this?
> > > > > 
> > > > 
> > > > I wont say I understand it, but a quick look seems the major change is
> > > > the addition of the 'whole-frag' and 'no-silence' opts.  You might try
> > > > the following to revert what 'no-silence' change at least does:
> > > > 
> > > > --
> > > >  # echo 'xmms 0 0 no-silence' > /proc/asound/card0/pcm0p/oss
> > > >  # echo 'xmms 0 0 whole-frag' > /proc/asound/card0/pcm0p/oss
> > > > --
> > > 
> > > Thanks, that fixes it for me. I too have been seeing terrible problems
> > > with XMMS since the early 2.6 pre- kernels.
> > > 
> > > Because it only happens in XMMS I thought it was one of those
> > > application bugs brought out by scheduler changes. I now use Zinf BTW
> > > -It's better for large music collections (although not as stable or
> > > flash).
> > > 
> > 
> > Can you check which one actually fixes it ?
> 
> Yes, its the 'whole-frag' line.
> 

Well, I can't say I can see why. In snd_pcm_oss_write1 where the change
for whole-frag was, I cannot see a race or such.  The only possible
causes I can see, is that:
1) xmms's scheduling gets screwed due to the short writes
2) some drivers may have issues with getting short writes all the time.

Only problem with 2), is that Zinf works fine for you, so I guess the
only thing to assume is that either Zinf do not use OSS, but ALSA
interface, or that 1) is indeed the correct answer.  What version of
XMMS do you use btw?


-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: 2.6.0 sound output - wierd effects
  2003-12-26 22:27 ` Sven-Haegar Koch
@ 2003-12-27 16:14   ` Martin J. Bligh
  0 siblings, 0 replies; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-27 16:14 UTC (permalink / raw)
  To: Sven-Haegar Koch; +Cc: linux-kernel

>> Upgraded my home desktop to 2.6.0.
>> Somewhere between 2.5.63 and 2.6.0, sound got screwed up - I've confirmed
>> this happens on mainline, as well as -mjb.
>> 
>> If I leave xmms playing (in random shuffle mode) every 2 minutes or so,
>> I'll get some wierd effect for a few seconds, either static, or the track
>> will mysteriously speed up or slow down. Then all is back to normal for
>> another couple of minutes.
>> 
>> Anyone else seen this, or got any clues? Else I guess I'm stuck playing
>> bisection search.
> 
> I get exactly the same with kernel 2.4 and alsa, intel8x0 ac97, but did
> not test alsa 1.0rc yet, which mentions "intel8x0 driver fixes, OSS PCM
> emulation fixes" - perhaps these fixes help.

I tried rc2, the latest from their website, it's still broken.

M.


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

* Re: 2.6.0 sound output - wierd effects
  2003-12-27 11:12                 ` Martin Schlemmer
@ 2003-12-27 16:17                   ` Martin J. Bligh
  0 siblings, 0 replies; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-27 16:17 UTC (permalink / raw)
  To: azarah; +Cc: Linux Kernel Mailing Lists

>> >> > If you right click on xmms, and then select options->preferences, on the
>> >> > first page to the bottom there should be output plugin.  If you cannot
>> >> > select alsa, see if there is a xmms-alsa or libxmms-alsa plugin.  Sorry,
>> >> > I do not know Debian that well.
>> >> 
>> >> Thanks, it was on OSS - there's no ALSA selection, nor can I find one.
>> >> There's probably one in unstable somewhere, but ... see below.
>> > 
>> > Btw, compile xmms yourself - should have alsa then =)  Not sure if
>> > it will if you build with apt-get from source, or when they started
>> > to ship the alsa module with xmms source - think it was not so long
>> > ago.  Does with 1.2.8 though:
>> 
>> Oh, I understand I could work around the problem in userspace, but that's 
>> not the point - something broke in the kernel, presumably OSS emulation.
>> test2 works, test3 doesn't. 
>> 
> 
> It might be that there always was a problem in userspace ... Like I said
> in another mail - its working here now.  Also, _did_ you try something
> else than xmms ... it may be an xmms issue, and not a alsa one ... ?

Nope. But I find it hard to believe, given that it's so consistent on 
switching kernels, and others have had the same problem.

M.


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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 14:33                         ` Martin Schlemmer
@ 2003-12-27 16:55                           ` Edward Tandi
  2003-12-27 17:22                             ` Martin Schlemmer
  2003-12-27 21:56                             ` Henrik Storner
  0 siblings, 2 replies; 41+ messages in thread
From: Edward Tandi @ 2003-12-27 16:55 UTC (permalink / raw)
  To: azarah
  Cc: Martin J. Bligh, perex, alsa-devel, Linux Kernel Mailing Lists,
	Rob Love, Andrew Morton, Stan Bubrouski

On Sat, 2003-12-27 at 14:33, Martin Schlemmer wrote:
> On Sat, 2003-12-27 at 15:08, Edward Tandi wrote:
> > On Sat, 2003-12-27 at 12:24, Martin Schlemmer wrote:
> > > On Sat, 2003-12-27 at 13:44, Edward Tandi wrote:
> > > > On Sat, 2003-12-27 at 11:11, Martin Schlemmer wrote:
> > > > > On Sat, 2003-12-27 at 09:50, Martin J. Bligh wrote:
> > > > > > Something appears to have broken OSS sound emulation between 
> > > > > > test2 and test3. Best I can tell (despite the appearance of the BK logs), 
> > > > > > that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
> > > > > > understands the sound architecture better than I can fix this?
> > > > > > 
> > > > > 
> > > > > I wont say I understand it, but a quick look seems the major change is
> > > > > the addition of the 'whole-frag' and 'no-silence' opts.  You might try
> > > > > the following to revert what 'no-silence' change at least does:
> > > > > 
> > > > > --
> > > > >  # echo 'xmms 0 0 no-silence' > /proc/asound/card0/pcm0p/oss
> > > > >  # echo 'xmms 0 0 whole-frag' > /proc/asound/card0/pcm0p/oss
> > > > > --
> > > > 
> > > > Thanks, that fixes it for me. I too have been seeing terrible problems
> > > > with XMMS since the early 2.6 pre- kernels.
> > > > 
> > > > Because it only happens in XMMS I thought it was one of those
> > > > application bugs brought out by scheduler changes. I now use Zinf BTW
> > > > -It's better for large music collections (although not as stable or
> > > > flash).
> > > > 
> > > 
> > > Can you check which one actually fixes it ?
> > 
> > Yes, its the 'whole-frag' line.
> > 
> 
> Well, I can't say I can see why. In snd_pcm_oss_write1 where the change
> for whole-frag was, I cannot see a race or such.  The only possible
> causes I can see, is that:
> 1) xmms's scheduling gets screwed due to the short writes
> 2) some drivers may have issues with getting short writes all the time.
> 
> Only problem with 2), is that Zinf works fine for you, so I guess the
> only thing to assume is that either Zinf do not use OSS, but ALSA
> interface, or that 1) is indeed the correct answer.  What version of
> XMMS do you use btw?

I was originally running 1.2.7 when I first encountered the problem. I
then built 1.2.8 -but no difference.

Zinf does indeed use the ALSA interface (as most apps do nowadays).

I would say the symptoms are that the music starts playing OK bit after
a short period (18-19 seconds), the music changes overall speed (by a
semi-tone or so). When it does this, the sound also starts to break up.
This is why I associated the problem with the process scheduling changes
being made at the time.

It could be a driver issue. FYI, I am using a VIA KT400 chipset. Any one
know of any low-level timing issues with the KT400?

Ed-T.



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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 16:55                           ` Edward Tandi
@ 2003-12-27 17:22                             ` Martin Schlemmer
  2003-12-27 21:56                             ` Henrik Storner
  1 sibling, 0 replies; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-27 17:22 UTC (permalink / raw)
  To: Edward Tandi
  Cc: Martin J. Bligh, perex, alsa-devel, Linux Kernel Mailing Lists,
	Rob Love, Andrew Morton, Stan Bubrouski


[-- Attachment #1.1: Type: text/plain, Size: 3485 bytes --]

On Sat, 2003-12-27 at 18:55, Edward Tandi wrote:
> On Sat, 2003-12-27 at 14:33, Martin Schlemmer wrote:
> > On Sat, 2003-12-27 at 15:08, Edward Tandi wrote:
> > > On Sat, 2003-12-27 at 12:24, Martin Schlemmer wrote:
> > > > On Sat, 2003-12-27 at 13:44, Edward Tandi wrote:
> > > > > On Sat, 2003-12-27 at 11:11, Martin Schlemmer wrote:
> > > > > > On Sat, 2003-12-27 at 09:50, Martin J. Bligh wrote:
> > > > > > > Something appears to have broken OSS sound emulation between 
> > > > > > > test2 and test3. Best I can tell (despite the appearance of the BK logs), 
> > > > > > > that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
> > > > > > > understands the sound architecture better than I can fix this?
> > > > > > > 
> > > > > > 
> > > > > > I wont say I understand it, but a quick look seems the major change is
> > > > > > the addition of the 'whole-frag' and 'no-silence' opts.  You might try
> > > > > > the following to revert what 'no-silence' change at least does:
> > > > > > 
> > > > > > --
> > > > > >  # echo 'xmms 0 0 no-silence' > /proc/asound/card0/pcm0p/oss
> > > > > >  # echo 'xmms 0 0 whole-frag' > /proc/asound/card0/pcm0p/oss
> > > > > > --
> > > > > 
> > > > > Thanks, that fixes it for me. I too have been seeing terrible problems
> > > > > with XMMS since the early 2.6 pre- kernels.
> > > > > 
> > > > > Because it only happens in XMMS I thought it was one of those
> > > > > application bugs brought out by scheduler changes. I now use Zinf BTW
> > > > > -It's better for large music collections (although not as stable or
> > > > > flash).
> > > > > 
> > > > 
> > > > Can you check which one actually fixes it ?
> > > 
> > > Yes, its the 'whole-frag' line.
> > > 
> > 
> > Well, I can't say I can see why. In snd_pcm_oss_write1 where the change
> > for whole-frag was, I cannot see a race or such.  The only possible
> > causes I can see, is that:
> > 1) xmms's scheduling gets screwed due to the short writes
> > 2) some drivers may have issues with getting short writes all the time.
> > 
> > Only problem with 2), is that Zinf works fine for you, so I guess the
> > only thing to assume is that either Zinf do not use OSS, but ALSA
> > interface, or that 1) is indeed the correct answer.  What version of
> > XMMS do you use btw?
> 
> I was originally running 1.2.7 when I first encountered the problem. I
> then built 1.2.8 -but no difference.
> 
> Zinf does indeed use the ALSA interface (as most apps do nowadays).
> 

Ok, so it still can go either way.

> I would say the symptoms are that the music starts playing OK bit after
> a short period (18-19 seconds), the music changes overall speed (by a
> semi-tone or so). When it does this, the sound also starts to break up.
> This is why I associated the problem with the process scheduling changes
> being made at the time.
> 

I do not use the default scheduler - I attached Nick's one, with a
context-switch-accounting-fix.patch which should be applied before
sched-rollup-v19a.patch ...  I cannot reboot now with vanilla to test
if this will break things for me again (until weekend is past), but
you may try with it and see if the scheduler theory is correct.

> It could be a driver issue. FYI, I am using a VIA KT400 chipset. Any one
> know of any low-level timing issues with the KT400?
> 

I do not have a box with this chipset, so I do not follow related
threads, sorry.


-- 
Martin Schlemmer

[-- Attachment #1.2: context-switch-accounting-fix.patch --]
[-- Type: text/x-patch, Size: 1888 bytes --]


From: Nick Piggin <piggin@cyberone.com.au>

Make sure to count kernel preemption as a context switch. A short cut
has been preventing it.



 kernel/sched.c |   37 +++++++++++++++----------------------
 1 files changed, 15 insertions(+), 22 deletions(-)

diff -puN kernel/sched.c~context-switch-accounting-fix kernel/sched.c
--- 25/kernel/sched.c~context-switch-accounting-fix	2003-11-11 19:29:37.000000000 -0800
+++ 25-akpm/kernel/sched.c	2003-11-11 19:29:37.000000000 -0800
@@ -1513,33 +1513,20 @@ need_resched:
 
 	spin_lock_irq(&rq->lock);
 
-	/*
-	 * if entering off of a kernel preemption go straight
-	 * to picking the next task.
-	 */
-	if (unlikely(preempt_count() & PREEMPT_ACTIVE))
-		goto pick_next_task;
-
-	switch (prev->state) {
-	case TASK_INTERRUPTIBLE:
-		if (unlikely(signal_pending(prev))) {
+	if (prev->state != TASK_RUNNING &&
+			likely(!(preempt_count() & PREEMPT_ACTIVE)) ) {
+		if (unlikely(signal_pending(prev)) &&
+				prev->state == TASK_INTERRUPTIBLE)
 			prev->state = TASK_RUNNING;
-			break;
-		}
-	default:
-		deactivate_task(prev, rq);
-		prev->nvcsw++;
-		break;
-	case TASK_RUNNING:
-		prev->nivcsw++;
+		else
+			deactivate_task(prev, rq);
 	}
-pick_next_task:
-	if (unlikely(!rq->nr_running)) {
+
 #ifdef CONFIG_SMP
+	if (unlikely(!rq->nr_running))
 		load_balance(rq, 1, cpu_to_node_mask(smp_processor_id()));
-		if (rq->nr_running)
-			goto pick_next_task;
 #endif
+	if (unlikely(!rq->nr_running)) {
 		next = rq->idle;
 		rq->expired_timestamp = 0;
 		goto switch_tasks;
@@ -1586,6 +1573,12 @@ switch_tasks:
 	prev->timestamp = now;
 
 	if (likely(prev != next)) {
+		if (prev->state == TASK_RUNNING ||
+				unlikely(preempt_count() & PREEMPT_ACTIVE))
+			prev->nivcsw++;
+		else
+			prev->nvcsw++;
+
 		next->timestamp = now;
 		rq->nr_switches++;
 		rq->curr = next;

_

[-- Attachment #1.3: sched-rollup-v19a.patch --]
[-- Type: text/x-patch, Size: 57700 bytes --]

 linux-2.6-npiggin/arch/i386/kernel/smpboot.c |    4 
 linux-2.6-npiggin/fs/proc/array.c            |    8 
 linux-2.6-npiggin/include/linux/init_task.h  |    4 
 linux-2.6-npiggin/include/linux/sched.h      |   12 
 linux-2.6-npiggin/include/linux/topology.h   |    8 
 linux-2.6-npiggin/init/main.c                |    1 
 linux-2.6-npiggin/kernel/fork.c              |   30 
 linux-2.6-npiggin/kernel/sched.c             | 1237 ++++++++++++++-------------
 8 files changed, 688 insertions(+), 616 deletions(-)

diff -puN arch/i386/kernel/smpboot.c~rollup arch/i386/kernel/smpboot.c
--- linux-2.6/arch/i386/kernel/smpboot.c~rollup	2003-11-15 23:46:34.000000000 +1100
+++ linux-2.6-npiggin/arch/i386/kernel/smpboot.c	2003-11-15 23:46:34.000000000 +1100
@@ -915,13 +915,13 @@ static void smp_tune_scheduling (void)
 		cacheflush_time = (cpu_khz>>10) * (cachesize<<10) / bandwidth;
 	}
 
-	cache_decay_ticks = (long)cacheflush_time/cpu_khz + 1;
+	cache_decay_ticks = (long)cacheflush_time/cpu_khz * HZ / 1000;
 
 	printk("per-CPU timeslice cutoff: %ld.%02ld usecs.\n",
 		(long)cacheflush_time/(cpu_khz/1000),
 		((long)cacheflush_time*100/(cpu_khz/1000)) % 100);
 	printk("task migration cache decay timeout: %ld msecs.\n",
-		cache_decay_ticks);
+		(cache_decay_ticks + 1) * 1000 / HZ);
 }
 
 /*
diff -puN fs/proc/array.c~rollup fs/proc/array.c
--- linux-2.6/fs/proc/array.c~rollup	2003-11-15 23:46:34.000000000 +1100
+++ linux-2.6-npiggin/fs/proc/array.c	2003-11-15 23:46:35.000000000 +1100
@@ -154,7 +154,9 @@ static inline char * task_state(struct t
 	read_lock(&tasklist_lock);
 	buffer += sprintf(buffer,
 		"State:\t%s\n"
-		"SleepAVG:\t%lu%%\n"
+		"sleep_avg:\t%lu\n"
+		"sleep_time:\t%lu\n"
+		"total_time:\t%lu\n"
 		"Tgid:\t%d\n"
 		"Pid:\t%d\n"
 		"PPid:\t%d\n"
@@ -162,8 +164,8 @@ static inline char * task_state(struct t
 		"Uid:\t%d\t%d\t%d\t%d\n"
 		"Gid:\t%d\t%d\t%d\t%d\n",
 		get_task_state(p),
-		(p->sleep_avg/1024)*100/(1000000000/1024),
-	       	p->tgid,
+		p->sleep_avg, p->sleep_time, p->total_time,
+		p->tgid,
 		p->pid, p->pid ? p->real_parent->pid : 0,
 		p->pid && p->ptrace ? p->parent->pid : 0,
 		p->uid, p->euid, p->suid, p->fsuid,
diff -puN include/linux/init_task.h~rollup include/linux/init_task.h
--- linux-2.6/include/linux/init_task.h~rollup	2003-11-15 23:46:34.000000000 +1100
+++ linux-2.6-npiggin/include/linux/init_task.h	2003-11-15 23:46:35.000000000 +1100
@@ -67,8 +67,8 @@
 	.usage		= ATOMIC_INIT(2),				\
 	.flags		= 0,						\
 	.lock_depth	= -1,						\
-	.prio		= MAX_PRIO-20,					\
-	.static_prio	= MAX_PRIO-20,					\
+	.prio		= MAX_PRIO-30,					\
+	.static_prio	= MAX_PRIO-30,					\
 	.policy		= SCHED_NORMAL,					\
 	.cpus_allowed	= CPU_MASK_ALL,					\
 	.mm		= NULL,						\
diff -puN include/linux/sched.h~rollup include/linux/sched.h
--- linux-2.6/include/linux/sched.h~rollup	2003-11-15 23:46:34.000000000 +1100
+++ linux-2.6-npiggin/include/linux/sched.h	2003-11-15 23:46:35.000000000 +1100
@@ -283,7 +283,7 @@ struct signal_struct {
 #define MAX_USER_RT_PRIO	100
 #define MAX_RT_PRIO		MAX_USER_RT_PRIO
 
-#define MAX_PRIO		(MAX_RT_PRIO + 40)
+#define MAX_PRIO		(MAX_RT_PRIO + 59)
 
 #define rt_task(p)		((p)->prio < MAX_RT_PRIO)
 
@@ -344,14 +344,17 @@ struct task_struct {
 	struct list_head run_list;
 	prio_array_t *array;
 
+	/* Scheduler variables follow. kernel/sched.c */
+	unsigned long array_sequence;
+	unsigned long timestamp;
+
+	unsigned long total_time, sleep_time;
 	unsigned long sleep_avg;
-	long interactive_credit;
-	unsigned long long timestamp;
-	int activated;
 
 	unsigned long policy;
 	cpumask_t cpus_allowed;
 	unsigned int time_slice, first_time_slice;
+	unsigned int used_slice;
 
 	struct list_head tasks;
 	struct list_head ptrace_children;
@@ -588,6 +591,7 @@ extern int FASTCALL(wake_up_process(stru
  static inline void kick_process(struct task_struct *tsk) { }
 #endif
 extern void FASTCALL(wake_up_forked_process(struct task_struct * tsk));
+extern void FASTCALL(sched_fork(task_t * p));
 extern void FASTCALL(sched_exit(task_t * p));
 
 asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struct rusage * ru);
diff -puN include/linux/topology.h~rollup include/linux/topology.h
--- linux-2.6/include/linux/topology.h~rollup	2003-11-15 23:46:34.000000000 +1100
+++ linux-2.6-npiggin/include/linux/topology.h	2003-11-15 23:46:35.000000000 +1100
@@ -54,4 +54,12 @@ static inline int __next_node_with_cpus(
 #define for_each_node_with_cpus(node) \
 	for (node = 0; node < numnodes; node = __next_node_with_cpus(node))
 
+#ifndef NUMA_FACTOR_BONUS
+/*
+ * High NUMA_FACTOR_BONUS means rare cross-node load balancing. The default
+ * value of 20 means node rebalance after 10 failed local balances,
+ * Should be tuned for each platform in asm/topology.h.
+ */
+#define NUMA_FACTOR_BONUS (HZ/50 ?: 1)
+#endif
 #endif /* _LINUX_TOPOLOGY_H */
diff -puN init/main.c~rollup init/main.c
--- linux-2.6/init/main.c~rollup	2003-11-15 23:46:34.000000000 +1100
+++ linux-2.6-npiggin/init/main.c	2003-11-15 23:46:35.000000000 +1100
@@ -549,7 +549,6 @@ static void do_pre_smp_initcalls(void)
 
 	migration_init();
 #endif
-	node_nr_running_init();
 	spawn_ksoftirqd();
 }
 
diff -puN kernel/fork.c~rollup kernel/fork.c
--- linux-2.6/kernel/fork.c~rollup	2003-11-15 23:46:34.000000000 +1100
+++ linux-2.6-npiggin/kernel/fork.c	2003-11-15 23:46:34.000000000 +1100
@@ -958,33 +958,9 @@ struct task_struct *copy_process(unsigne
 	p->exit_signal = (clone_flags & CLONE_THREAD) ? -1 : (clone_flags & CSIGNAL);
 	p->pdeath_signal = 0;
 
-	/*
-	 * Share the timeslice between parent and child, thus the
-	 * total amount of pending timeslices in the system doesn't change,
-	 * resulting in more scheduling fairness.
-	 */
-	local_irq_disable();
-        p->time_slice = (current->time_slice + 1) >> 1;
-	/*
-	 * The remainder of the first timeslice might be recovered by
-	 * the parent if the child exits early enough.
-	 */
-	p->first_time_slice = 1;
-	current->time_slice >>= 1;
-	p->timestamp = sched_clock();
-	if (!current->time_slice) {
-		/*
-	 	 * This case is rare, it happens when the parent has only
-	 	 * a single jiffy left from its timeslice. Taking the
-		 * runqueue lock is not a problem.
-		 */
-		current->time_slice = 1;
-		preempt_disable();
-		scheduler_tick(0, 0);
-		local_irq_enable();
-		preempt_enable();
-	} else
-		local_irq_enable();
+	/* Perform scheduler related accounting */
+	sched_fork(p);
+
 	/*
 	 * Ok, add it to the run-queues and make it
 	 * visible to the rest of the system.
diff -puN kernel/sched.c~rollup kernel/sched.c
--- linux-2.6/kernel/sched.c~rollup	2003-11-15 23:46:34.000000000 +1100
+++ linux-2.6-npiggin/kernel/sched.c	2003-11-15 23:46:35.000000000 +1100
@@ -14,7 +14,6 @@
  *		an array-switch method of distributing timeslices
  *		and per-CPU runqueues.  Cleanups and useful suggestions
  *		by Davide Libenzi, preemptible kernel bits by Robert Love.
- *  2003-09-03	Interactivity tuning by Con Kolivas.
  */
 
 #include <linux/mm.h>
@@ -49,8 +48,8 @@
  * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],
  * and back.
  */
-#define NICE_TO_PRIO(nice)	(MAX_RT_PRIO + (nice) + 20)
-#define PRIO_TO_NICE(prio)	((prio) - MAX_RT_PRIO - 20)
+#define NICE_TO_PRIO(nice)	(MAX_RT_PRIO + (nice) + 30)
+#define PRIO_TO_NICE(prio)	((prio) - MAX_RT_PRIO - 30)
 #define TASK_NICE(p)		PRIO_TO_NICE((p)->static_prio)
 
 /*
@@ -61,134 +60,71 @@
 #define USER_PRIO(p)		((p)-MAX_RT_PRIO)
 #define TASK_USER_PRIO(p)	USER_PRIO((p)->static_prio)
 #define MAX_USER_PRIO		(USER_PRIO(MAX_PRIO))
-#define AVG_TIMESLICE	(MIN_TIMESLICE + ((MAX_TIMESLICE - MIN_TIMESLICE) *\
-			(MAX_PRIO-1-NICE_TO_PRIO(0))/(MAX_USER_PRIO - 1)))
 
 /*
- * Some helpers for converting nanosecond timing to jiffy resolution
+ * MIN_TIMESLICE is the timeslice that a minimum priority process gets if there
+ * is a maximum priority process runnable. MAX_TIMESLICE is derived from the
+ * formula in task_timeslice. It cannot be changed here. It is the timesilce
+ * that the maximum priority process will get. Larger timeslices are attainable
+ * by low priority processes however.
  */
-#define NS_TO_JIFFIES(TIME)	((TIME) / (1000000000 / HZ))
-#define JIFFIES_TO_NS(TIME)	((TIME) * (1000000000 / HZ))
+#define MIN_TIMESLICE		(1000000 / 1000)
+#define MAX_TIMESLICE		(60 * MIN_TIMESLICE) /* do not change this */
+
+/* Maximum amount of history that will be used to calculate priority */
+#define MAX_SLEEP		(1000000 / 2)
 
 /*
- * These are the 'tuning knobs' of the scheduler:
- *
- * Minimum timeslice is 10 msecs, default timeslice is 100 msecs,
- * maximum timeslice is 200 msecs. Timeslices get refilled after
- * they expire.
+ * Maximum effect that 1 block of activity (run/sleep/etc) can have. This is
+ * will moderate dicard freak events (eg. SIGSTOP)
  */
-#define MIN_TIMESLICE		( 10 * HZ / 1000)
-#define MAX_TIMESLICE		(200 * HZ / 1000)
-#define ON_RUNQUEUE_WEIGHT	30
-#define CHILD_PENALTY		95
-#define PARENT_PENALTY		100
-#define EXIT_WEIGHT		3
-#define PRIO_BONUS_RATIO	25
-#define MAX_BONUS		(MAX_USER_PRIO * PRIO_BONUS_RATIO / 100)
-#define INTERACTIVE_DELTA	2
-#define MAX_SLEEP_AVG		(AVG_TIMESLICE * MAX_BONUS)
-#define STARVATION_LIMIT	(MAX_SLEEP_AVG)
-#define NS_MAX_SLEEP_AVG	(JIFFIES_TO_NS(MAX_SLEEP_AVG))
-#define NODE_THRESHOLD		125
-#define CREDIT_LIMIT		100
+#define MAX_SLEEP_AFFECT	(MAX_SLEEP/4)
+#define MAX_RUN_AFFECT		(MAX_SLEEP/4)
+#define MAX_WAIT_AFFECT		(MAX_RUN_AFFECT/2)
 
 /*
- * If a task is 'interactive' then we reinsert it in the active
- * array after it has expired its current timeslice. (it will not
- * continue to run immediately, it will still roundrobin with
- * other interactive tasks.)
- *
- * This part scales the interactivity limit depending on niceness.
- *
- * We scale it linearly, offset by the INTERACTIVE_DELTA delta.
- * Here are a few examples of different nice levels:
- *
- *  TASK_INTERACTIVE(-20): [1,1,1,1,1,1,1,1,1,0,0]
- *  TASK_INTERACTIVE(-10): [1,1,1,1,1,1,1,0,0,0,0]
- *  TASK_INTERACTIVE(  0): [1,1,1,1,0,0,0,0,0,0,0]
- *  TASK_INTERACTIVE( 10): [1,1,0,0,0,0,0,0,0,0,0]
- *  TASK_INTERACTIVE( 19): [0,0,0,0,0,0,0,0,0,0,0]
- *
- * (the X axis represents the possible -5 ... 0 ... +5 dynamic
- *  priority range a task can explore, a value of '1' means the
- *  task is rated interactive.)
- *
- * Ie. nice +19 tasks can never get 'interactive' enough to be
- * reinserted into the active array. And only heavily CPU-hog nice -20
- * tasks will be expired. Default nice 0 tasks are somewhere between,
- * it takes some effort for them to get interactive, but it's not
- * too hard.
+ * The amount of history can be decreased (on fork for example). This puts a
+ * lower bound on it.
  */
+#define MIN_HISTORY           (MAX_SLEEP/2)
 
-#define CURRENT_BONUS(p) \
-	(NS_TO_JIFFIES((p)->sleep_avg) * MAX_BONUS / \
-		MAX_SLEEP_AVG)
-
-#ifdef CONFIG_SMP
-#define TIMESLICE_GRANULARITY(p)	(MIN_TIMESLICE * \
-		(1 << (((MAX_BONUS - CURRENT_BONUS(p)) ? : 1) - 1)) * \
-			num_online_cpus())
-#else
-#define TIMESLICE_GRANULARITY(p)	(MIN_TIMESLICE * \
-		(1 << (((MAX_BONUS - CURRENT_BONUS(p)) ? : 1) - 1)))
-#endif
-
-#define SCALE(v1,v1_max,v2_max) \
-	(v1) * (v2_max) / (v1_max)
-
-#define DELTA(p) \
-	(SCALE(TASK_NICE(p), 40, MAX_USER_PRIO*PRIO_BONUS_RATIO/100) + \
-		INTERACTIVE_DELTA)
-
-#define TASK_INTERACTIVE(p) \
-	((p)->prio <= (p)->static_prio - DELTA(p))
-
-#define JUST_INTERACTIVE_SLEEP(p) \
-	(JIFFIES_TO_NS(MAX_SLEEP_AVG * \
-		(MAX_BONUS / 2 + DELTA((p)) + 1) / MAX_BONUS - 1))
-
-#define HIGH_CREDIT(p) \
-	((p)->interactive_credit > CREDIT_LIMIT)
+/*
+ * SLEEP_FACTOR is a fixed point factor used to scale history tracking things.
+ * In particular: total_time, sleep_time, sleep_avg.
+ */
 
-#define LOW_CREDIT(p) \
-	((p)->interactive_credit < -CREDIT_LIMIT)
+#define SLEEP_FACTOR		1024
 
-#define TASK_PREEMPTS_CURR(p, rq) \
-	((p)->prio < (rq)->curr->prio)
+#define CPU_BALANCE_THRESHOLD	125
+#define NODE_BALANCE_THRESHOLD	125
 
 /*
- * BASE_TIMESLICE scales user-nice values [ -20 ... 19 ]
- * to time slice values.
- *
- * The higher a thread's priority, the bigger timeslices
- * it gets during one round of execution. But even the lowest
- * priority thread gets MIN_TIMESLICE worth of execution time.
- *
- * task_timeslice() is the interface that is used by the scheduler.
+ * The scheduler classifies a process as performing one of the following
+ * activities
  */
+#define STIME_SLEEP		1	/* Sleeping */
+#define STIME_RUN		2	/* Using CPU */
+#define STIME_WAIT		3	/* Waiting for CPU */
 
-#define BASE_TIMESLICE(p) (MIN_TIMESLICE + \
-	((MAX_TIMESLICE - MIN_TIMESLICE) * (MAX_PRIO-1-(p)->static_prio)/(MAX_USER_PRIO - 1)))
-
-static inline unsigned int task_timeslice(task_t *p)
-{
-	return BASE_TIMESLICE(p);
-}
+#define TASK_PREEMPTS_CURR(p, rq)		\
+	( (p)->prio < (rq)->curr->prio )
 
 /*
  * These are the runqueue data structures:
  */
 
-#define BITMAP_SIZE ((((MAX_PRIO+1+7)/8)+sizeof(long)-1)/sizeof(long))
+#define BITMAP_SIZE ((((MAX_PRIO+7)/8)+sizeof(long)-1)/sizeof(long))
 
 typedef struct runqueue runqueue_t;
 
 struct prio_array {
-	int nr_active;
+	unsigned int nr_active;
 	unsigned long bitmap[BITMAP_SIZE];
 	struct list_head queue[MAX_PRIO];
 };
 
+#define FPT	128	/* fixed point factor */
+
 /*
  * This is the main, per-CPU runqueue data structure.
  *
@@ -198,20 +134,24 @@ struct prio_array {
  */
 struct runqueue {
 	spinlock_t lock;
-	unsigned long nr_running, nr_switches, expired_timestamp,
-			nr_uninterruptible;
+	unsigned long array_sequence;
+	unsigned long nr_running, nr_switches, nr_uninterruptible;
 	task_t *curr, *idle;
 	struct mm_struct *prev_mm;
 	prio_array_t *active, *expired, arrays[2];
-	int prev_cpu_load[NR_CPUS];
-#ifdef CONFIG_NUMA
-	atomic_t *node_nr_running;
-	int prev_node_load[MAX_NUMNODES];
-#endif
+
 	task_t *migration_thread;
 	struct list_head migration_queue;
 
 	atomic_t nr_iowait;
+
+#ifdef CONFIG_SMP
+	unsigned long nr_lb_failed;
+	unsigned long cpu_load[NR_CPUS];
+#endif
+#ifdef CONFIG_NUMA
+	unsigned long nr_exec;
+#endif
 };
 
 static DEFINE_PER_CPU(struct runqueue, runqueues);
@@ -230,51 +170,32 @@ static DEFINE_PER_CPU(struct runqueue, r
 # define task_running(rq, p)		((rq)->curr == (p))
 #endif
 
-#ifdef CONFIG_NUMA
-
 /*
  * Keep track of running tasks.
  */
 
-static atomic_t node_nr_running[MAX_NUMNODES] ____cacheline_maxaligned_in_smp =
-	{[0 ...MAX_NUMNODES-1] = ATOMIC_INIT(0)};
-
-static inline void nr_running_init(struct runqueue *rq)
+static inline void nr_running_init(int cpu)
 {
-	rq->node_nr_running = &node_nr_running[0];
 }
 
 static inline void nr_running_inc(runqueue_t *rq)
 {
-	atomic_inc(rq->node_nr_running);
 	rq->nr_running++;
 }
 
 static inline void nr_running_dec(runqueue_t *rq)
 {
-	atomic_dec(rq->node_nr_running);
 	rq->nr_running--;
 }
 
-__init void node_nr_running_init(void)
+#define US_TO_JIFFIES(x)	(x * HZ / 1000000)
+static inline unsigned long clock_us(void)
 {
-	int i;
-
-	for (i = 0; i < NR_CPUS; i++) {
-		if (cpu_possible(i))
-			cpu_rq(i)->node_nr_running =
-				&node_nr_running[cpu_to_node(i)];
-	}
+	unsigned long long ns = sched_clock();
+	do_div(ns, 1000UL);
+	return ns;
 }
 
-#else /* !CONFIG_NUMA */
-
-# define nr_running_init(rq)   do { } while (0)
-# define nr_running_inc(rq)    do { (rq)->nr_running++; } while (0)
-# define nr_running_dec(rq)    do { (rq)->nr_running--; } while (0)
-
-#endif /* CONFIG_NUMA */
-
 /*
  * task_rq_lock - lock the runqueue a given task resides on and disable
  * interrupts.  Note the ordering: we can safely lookup the task_rq without
@@ -339,36 +260,121 @@ static inline void enqueue_task(struct t
 }
 
 /*
- * effective_prio - return the priority that is based on the static
- * priority but is modified by bonuses/penalties.
- *
- * We scale the actual sleep average [0 .... MAX_SLEEP_AVG]
- * into the -5 ... 0 ... +5 bonus/penalty range.
- *
- * We use 25% of the full 0...39 priority range so that:
- *
- * 1) nice +19 interactive tasks do not preempt nice 0 CPU hogs.
- * 2) nice -20 CPU hogs do not get preempted by nice 0 tasks.
+ * add_task_time updates a task @p after @time of doing the specified @type
+ * of activity. See STIME_*. This is used for priority calculation.
+ */
+
+static inline void add_task_time(task_t *p, unsigned long time, unsigned long type)
+{
+	unsigned long ratio;
+	unsigned long max_affect;
+	unsigned long long tmp;
+
+	if (time == 0)
+		return;
+
+	if (type == STIME_SLEEP)
+		max_affect = MAX_SLEEP_AFFECT;
+	else if (type == STIME_RUN)
+		max_affect = MAX_RUN_AFFECT;
+	else
+		max_affect = MAX_WAIT_AFFECT;
+
+	if (time > max_affect)
+		time = max_affect;
+
+	ratio = MAX_SLEEP - time;
+	tmp = (unsigned long long)ratio*p->total_time + MAX_SLEEP/2;
+	do_div(tmp, MAX_SLEEP);
+	p->total_time = tmp;
+
+	tmp = (unsigned long long)ratio*p->sleep_time + MAX_SLEEP/2;
+	do_div(tmp, MAX_SLEEP);
+	p->sleep_time = tmp;
+
+	if (type != STIME_WAIT) {
+		p->total_time += time;
+		if (type == STIME_SLEEP)
+			p->sleep_time += time;
+
+		p->sleep_avg = (SLEEP_FACTOR * p->sleep_time) / p->total_time;
+	}
+
+	if (p->total_time < MIN_HISTORY) {
+		p->total_time = MIN_HISTORY;
+		p->sleep_time = p->total_time * p->sleep_avg / SLEEP_FACTOR;
+	}
+}
+
+/*
+ * The higher a thread's priority, the bigger timeslices
+ * it gets during one round of execution. But even the lowest
+ * priority thread gets MIN_TIMESLICE worth of execution time.
  *
- * Both properties are important to certain workloads.
+ * Timeslices are scaled, so if only low priority processes are running,
+ * they will all get long timeslices.
  */
-static int effective_prio(task_t *p)
+static unsigned int task_timeslice(task_t *p, runqueue_t *rq)
 {
-	int bonus, prio;
+	int idx, delta;
+	unsigned int base, timeslice;
+
+	if (unlikely(rt_task(p)))
+		return MAX_TIMESLICE;
+
+	idx = min(find_next_bit(rq->active->bitmap, MAX_PRIO, MAX_RT_PRIO),
+		find_next_bit(rq->expired->bitmap, MAX_PRIO, MAX_RT_PRIO));
+	idx = min(idx, p->prio);
+	delta = p->prio - idx;
+
+	/*
+	 * This is a bit subtle. The first line establishes a timeslice based
+	 * on how far this task is from being the highest priority runnable.
+	 * The second line scales this result so low priority tasks will get
+	 * big timeslices if higher priority ones are not running.
+	 */
+	base = MIN_TIMESLICE * (MAX_USER_PRIO + 1) / (delta + 2);
+	timeslice = base * (USER_PRIO(idx) + 8) / 24;
+
+	if (timeslice <= MIN_TIMESLICE)
+		timeslice = MIN_TIMESLICE;
+
+	return timeslice;
+}
+
+/*
+ * task_priority: calculates a task's priority based on previous running
+ * history (see add_task_time). The priority is just a simple linear function
+ * based on sleep_avg and static_prio.
+ */
+static unsigned long task_priority(task_t *p)
+{
+	unsigned int bonus, prio;
 
 	if (rt_task(p))
 		return p->prio;
 
-	bonus = CURRENT_BONUS(p) - MAX_BONUS / 2;
+	bonus = ((MAX_USER_PRIO / 3) * p->sleep_avg + (SLEEP_FACTOR / 2)) / SLEEP_FACTOR;
+	prio = USER_PRIO(p->static_prio) + 10;
+
+	prio = MAX_RT_PRIO + prio - bonus;
 
-	prio = p->static_prio - bonus;
 	if (prio < MAX_RT_PRIO)
 		prio = MAX_RT_PRIO;
 	if (prio > MAX_PRIO-1)
 		prio = MAX_PRIO-1;
+
 	return prio;
 }
 
+static inline int task_expired(task_t *p, runqueue_t *rq)
+{
+	unsigned long used = p->used_slice + (clock_us() - p->timestamp);
+	if (used >= task_timeslice(p, rq))
+		return 1;
+
+	return 0;
+}
 /*
  * __activate_task - move a task to the runqueue.
  */
@@ -378,82 +384,6 @@ static inline void __activate_task(task_
 	nr_running_inc(rq);
 }
 
-static void recalc_task_prio(task_t *p, unsigned long long now)
-{
-	unsigned long long __sleep_time = now - p->timestamp;
-	unsigned long sleep_time;
-
-	if (__sleep_time > NS_MAX_SLEEP_AVG)
-		sleep_time = NS_MAX_SLEEP_AVG;
-	else
-		sleep_time = (unsigned long)__sleep_time;
-
-	if (likely(sleep_time > 0)) {
-		/*
-		 * User tasks that sleep a long time are categorised as
-		 * idle and will get just interactive status to stay active &
-		 * prevent them suddenly becoming cpu hogs and starving
-		 * other processes.
-		 */
-		if (p->mm && p->activated != -1 &&
-			sleep_time > JUST_INTERACTIVE_SLEEP(p)){
-				p->sleep_avg = JIFFIES_TO_NS(MAX_SLEEP_AVG -
-						AVG_TIMESLICE);
-				if (!HIGH_CREDIT(p))
-					p->interactive_credit++;
-		} else {
-			/*
-			 * The lower the sleep avg a task has the more
-			 * rapidly it will rise with sleep time.
-			 */
-			sleep_time *= (MAX_BONUS - CURRENT_BONUS(p)) ? : 1;
-
-			/*
-			 * Tasks with low interactive_credit are limited to
-			 * one timeslice worth of sleep avg bonus.
-			 */
-			if (LOW_CREDIT(p) &&
-				sleep_time > JIFFIES_TO_NS(task_timeslice(p)))
-					sleep_time =
-						JIFFIES_TO_NS(task_timeslice(p));
-
-			/*
-			 * Non high_credit tasks waking from uninterruptible
-			 * sleep are limited in their sleep_avg rise as they
-			 * are likely to be cpu hogs waiting on I/O
-			 */
-			if (p->activated == -1 && !HIGH_CREDIT(p) && p->mm){
-				if (p->sleep_avg >= JUST_INTERACTIVE_SLEEP(p))
-					sleep_time = 0;
-				else if (p->sleep_avg + sleep_time >=
-					JUST_INTERACTIVE_SLEEP(p)){
-						p->sleep_avg =
-							JUST_INTERACTIVE_SLEEP(p);
-						sleep_time = 0;
-					}
-			}
-
-			/*
-			 * This code gives a bonus to interactive tasks.
-			 *
-			 * The boost works by updating the 'average sleep time'
-			 * value here, based on ->timestamp. The more time a task
-			 * spends sleeping, the higher the average gets - and the
-			 * higher the priority boost gets as well.
-			 */
-			p->sleep_avg += sleep_time;
-
-			if (p->sleep_avg > NS_MAX_SLEEP_AVG){
-				p->sleep_avg = NS_MAX_SLEEP_AVG;
-				if (!HIGH_CREDIT(p))
-					p->interactive_credit++;
-			}
-		}
-	}
-
-	p->prio = effective_prio(p);
-}
-
 /*
  * activate_task - move a task to the runqueue and do priority recalculation
  *
@@ -462,32 +392,26 @@ static void recalc_task_prio(task_t *p, 
  */
 static inline void activate_task(task_t *p, runqueue_t *rq)
 {
-	unsigned long long now = sched_clock();
+	unsigned long now = clock_us();
+	unsigned long sleep = now - p->timestamp;
+	p->timestamp = now;
+
+	add_task_time(p, sleep, STIME_SLEEP);
 
-	recalc_task_prio(p, now);
+	p->prio = task_priority(p);
 
 	/*
-	 * This checks to make sure it's not an uninterruptible task
-	 * that is now waking up.
+	 * If we have slept through an active/expired array switch, restart
+	 * our timeslice too.
 	 */
-	if (!p->activated){
-		/*
-		 * Tasks which were woken up by interrupts (ie. hw events)
-		 * are most likely of interactive nature. So we give them
-		 * the credit of extending their sleep time to the period
-		 * of time they spend on the runqueue, waiting for execution
-		 * on a CPU, first time around:
-		 */
-		if (in_interrupt())
-			p->activated = 2;
-		else
-		/*
-		 * Normal first-time wakeups get a credit too for on-runqueue
-		 * time, but it will be weighted down:
-		 */
-			p->activated = 1;
-		}
-	p->timestamp = now;
+	if (rq->array_sequence != p->array_sequence) {
+		p->first_time_slice = 0;
+		p->used_slice = 0;
+	} else if (p->used_slice >= task_timeslice(p, rq)) {
+		enqueue_task(p, rq->expired);
+		nr_running_inc(rq);
+		return;
+	}
 
 	__activate_task(p, rq);
 }
@@ -497,6 +421,7 @@ static inline void activate_task(task_t 
  */
 static inline void deactivate_task(struct task_struct *p, runqueue_t *rq)
 {
+	p->array_sequence = rq->array_sequence;
 	nr_running_dec(rq);
 	if (p->state == TASK_UNINTERRUPTIBLE)
 		rq->nr_uninterruptible++;
@@ -638,18 +563,10 @@ repeat_lock_task:
 				task_rq_unlock(rq, &flags);
 				goto repeat_lock_task;
 			}
-			if (old_state == TASK_UNINTERRUPTIBLE){
+			if (old_state == TASK_UNINTERRUPTIBLE)
 				rq->nr_uninterruptible--;
-				/*
-				 * Tasks on involuntary sleep don't earn
-				 * sleep_avg beyond just interactive state.
-				 */
-				p->activated = -1;
-			}
-			if (sync && (task_cpu(p) == smp_processor_id()))
-				__activate_task(p, rq);
-			else {
-				activate_task(p, rq);
+			activate_task(p, rq);
+			if (!sync) {
 				if (TASK_PREEMPTS_CURR(p, rq))
 					resched_task(rq->curr);
 			}
@@ -674,42 +591,94 @@ int wake_up_state(task_t *p, unsigned in
 }
 
 /*
+ * Perform scheduler related accounting for a newly forked process @p.
+ * @p is forked by current.
+ */
+void sched_fork(task_t *p)
+{
+	unsigned long ts, left;
+	unsigned long flags;
+	runqueue_t *rq;
+
+	/*
+	 * Share the timeslice between parent and child, thus the
+	 * total amount of pending timeslices in the system doesn't change,
+	 * resulting in more scheduling fairness.
+	 */
+	local_irq_disable();
+	p->timestamp = clock_us();
+	rq = task_rq_lock(current, &flags);
+	ts = task_timeslice(current, rq);
+	task_rq_unlock(rq, &flags);
+
+	/*
+	 * Share half our timeslice with the child.
+	 */
+	left = (current->used_slice + (clock_us() - current->timestamp));
+	if (left > ts)
+		left = 0;
+	else
+		left = ts - left;
+	p->used_slice = left / 2;
+	current->used_slice += (left + 1) / 2;
+
+	/*
+	 * The remainder of the first timeslice might be recovered by
+	 * the parent if the child exits early enough.
+	 */
+	p->first_time_slice = 1;
+	if (unlikely(current->used_slice >= ts)) {
+		/*
+	 	 * This case is rare, it happens when the parent has only
+	 	 * a single jiffy left from its timeslice. Taking the
+		 * runqueue lock is not a problem.
+		 */
+		preempt_disable();
+		scheduler_tick(0, 0);
+		local_irq_enable();
+		preempt_enable();
+	} else
+		local_irq_enable();
+}
+
+/*
  * wake_up_forked_process - wake up a freshly forked process.
  *
  * This function will do some initial scheduler statistics housekeeping
  * that must be done for every newly created process.
  */
-void wake_up_forked_process(task_t * p)
+void wake_up_forked_process(task_t *p)
 {
 	unsigned long flags;
 	runqueue_t *rq = task_rq_lock(current, &flags);
 
 	p->state = TASK_RUNNING;
+
+	set_task_cpu(p, smp_processor_id());
+
 	/*
-	 * We decrease the sleep average of forking parents
-	 * and children as well, to keep max-interactive tasks
-	 * from forking tasks that are max-interactive.
+	 * Get only 1/10th of the parents history. Limited by MIN_HISTORY.
 	 */
-	current->sleep_avg = JIFFIES_TO_NS(CURRENT_BONUS(current) *
-		PARENT_PENALTY / 100 * MAX_SLEEP_AVG / MAX_BONUS);
+	p->total_time = current->total_time / 4;
+	p->sleep_time = current->sleep_time / 4;
+	p->sleep_avg = current->sleep_avg;
 
-	p->sleep_avg = JIFFIES_TO_NS(CURRENT_BONUS(p) *
-		CHILD_PENALTY / 100 * MAX_SLEEP_AVG / MAX_BONUS);
+	if (p->total_time < MIN_HISTORY) {
+		p->total_time = MIN_HISTORY;
+		p->sleep_time = p->total_time * p->sleep_avg / SLEEP_FACTOR;
+	}
 
-	p->interactive_credit = 0;
+	/*
+	 * Lose 1/4 sleep_time for forking.
+	 */
+	current->sleep_time = 3 * current->sleep_time / 4;
+	if (current->total_time != 0)
+		current->sleep_avg = (SLEEP_FACTOR * current->sleep_time)
+						/ current->total_time;
 
-	p->prio = effective_prio(p);
-	set_task_cpu(p, smp_processor_id());
+	p->prio = task_priority(p);
+	__activate_task(p, rq);
 
-	if (unlikely(!current->array))
-		__activate_task(p, rq);
-	else {
-		p->prio = current->prio;
-		list_add_tail(&p->run_list, &current->run_list);
-		p->array = current->array;
-		p->array->nr_active++;
-		nr_running_inc(rq);
-	}
 	task_rq_unlock(rq, &flags);
 }
 
@@ -727,20 +696,28 @@ void sched_exit(task_t * p)
 	unsigned long flags;
 
 	local_irq_save(flags);
+
+	/* Regain the unused timeslice given to @p by its parent */
 	if (p->first_time_slice) {
-		p->parent->time_slice += p->time_slice;
-		if (unlikely(p->parent->time_slice > MAX_TIMESLICE))
-			p->parent->time_slice = MAX_TIMESLICE;
+		unsigned long ts;
+		unsigned long flags;
+		runqueue_t *rq;
+		rq = task_rq_lock(p, &flags);
+		ts = task_timeslice(p, rq);
+		if (ts > p->used_slice)
+			p->parent->used_slice -= ts - p->used_slice;
+		task_rq_unlock(rq, &flags);
 	}
+
+	/* Apply some penalty to @p's parent if @p used a lot of CPU */
+	if (p->sleep_avg < p->parent->sleep_avg) {
+		add_task_time(p->parent,
+			MAX_SLEEP * (p->parent->sleep_avg - p->sleep_avg)
+			/ SLEEP_FACTOR / 2,
+			STIME_RUN);
+	}
+
 	local_irq_restore(flags);
-	/*
-	 * If the child was a (relative-) CPU hog then decrease
-	 * the sleep_avg of the parent as well.
-	 */
-	if (p->sleep_avg < p->parent->sleep_avg)
-		p->parent->sleep_avg = p->parent->sleep_avg /
-		(EXIT_WEIGHT + 1) * EXIT_WEIGHT + p->sleep_avg /
-		(EXIT_WEIGHT + 1);
 }
 
 /**
@@ -910,8 +887,158 @@ static inline void double_rq_unlock(runq
 		spin_unlock(&rq2->lock);
 }
 
+#ifdef CONFIG_SMP
+static inline unsigned long get_cpu_load(int cpu)
+{
+	runqueue_t *rq = cpu_rq(cpu);
+	runqueue_t *this_rq = this_rq();
+	unsigned long nr = FPT * rq->nr_running, load = this_rq->cpu_load[cpu];
+	unsigned long ret = (nr + load) / 2;
+
+	this_rq->cpu_load[cpu] = ret;
+
+	return ret;
+}
+
+static inline unsigned long __get_low_cpu_load(int cpu)
+{
+	runqueue_t *rq = cpu_rq(cpu);
+	runqueue_t *this_rq = this_rq();
+	unsigned long nr = FPT * rq->nr_running, load = this_rq->cpu_load[cpu];
+	return min(nr, load);
+}
+
+static inline unsigned long __get_high_cpu_load(int cpu)
+{
+	runqueue_t *rq = cpu_rq(cpu);
+	runqueue_t *this_rq = this_rq();
+	unsigned long nr = FPT * rq->nr_running, load = this_rq->cpu_load[cpu];
+	return max(nr, load);
+}
+
+static inline unsigned long get_low_cpu_load(int cpu)
+{
+	runqueue_t *rq = cpu_rq(cpu);
+	runqueue_t *this_rq = this_rq();
+	unsigned long nr = FPT * rq->nr_running, load = this_rq->cpu_load[cpu];
+	unsigned long ret = min(nr, load);
+
+	this_rq->cpu_load[cpu] = (nr + load) / 2;
+
+	return ret;
+}
+
+static inline unsigned long get_high_cpu_load(int cpu)
+{
+	runqueue_t *rq = cpu_rq(cpu);
+	runqueue_t *this_rq = this_rq();
+	unsigned long nr = FPT * rq->nr_running, load = this_rq->cpu_load[cpu];
+	unsigned long ret = max(nr, load);
+
+	this_rq->cpu_load[cpu] = (nr + load) / 2;
+
+	return ret;
+}
+#endif
+
 #ifdef CONFIG_NUMA
 /*
+ * Find the busiest node.
+ */
+static int find_busiest_node(int this_node, unsigned long *imbalance)
+{
+	unsigned long node_loads[MAX_NUMNODES];
+	unsigned long nr_nodes = 0, avg_load = 0, max_load = 0;
+	int i, node = -1;
+
+	if (!nr_cpus_node(this_node))
+		return node;
+
+	for_each_node_with_cpus(i)
+		node_loads[i] = 0;
+
+	for (i = 0; i < NR_CPUS; i++) {
+		int n;
+		if (!cpu_online(i))
+			continue;
+
+		n = cpu_to_node(i);
+		if (n == this_node)
+			node_loads[n] += get_cpu_load(i);
+		else
+			node_loads[n] += get_low_cpu_load(i);
+	}
+
+	for_each_node_with_cpus(i) {
+		node_loads[i] /= nr_cpus_node(i);
+		nr_nodes++;
+		avg_load += node_loads[i];
+
+		if (i == this_node)
+			continue;
+
+		if (max_load < node_loads[i]) {
+			max_load = node_loads[i];
+			node = i;
+		}
+	}
+	avg_load /= nr_nodes;
+
+	if (node_loads[this_node] >= avg_load ||
+		100*max_load <= NODE_BALANCE_THRESHOLD*node_loads[this_node])
+		return -1;
+
+	*imbalance = min(max_load - avg_load, avg_load - node_loads[this_node]);
+	if (*imbalance < 1*FPT && (max_load - node_loads[this_node]) > 1*FPT)
+		*imbalance = 1*FPT * min(nr_cpus_node(node),
+						nr_cpus_node(this_node));
+	else
+		*imbalance = min((max_load - avg_load) * nr_cpus_node(node),
+				(avg_load - node_loads[this_node])
+						* nr_cpus_node(this_node) );
+	*imbalance = (*imbalance + FPT/2) / FPT;
+
+	return node;
+}
+
+/*
+ * Find the least busy node.
+ */
+static int find_best_node(int this_node)
+{
+	unsigned long node_loads[MAX_NUMNODES];
+	unsigned long min_load = INT_MAX;
+	int i, node = this_node;
+
+	for_each_node_with_cpus(i)
+		node_loads[i] = 0;
+
+	for (i = 0; i < NR_CPUS; i++) {
+		int n;
+		if (!cpu_online(i))
+			continue;
+
+		n = cpu_to_node(i);
+		if (n == this_node)
+			node_loads[n] += get_cpu_load(i);
+		else
+			node_loads[n] += get_low_cpu_load(i);
+	}
+
+	for_each_node_with_cpus(i) {
+		node_loads[i] /= nr_cpus_node(i);
+
+		if (min_load > node_loads[i] + NODE_BALANCE_THRESHOLD*FPT/100 ||
+				(min_load > node_loads[i] && i == this_node)) {
+			min_load = node_loads[i];
+			node = i;
+		}
+	}
+
+	return node;
+}
+
+/*
  * If dest_cpu is allowed for this process, migrate the task to it.
  * This is accomplished by forcing the cpu_allowed mask to only
  * allow dest_cpu, which will force the cpu onto dest_cpu.  Then
@@ -937,88 +1064,47 @@ static void sched_migrate_task(task_t *p
  */
 static int sched_best_cpu(struct task_struct *p)
 {
-	int i, minload, load, best_cpu, node = 0;
+	int i, min_load,  best_cpu = task_cpu(p), node;
 	cpumask_t cpumask;
 
-	best_cpu = task_cpu(p);
-	if (cpu_rq(best_cpu)->nr_running <= 2)
-		return best_cpu;
-
-	minload = 10000000;
-	for_each_node_with_cpus(i) {
-		/*
-		 * Node load is always divided by nr_cpus_node to normalise 
-		 * load values in case cpu count differs from node to node.
-		 * We first multiply node_nr_running by 10 to get a little
-		 * better resolution.   
-		 */
-		load = 10 * atomic_read(&node_nr_running[i]) / nr_cpus_node(i);
-		if (load < minload) {
-			minload = load;
-			node = i;
-		}
-	}
+	node = find_best_node(cpu_to_node(task_cpu(p)));
 
-	minload = 10000000;
+	min_load = INT_MAX;
 	cpumask = node_to_cpumask(node);
-	for (i = 0; i < NR_CPUS; ++i) {
+	for (i = 0; i < NR_CPUS; i++) {
+		unsigned long load;
 		if (!cpu_isset(i, cpumask))
 			continue;
-		if (cpu_rq(i)->nr_running < minload) {
+		if (i == task_cpu(p))
+			load = get_low_cpu_load(i);
+		else
+			load = get_high_cpu_load(i) + FPT;
+		if (min_load > load) {
 			best_cpu = i;
-			minload = cpu_rq(i)->nr_running;
+			min_load = load;
 		}
 	}
 	return best_cpu;
 }
 
+#define EXEC_BALANCE_INTERVAL 8
 void sched_balance_exec(void)
 {
 	int new_cpu;
 
 	if (numnodes > 1) {
-		new_cpu = sched_best_cpu(current);
-		if (new_cpu != smp_processor_id())
-			sched_migrate_task(current, new_cpu);
-	}
-}
-
-/*
- * Find the busiest node. All previous node loads contribute with a
- * geometrically deccaying weight to the load measure:
- *      load_{t} = load_{t-1}/2 + nr_node_running_{t}
- * This way sudden load peaks are flattened out a bit.
- * Node load is divided by nr_cpus_node() in order to compare nodes
- * of different cpu count but also [first] multiplied by 10 to 
- * provide better resolution.
- */
-static int find_busiest_node(int this_node)
-{
-	int i, node = -1, load, this_load, maxload;
-
-	if (!nr_cpus_node(this_node))
-		return node;
-	this_load = maxload = (this_rq()->prev_node_load[this_node] >> 1)
-		+ (10 * atomic_read(&node_nr_running[this_node])
-		/ nr_cpus_node(this_node));
-	this_rq()->prev_node_load[this_node] = this_load;
-	for_each_node_with_cpus(i) {
-		if (i == this_node)
-			continue;
-		load = (this_rq()->prev_node_load[i] >> 1)
-			+ (10 * atomic_read(&node_nr_running[i])
-			/ nr_cpus_node(i));
-		this_rq()->prev_node_load[i] = load;
-		if (load > maxload && (100*load > NODE_THRESHOLD*this_load)) {
-			maxload = load;
-			node = i;
+		int this_cpu = smp_processor_id();
+		runqueue_t *this_rq = cpu_rq(this_cpu);
+		this_rq->nr_exec++;
+		if (unlikely(!(this_rq->nr_exec % EXEC_BALANCE_INTERVAL))) {
+			new_cpu = sched_best_cpu(current);
+			if (new_cpu != this_cpu)
+				sched_migrate_task(current, new_cpu);
 		}
 	}
-	return node;
 }
 
-#endif /* CONFIG_NUMA */
-
+#endif
 #ifdef CONFIG_SMP
 
 /*
@@ -1027,31 +1113,28 @@ static int find_busiest_node(int this_no
  * this_rq is locked already. Recalculate nr_running if we have to
  * drop the runqueue lock.
  */
-static inline unsigned int double_lock_balance(runqueue_t *this_rq,
-	runqueue_t *busiest, int this_cpu, int idle, unsigned int nr_running)
+static inline void double_lock_balance(runqueue_t *this_rq,
+				runqueue_t *busiest, int this_cpu)
 {
 	if (unlikely(!spin_trylock(&busiest->lock))) {
 		if (busiest < this_rq) {
 			spin_unlock(&this_rq->lock);
 			spin_lock(&busiest->lock);
 			spin_lock(&this_rq->lock);
-			/* Need to recalculate nr_running */
-			if (idle || (this_rq->nr_running > this_rq->prev_cpu_load[this_cpu]))
-				nr_running = this_rq->nr_running;
-			else
-				nr_running = this_rq->prev_cpu_load[this_cpu];
 		} else
 			spin_lock(&busiest->lock);
 	}
-	return nr_running;
 }
 
 /*
  * find_busiest_queue - find the busiest runqueue among the cpus in cpumask.
  */
-static inline runqueue_t *find_busiest_queue(runqueue_t *this_rq, int this_cpu, int idle, int *imbalance, cpumask_t cpumask)
+static inline runqueue_t *
+find_busiest_queue(runqueue_t *this_rq, int this_cpu, int idle,
+				unsigned long *imbalance, cpumask_t cpumask, int local)
 {
-	int nr_running, load, max_load, i;
+	unsigned long this_load, load, max_load, avg_load;
+	int nr_cpus, i;
 	runqueue_t *busiest, *rq_src;
 
 	/*
@@ -1077,49 +1160,80 @@ static inline runqueue_t *find_busiest_q
 	 * that case we are less picky about moving a task across CPUs and
 	 * take what can be taken.
 	 */
-	if (idle || (this_rq->nr_running > this_rq->prev_cpu_load[this_cpu]))
-		nr_running = this_rq->nr_running;
+
+	if (idle == 2)
+		this_load = __get_high_cpu_load(this_cpu);
 	else
-		nr_running = this_rq->prev_cpu_load[this_cpu];
+		this_load = get_high_cpu_load(this_cpu);
 
 	busiest = NULL;
-	max_load = 1;
+	max_load = this_load;
+	avg_load = this_load;
+	nr_cpus = 1;
+
+	if (idle)
+		max_load = 0;
+
 	for (i = 0; i < NR_CPUS; i++) {
 		if (!cpu_isset(i, cpumask))
 			continue;
 
+		if (i == this_cpu)
+			continue;
+
 		rq_src = cpu_rq(i);
-		if (idle || (rq_src->nr_running < this_rq->prev_cpu_load[i]))
-			load = rq_src->nr_running;
+		if (idle == 2)
+			load = __get_low_cpu_load(i);
 		else
-			load = this_rq->prev_cpu_load[i];
-		this_rq->prev_cpu_load[i] = rq_src->nr_running;
+			load = get_low_cpu_load(i);
+
+		nr_cpus++;
+		avg_load += load;
 
-		if ((load > max_load) && (rq_src != this_rq)) {
+		if (load > max_load && rq_src != this_rq) {
 			busiest = rq_src;
 			max_load = load;
 		}
 	}
 
 	if (likely(!busiest))
-		goto out;
+		goto out_balance;
 
-	*imbalance = max_load - nr_running;
+	avg_load /= nr_cpus;
+	if (!idle && this_load >= avg_load) {
+		busiest = NULL;
+		goto out_balance;
+	}
 
-	/* It needs an at least ~25% imbalance to trigger balancing. */
-	if (!idle && ((*imbalance)*4 < max_load)) {
+	if (!idle && 100*max_load <= CPU_BALANCE_THRESHOLD*this_load) {
 		busiest = NULL;
-		goto out;
+		goto out_balance;
 	}
 
-	nr_running = double_lock_balance(this_rq, busiest, this_cpu, idle, nr_running);
-	/*
-	 * Make sure nothing changed since we checked the
-	 * runqueue length.
-	 */
-	if (busiest->nr_running <= nr_running) {
+	double_lock_balance(this_rq, busiest, this_cpu);
+
+	if (busiest->nr_running <= 1) {
 		spin_unlock(&busiest->lock);
 		busiest = NULL;
+		if (local)
+			this_rq->nr_lb_failed++;
+		goto out;
+	}
+
+	*imbalance = min(max_load - avg_load, avg_load - this_load);
+	if ( (*imbalance < 1*FPT) && (max_load - this_load) > 1*FPT )
+		*imbalance = 1*FPT;
+	*imbalance = (*imbalance + FPT - 1) / FPT;
+
+	if (*imbalance == 0)
+		*imbalance = 1;
+
+out_balance:
+	if (local) {
+		if (idle)
+			this_rq->nr_lb_failed++;
+		else
+			this_rq->nr_lb_failed = 0;
 	}
 out:
 	return busiest;
@@ -1131,11 +1245,17 @@ out:
  */
 static inline void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t *p, runqueue_t *this_rq, int this_cpu)
 {
+	unsigned long now = clock_us();
+
 	dequeue_task(p, src_array);
 	nr_running_dec(src_rq);
 	set_task_cpu(p, this_cpu);
 	nr_running_inc(this_rq);
 	enqueue_task(p, this_rq->active);
+
+	add_task_time(p, now - p->timestamp, STIME_WAIT);
+	p->timestamp = now;
+
 	/*
 	 * Note that idle threads have a prio of MAX_PRIO, for this test
 	 * to be always true for them.
@@ -1144,26 +1264,35 @@ static inline void pull_task(runqueue_t 
 		set_need_resched();
 }
 
+#define CACHE_DECAY_US 5000
 /*
- * Previously:
- *
- * #define CAN_MIGRATE_TASK(p,rq,this_cpu)	\
- *	((!idle || (NS_TO_JIFFIES(now - (p)->timestamp) > \
- *		cache_decay_ticks)) && !task_running(rq, p) && \
- *			cpu_isset(this_cpu, (p)->cpus_allowed))
+ * can_migrate_task
+ * May task @p from runqueue @rq be migrated to @this_cpu?
+ * Returns: 1 if @p may be migrated, 0 otherwise.
  */
-
 static inline int
-can_migrate_task(task_t *tsk, runqueue_t *rq, int this_cpu, int idle)
+can_migrate_task(task_t *p, runqueue_t *rq, int this_cpu, int aggressive)
 {
-	unsigned long delta = sched_clock() - tsk->timestamp;
+	unsigned long delta;
 
-	if (!idle && (delta <= JIFFIES_TO_NS(cache_decay_ticks)))
-		return 0;
-	if (task_running(rq, tsk))
+	/*
+	 * We do not migrate tasks that are:
+	 * 1) running (obviously), or
+	 * 2) cannot be migrated to this CPU due to cpus_allowed, or
+	 * 3) are cache-hot on their current CPU.
+	 */
+
+	if (task_running(rq, p))
 		return 0;
-	if (!cpu_isset(this_cpu, tsk->cpus_allowed))
+
+	if (!cpu_isset(this_cpu, p->cpus_allowed))
 		return 0;
+
+	/* Aggressive migration if we've failed a balance */
+	delta = clock_us() - p->timestamp;
+	if (!aggressive && delta <= CACHE_DECAY_US)
+			return 0;
+
 	return 1;
 }
 
@@ -1175,23 +1304,19 @@ can_migrate_task(task_t *tsk, runqueue_t
  * We call this with the current runqueue locked,
  * irqs disabled.
  */
-static void load_balance(runqueue_t *this_rq, int idle, cpumask_t cpumask)
+static void load_balance(runqueue_t *this_rq, runqueue_t *busiest, unsigned long max_nr_move, int local)
 {
-	int imbalance, idx, this_cpu = smp_processor_id();
-	runqueue_t *busiest;
+	int aggressive = 0;
+	int idx, this_cpu = smp_processor_id();
+	int pulled = 0;
 	prio_array_t *array;
 	struct list_head *head, *curr;
 	task_t *tmp;
 
-	busiest = find_busiest_queue(this_rq, this_cpu, idle, &imbalance, cpumask);
-	if (!busiest)
-		goto out;
-
-	/*
-	 * We only want to steal a number of tasks equal to 1/2 the imbalance,
-	 * otherwise we'll just shift the imbalance to the new queue:
-	 */
-	imbalance /= 2;
+	if (max_nr_move <= 0) {
+		spin_unlock(&busiest->lock);
+		return;
+	}
 
 	/*
 	 * We first consider expired tasks. Those will likely not be
@@ -1199,6 +1324,7 @@ static void load_balance(runqueue_t *thi
 	 * be cache-cold, thus switching CPUs has the least effect
 	 * on them.
 	 */
+again:
 	if (busiest->expired->nr_active)
 		array = busiest->expired;
 	else
@@ -1217,6 +1343,10 @@ skip_bitmap:
 			array = busiest->active;
 			goto new_array;
 		}
+		if (!aggressive) {
+			aggressive = 1;
+			goto again;
+		}
 		goto out_unlock;
 	}
 
@@ -1225,23 +1355,23 @@ skip_bitmap:
 skip_queue:
 	tmp = list_entry(curr, task_t, run_list);
 
-	/*
-	 * We do not migrate tasks that are:
-	 * 1) running (obviously), or
-	 * 2) cannot be migrated to this CPU due to cpus_allowed, or
-	 * 3) are cache-hot on their current CPU.
-	 */
-
 	curr = curr->prev;
 
-	if (!can_migrate_task(tmp, busiest, this_cpu, idle)) {
+	if (!can_migrate_task(tmp, busiest, this_cpu, aggressive)) {
 		if (curr != head)
 			goto skip_queue;
 		idx++;
 		goto skip_bitmap;
 	}
 	pull_task(busiest, array, tmp, this_rq, this_cpu);
-	if (!idle && --imbalance) {
+	pulled++;
+
+	/*
+	 * We only want to steal a number of tasks equal to 1/2 the imbalance,
+	 * otherwise we'll just shift the imbalance to the new queue.
+	 * Only migrate 1 task if we're idle.
+	 */
+	if (pulled < max_nr_move) {
 		if (curr != head)
 			goto skip_queue;
 		idx++;
@@ -1249,10 +1379,40 @@ skip_queue:
 	}
 out_unlock:
 	spin_unlock(&busiest->lock);
-out:
-	;
+
+	if (local) {
+		if(pulled == 0)
+			this_rq->nr_lb_failed++;
+		else
+			this_rq->nr_lb_failed = 0;
+	}
 }
 
+#ifdef CONFIG_NUMA
+static void node_balance(int this_cpu, runqueue_t *this_rq, unsigned long max_nr_move)
+{
+	unsigned long nr_move;
+	runqueue_t *busiest;
+	cpumask_t cpumask;
+	unsigned long imbalance;
+	int node = find_busiest_node(cpu_to_node(this_cpu), &imbalance);
+	nr_move = min(imbalance, max_nr_move);
+
+	if (node >= 0 && nr_move > 0) {
+		cpumask = node_to_cpumask(node);
+		spin_lock(&this_rq->lock);
+		busiest = find_busiest_queue(this_rq, this_cpu, 0,
+						&imbalance, cpumask, 0);
+		if (busiest) {
+			nr_move = min(nr_move, imbalance);
+			load_balance(this_rq, busiest, nr_move, 0);
+		}
+
+		spin_unlock(&this_rq->lock);
+	}
+}
+#endif
+
 /*
  * One of the idle_cpu_tick() and busy_cpu_tick() functions will
  * get called every timer tick, on every CPU. Our balancing action
@@ -1264,31 +1424,17 @@ out:
  *
  * On NUMA, do a node-rebalance every 400 msecs.
  */
-#define IDLE_REBALANCE_TICK (HZ/1000 ?: 1)
-#define BUSY_REBALANCE_TICK (HZ/5 ?: 1)
-#define IDLE_NODE_REBALANCE_TICK (IDLE_REBALANCE_TICK * 5)
-#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 2)
-
-#ifdef CONFIG_NUMA
-static void balance_node(runqueue_t *this_rq, int idle, int this_cpu)
-{
-	int node = find_busiest_node(cpu_to_node(this_cpu));
-
-	if (node >= 0) {
-		cpumask_t cpumask = node_to_cpumask(node);
-		cpu_set(this_cpu, cpumask);
-		spin_lock(&this_rq->lock);
-		load_balance(this_rq, idle, cpumask);
-		spin_unlock(&this_rq->lock);
-	}
-}
-#endif
+#define IDLE_REBALANCE_TICK	(HZ/1000 ?: 1)
+#define BUSY_REBALANCE_TICK	(HZ/4 ?: 1)
+#define NUMA_REBALANCE_TICK	(HZ/2 ?: 1)
+
+/* Don't have all balancing operations going off at once */
+#define BUSY_CPU_REBALANCE(cpu)	(cpu * BUSY_REBALANCE_TICK / NR_CPUS)
+#define NUMA_CPU_REBALANCE(cpu)	(cpu * NUMA_REBALANCE_TICK / NR_CPUS)
 
 static void rebalance_tick(runqueue_t *this_rq, int idle)
 {
-#ifdef CONFIG_NUMA
 	int this_cpu = smp_processor_id();
-#endif
 	unsigned long j = jiffies;
 
 	/*
@@ -1299,26 +1445,28 @@ static void rebalance_tick(runqueue_t *t
 	 * node with the current CPU. (ie. other CPUs in the local node
 	 * are not balanced.)
 	 */
-	if (idle) {
-#ifdef CONFIG_NUMA
-		if (!(j % IDLE_NODE_REBALANCE_TICK))
-			balance_node(this_rq, idle, this_cpu);
-#endif
-		if (!(j % IDLE_REBALANCE_TICK)) {
-			spin_lock(&this_rq->lock);
-			load_balance(this_rq, idle, cpu_to_node_mask(this_cpu));
-			spin_unlock(&this_rq->lock);
-		}
-		return;
-	}
+
 #ifdef CONFIG_NUMA
-	if (!(j % BUSY_NODE_REBALANCE_TICK))
-		balance_node(this_rq, idle, this_cpu);
+	if ((j % NUMA_REBALANCE_TICK) == NUMA_CPU_REBALANCE(this_cpu))
+		node_balance(this_cpu, this_rq, INT_MAX);
 #endif
-	if (!(j % BUSY_REBALANCE_TICK)) {
+
+	if ((idle && !(j % IDLE_REBALANCE_TICK))
+		|| (j % BUSY_REBALANCE_TICK) == BUSY_CPU_REBALANCE(this_cpu)) {
+		runqueue_t *busiest;
+		unsigned long imbalance;
+		cpumask_t cpumask = cpu_to_node_mask(this_cpu);
 		spin_lock(&this_rq->lock);
-		load_balance(this_rq, idle, cpu_to_node_mask(this_cpu));
+		busiest = find_busiest_queue(this_rq, this_cpu, idle,
+							&imbalance, cpumask, 1);
+		if (busiest)
+			load_balance(this_rq, busiest, imbalance, 1);
 		spin_unlock(&this_rq->lock);
+
+#ifdef CONFIG_NUMA
+		if (unlikely(this_rq->nr_lb_failed >= NUMA_FACTOR_BONUS))
+			node_balance(this_cpu, this_rq, INT_MAX);
+#endif
 	}
 }
 #else
@@ -1335,20 +1483,6 @@ DEFINE_PER_CPU(struct kernel_stat, kstat
 EXPORT_PER_CPU_SYMBOL(kstat);
 
 /*
- * We place interactive tasks back into the active array, if possible.
- *
- * To guarantee that this does not starve expired tasks we ignore the
- * interactivity of a task if the first expired task had to wait more
- * than a 'reasonable' amount of time. This deadline timeout is
- * load-dependent, as the frequency of array switched decreases with
- * increasing number of running tasks:
- */
-#define EXPIRED_STARVING(rq) \
-		(STARVATION_LIMIT && ((rq)->expired_timestamp && \
-		(jiffies - (rq)->expired_timestamp >= \
-			STARVATION_LIMIT * ((rq)->nr_running) + 1)))
-
-/*
  * This function gets called by the timer code, with HZ frequency.
  * We call it with interrupts disabled.
  *
@@ -1365,17 +1499,11 @@ void scheduler_tick(int user_ticks, int 
 	if (rcu_pending(cpu))
 		rcu_check_callbacks(cpu, user_ticks);
 
-	/* note: this timer irq context must be accounted for as well */
-	if (hardirq_count() - HARDIRQ_OFFSET) {
-		cpustat->irq += sys_ticks;
-		sys_ticks = 0;
-	} else if (softirq_count()) {
-		cpustat->softirq += sys_ticks;
-		sys_ticks = 0;
-	}
-
 	if (p == rq->idle) {
-		if (atomic_read(&rq->nr_iowait) > 0)
+		/* note: this timer irq context must be accounted for as well */
+		if (irq_count() - HARDIRQ_OFFSET >= SOFTIRQ_OFFSET)
+			cpustat->system += sys_ticks;
+		else if (atomic_read(&rq->nr_iowait) > 0)
 			cpustat->iowait += sys_ticks;
 		else
 			cpustat->idle += sys_ticks;
@@ -1398,65 +1526,22 @@ void scheduler_tick(int user_ticks, int 
 	 * The task was running during this tick - update the
 	 * time slice counter. Note: we do not update a thread's
 	 * priority until it either goes to sleep or uses up its
-	 * timeslice. This makes it possible for interactive tasks
-	 * to use up their timeslices at their highest priority levels.
+	 * timeslice.
 	 */
 	if (unlikely(rt_task(p))) {
 		/*
 		 * RR tasks need a special form of timeslice management.
 		 * FIFO tasks have no timeslices.
 		 */
-		if ((p->policy == SCHED_RR) && !--p->time_slice) {
-			p->time_slice = task_timeslice(p);
-			p->first_time_slice = 0;
-			set_tsk_need_resched(p);
-
-			/* put it at the end of the queue: */
-			dequeue_task(p, rq->active);
-			enqueue_task(p, rq->active);
+		if (p->policy == SCHED_RR) {
+			if (task_expired(p, rq))
+				set_tsk_need_resched(p);
 		}
 		goto out_unlock;
 	}
-	if (!--p->time_slice) {
-		dequeue_task(p, rq->active);
-		set_tsk_need_resched(p);
-		p->prio = effective_prio(p);
-		p->time_slice = task_timeslice(p);
-		p->first_time_slice = 0;
 
-		if (!rq->expired_timestamp)
-			rq->expired_timestamp = jiffies;
-		if (!TASK_INTERACTIVE(p) || EXPIRED_STARVING(rq)) {
-			enqueue_task(p, rq->expired);
-		} else
-			enqueue_task(p, rq->active);
-	} else {
-		/*
-		 * Prevent a too long timeslice allowing a task to monopolize
-		 * the CPU. We do this by splitting up the timeslice into
-		 * smaller pieces.
-		 *
-		 * Note: this does not mean the task's timeslices expire or
-		 * get lost in any way, they just might be preempted by
-		 * another task of equal priority. (one with higher
-		 * priority would have preempted this task already.) We
-		 * requeue this task to the end of the list on this priority
-		 * level, which is in essence a round-robin of tasks with
-		 * equal priority.
-		 *
-		 * This only applies to tasks in the interactive
-		 * delta range with at least TIMESLICE_GRANULARITY to requeue.
-		 */
-		if (TASK_INTERACTIVE(p) && !((task_timeslice(p) -
-			p->time_slice) % TIMESLICE_GRANULARITY(p)) &&
-			(p->time_slice >= TIMESLICE_GRANULARITY(p)) &&
-			(p->array == rq->active)) {
-
-			dequeue_task(p, rq->active);
-			set_tsk_need_resched(p);
-			p->prio = effective_prio(p);
-			enqueue_task(p, rq->active);
-		}
+	if (task_expired(p, rq)) {
+		set_tsk_need_resched(p);
 	}
 out_unlock:
 	spin_unlock(&rq->lock);
@@ -1475,7 +1560,7 @@ asmlinkage void schedule(void)
 	runqueue_t *rq;
 	prio_array_t *array;
 	struct list_head *queue;
-	unsigned long long now;
+	unsigned long now;
 	unsigned long run_time;
 	int idx;
 
@@ -1484,11 +1569,10 @@ asmlinkage void schedule(void)
 	 * schedule() atomically, we ignore that path for now.
 	 * Otherwise, whine if we are scheduling when we should not be.
 	 */
-	if (likely(!(current->state & (TASK_DEAD | TASK_ZOMBIE)))) {
-		if (unlikely(in_atomic())) {
-			printk(KERN_ERR "bad: scheduling while atomic!\n");
-			dump_stack();
-		}
+	if (unlikely(in_atomic()) &&
+			likely(!(current->state & (TASK_DEAD | TASK_ZOMBIE)))) {
+		printk(KERN_ERR "bad: scheduling while atomic!\n");
+		dump_stack();
 	}
 
 need_resched:
@@ -1497,19 +1581,11 @@ need_resched:
 	rq = this_rq();
 
 	release_kernel_lock(prev);
-	now = sched_clock();
-	if (likely(now - prev->timestamp < NS_MAX_SLEEP_AVG))
-		run_time = now - prev->timestamp;
-	else
-		run_time = NS_MAX_SLEEP_AVG;
-
-	/*
-	 * Tasks with interactive credits get charged less run_time
-	 * at high sleep_avg to delay them losing their interactive
-	 * status
-	 */
-	if (HIGH_CREDIT(prev))
-		run_time /= (CURRENT_BONUS(prev) ? : 1);
+	now = clock_us();
+	run_time = now - prev->timestamp;
+	prev->timestamp = now;
+	add_task_time(prev, run_time, STIME_RUN);
+	prev->used_slice += run_time;
 
 	spin_lock_irq(&rq->lock);
 
@@ -1521,14 +1597,37 @@ need_resched:
 		else
 			deactivate_task(prev, rq);
 	}
+	if (unlikely(prev->used_slice >= task_timeslice(prev, rq))) {
+		if (prev->array) {
+			prev->used_slice = 0;
+			prev->first_time_slice = 0;
+			if (unlikely(rt_task(prev)) &&
+					prev->policy == SCHED_RR) {
+				/* put it at the end of the queue: */
+				dequeue_task(prev, prev->array);
+				enqueue_task(prev, rq->active);
+			} else {
+				dequeue_task(prev, prev->array);
+				prev->prio = task_priority(prev);
+				enqueue_task(prev, rq->expired);
+			}
+		}
+	}
 
 #ifdef CONFIG_SMP
-	if (unlikely(!rq->nr_running))
-		load_balance(rq, 1, cpu_to_node_mask(smp_processor_id()));
+	if (unlikely(!rq->nr_running)) {
+ 		unsigned long imbalance;
+ 		runqueue_t *busiest;
+ 		int cpu = smp_processor_id();
+ 		busiest = find_busiest_queue(rq, cpu, 2, &imbalance,
+ 						cpu_to_node_mask(cpu), 1);
+ 		if (busiest)
+ 			load_balance(rq, busiest, imbalance, 1);
+	}
 #endif
 	if (unlikely(!rq->nr_running)) {
+		rq->array_sequence++;
 		next = rq->idle;
-		rq->expired_timestamp = 0;
 		goto switch_tasks;
 	}
 
@@ -1537,49 +1636,30 @@ need_resched:
 		/*
 		 * Switch the active and expired arrays.
 		 */
+		rq->array_sequence++;
 		rq->active = rq->expired;
 		rq->expired = array;
 		array = rq->active;
-		rq->expired_timestamp = 0;
 	}
 
 	idx = sched_find_first_bit(array->bitmap);
 	queue = array->queue + idx;
 	next = list_entry(queue->next, task_t, run_list);
 
-	if (next->activated > 0) {
-		unsigned long long delta = now - next->timestamp;
-
-		if (next->activated == 1)
-			delta = delta * (ON_RUNQUEUE_WEIGHT * 128 / 100) / 128;
-
-		array = next->array;
-		dequeue_task(next, array);
-		recalc_task_prio(next, next->timestamp + delta);
-		enqueue_task(next, array);
-	}
-	next->activated = 0;
 switch_tasks:
 	prefetch(next);
 	clear_tsk_need_resched(prev);
 	RCU_qsctr(task_cpu(prev))++;
 
-	prev->sleep_avg -= run_time;
-	if ((long)prev->sleep_avg <= 0){
-		prev->sleep_avg = 0;
-		if (!(HIGH_CREDIT(prev) || LOW_CREDIT(prev)))
-			prev->interactive_credit--;
-	}
-	prev->timestamp = now;
-
 	if (likely(prev != next)) {
+		add_task_time(next, now - next->timestamp, STIME_WAIT);
+		next->timestamp = now;
 		if (prev->state == TASK_RUNNING ||
-				unlikely(preempt_count() & PREEMPT_ACTIVE))
+				unlikely(preempt_count() & PREEMPT_ACTIVE)) {
 			prev->nivcsw++;
-		else
+		} else
 			prev->nvcsw++;
 
-		next->timestamp = now;
 		rq->nr_switches++;
 		rq->curr = next;
 
@@ -1593,7 +1673,7 @@ switch_tasks:
 
 	reacquire_kernel_lock(current);
 	preempt_enable_no_resched();
-	if (test_thread_flag(TIF_NEED_RESCHED))
+	if (unlikely(test_thread_flag(TIF_NEED_RESCHED)))
 		goto need_resched;
 }
 
@@ -2401,6 +2481,8 @@ asmlinkage long sys_sched_rr_get_interva
 	int retval = -EINVAL;
 	struct timespec t;
 	task_t *p;
+	unsigned long flags;
+	runqueue_t *rq;
 
 	if (pid < 0)
 		goto out_nounlock;
@@ -2415,8 +2497,10 @@ asmlinkage long sys_sched_rr_get_interva
 	if (retval)
 		goto out_unlock;
 
+	rq = task_rq_lock(p, &flags);
 	jiffies_to_timespec(p->policy & SCHED_FIFO ?
-				0 : task_timeslice(p), &t);
+				0 : US_TO_JIFFIES(task_timeslice(p, rq)), &t);
+	task_rq_unlock(rq, &flags);
 	read_unlock(&tasklist_lock);
 	retval = copy_to_user(interval, &t, sizeof(t)) ? -EFAULT : 0;
 out_nounlock:
@@ -2706,12 +2790,11 @@ static int migration_call(struct notifie
 			  unsigned long action,
 			  void *hcpu)
 {
-	long cpu = (long) hcpu;
+	long cpu = (long)hcpu;
 	migration_startup_t startup;
 
 	switch (action) {
 	case CPU_ONLINE:
-
 		printk("Starting migration thread for cpu %li\n", cpu);
 
 		startup.cpu = cpu;
@@ -2811,7 +2894,7 @@ void __init sched_init(void)
 		spin_lock_init(&rq->lock);
 		INIT_LIST_HEAD(&rq->migration_queue);
 		atomic_set(&rq->nr_iowait, 0);
-		nr_running_init(rq);
+		nr_running_init(i);
 
 		for (j = 0; j < 2; j++) {
 			array = rq->arrays + j;

_

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 11:44                   ` Edward Tandi
  2003-12-27 12:24                     ` Martin Schlemmer
@ 2003-12-27 18:35                     ` Martin J. Bligh
  2003-12-27 19:56                       ` Jaroslav Kysela
  2003-12-27 20:25                       ` Martin Schlemmer
  2004-01-03  0:53                     ` Chris Shafer
  2 siblings, 2 replies; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-27 18:35 UTC (permalink / raw)
  To: Edward Tandi, azarah
  Cc: perex, alsa-devel, Linux Kernel Mailing Lists, Rob Love,
	Andrew Morton, Stan Bubrouski

>> > Something appears to have broken OSS sound emulation between 
>> > test2 and test3. Best I can tell (despite the appearance of the BK logs), 
>> > that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
>> > understands the sound architecture better than I can fix this?
>> > 
>> 
>> I wont say I understand it, but a quick look seems the major change is
>> the addition of the 'whole-frag' and 'no-silence' opts.  You might try
>> the following to revert what 'no-silence' change at least does:
>> 
>> --
>>  # echo 'xmms 0 0 no-silence' > /proc/asound/card0/pcm0p/oss
>>  # echo 'xmms 0 0 whole-frag' > /proc/asound/card0/pcm0p/oss
>> --
> 
> Thanks, that fixes it for me. I too have been seeing terrible problems
> with XMMS since the early 2.6 pre- kernels.
> 
> Because it only happens in XMMS I thought it was one of those
> application bugs brought out by scheduler changes. I now use Zinf BTW
> -It's better for large music collections (although not as stable or
> flash).
> 
> I guess someone ought to revert the standard behaviour.

OK, the following patch from Andrew fixes it up 80% or so, but I still 
don't think it's as good as test2 was - turning on whole-frag seems to
fix the rest of it. It's much more difficult to tell now though, so I'd 
like other people's opinions on it. If you want to switch between the
two, the above switches it on, and:

# echo 'clear' > /proc/asound/card0/pcm0p/oss

switches whole-frag back off. I'm using a 192kbps MP3 to test it, repeating
the first 30s of the same song again and again (I'm gonna hate that song 
soon ;-)). Different bitrates might give better differentation of the problem.

Please, please experiment with this, and let us know.

M.

--- compile/sound/core/oss/pcm_oss.c.old	Mon Nov 17 18:29:43 2003
+++ compile/sound/core/oss/pcm_oss.c	Sat Dec 27 10:32:30 2003
@@ -814,7 +814,7 @@
 			xfer += tmp;
 			if (substream->oss.setup == NULL || !substream->oss.setup->wholefrag ||
 			    runtime->oss.buffer_used == runtime->oss.period_bytes) {
-				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.buffer_used, 1);
+				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.period_bytes, 1);
 				if (tmp <= 0)
 					return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
 				runtime->oss.bytes += tmp;


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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 18:35                     ` Martin J. Bligh
@ 2003-12-27 19:56                       ` Jaroslav Kysela
  2003-12-27 20:12                         ` Martin J. Bligh
  2003-12-27 20:25                       ` Martin Schlemmer
  1 sibling, 1 reply; 41+ messages in thread
From: Jaroslav Kysela @ 2003-12-27 19:56 UTC (permalink / raw)
  To: Martin J. Bligh
  Cc: Edward Tandi, azarah, alsa-devel, Linux Kernel Mailing Lists,
	Rob Love, Andrew Morton, Stan Bubrouski

On Sat, 27 Dec 2003, Martin J. Bligh wrote:

> >> > Something appears to have broken OSS sound emulation between 
> >> > test2 and test3. Best I can tell (despite the appearance of the BK logs), 
> >> > that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
> >> > understands the sound architecture better than I can fix this?
> >> > 
> >> 
> >> I wont say I understand it, but a quick look seems the major change is
> >> the addition of the 'whole-frag' and 'no-silence' opts.  You might try
> >> the following to revert what 'no-silence' change at least does:
> >> 
> >> --
> >>  # echo 'xmms 0 0 no-silence' > /proc/asound/card0/pcm0p/oss
> >>  # echo 'xmms 0 0 whole-frag' > /proc/asound/card0/pcm0p/oss
> >> --
> > 
> > Thanks, that fixes it for me. I too have been seeing terrible problems
> > with XMMS since the early 2.6 pre- kernels.
> > 
> > Because it only happens in XMMS I thought it was one of those
> > application bugs brought out by scheduler changes. I now use Zinf BTW
> > -It's better for large music collections (although not as stable or
> > flash).
> > 
> > I guess someone ought to revert the standard behaviour.
> 
> OK, the following patch from Andrew fixes it up 80% or so, but I still 
> don't think it's as good as test2 was - turning on whole-frag seems to
> fix the rest of it. It's much more difficult to tell now though, so I'd 
> like other people's opinions on it. If you want to switch between the
> two, the above switches it on, and:
> 
> # echo 'clear' > /proc/asound/card0/pcm0p/oss
> 
> switches whole-frag back off. I'm using a 192kbps MP3 to test it, repeating
> the first 30s of the same song again and again (I'm gonna hate that song 
> soon ;-)). Different bitrates might give better differentation of the problem.
> 
> Please, please experiment with this, and let us know.
> 
> M.
> 
> --- compile/sound/core/oss/pcm_oss.c.old	Mon Nov 17 18:29:43 2003
> +++ compile/sound/core/oss/pcm_oss.c	Sat Dec 27 10:32:30 2003
> @@ -814,7 +814,7 @@
>  			xfer += tmp;
>  			if (substream->oss.setup == NULL || !substream->oss.setup->wholefrag ||
>  			    runtime->oss.buffer_used == runtime->oss.period_bytes) {
> -				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.buffer_used, 1);
> +				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.period_bytes, 1);
>  				if (tmp <= 0)
>  					return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
>  				runtime->oss.bytes += tmp;

It's not a good fix. The problem might be that the rate convert plugin is 
activated. When small chunks are passed to this plugin, the quality drops.
You can check it with this command (and compare native and OSS rates):

  cat /proc/asound/card0/pcm0p/sub0/*

Also, we fixed some OSS emulation errors in our latest code which is 
available here:

  bk pull http://linux-sound.bkbits.net/linux-sound

or

  ftp://ftp.alsa-project.org/pub/kernel-patches/alsa-bk-2003-12-05.patch.gz

I will prepare new patch for recent kernel soon.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 19:56                       ` Jaroslav Kysela
@ 2003-12-27 20:12                         ` Martin J. Bligh
  0 siblings, 0 replies; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-27 20:12 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: Edward Tandi, azarah, alsa-devel, Linux Kernel Mailing Lists,
	Rob Love, Andrew Morton, Stan Bubrouski

>> --- compile/sound/core/oss/pcm_oss.c.old	Mon Nov 17 18:29:43 2003
>> +++ compile/sound/core/oss/pcm_oss.c	Sat Dec 27 10:32:30 2003
>> @@ -814,7 +814,7 @@
>>  			xfer += tmp;
>>  			if (substream->oss.setup == NULL || !substream->oss.setup->wholefrag ||
>>  			    runtime->oss.buffer_used == runtime->oss.period_bytes) {
>> -				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.buffer_used, 1);
>> +				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.period_bytes, 1);
>>  				if (tmp <= 0)
>>  					return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
>>  				runtime->oss.bytes += tmp;
> 
> It's not a good fix. 

OK you know the code far better than I ... but it sounds a lot better ;-)
So *something* around there is broken. It sounds horrible in 2.6.0 virgin.

> The problem might be that the rate convert plugin is 
> activated. When small chunks are passed to this plugin, the quality drops.
> You can check it with this command (and compare native and OSS rates):
> 
>   cat /proc/asound/card0/pcm0p/sub0/*

OSS rate: 44100
rate: 48000 (48000/1)

However, test2 worked fine - and it works fine with whole-frag turned on ...
has the rate conversion changed?

> Also, we fixed some OSS emulation errors in our latest code which is 
> available here:
> 
>   bk pull http://linux-sound.bkbits.net/linux-sound
> 
> or
> 
>   ftp://ftp.alsa-project.org/pub/kernel-patches/alsa-bk-2003-12-05.patch.gz
> 
> I will prepare new patch for recent kernel soon.

I tried the above patch - doesn't help.

Thanks,

M.


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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 18:35                     ` Martin J. Bligh
  2003-12-27 19:56                       ` Jaroslav Kysela
@ 2003-12-27 20:25                       ` Martin Schlemmer
  2003-12-27 20:44                         ` Martin Schlemmer
  1 sibling, 1 reply; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-27 20:25 UTC (permalink / raw)
  To: Martin J. Bligh
  Cc: Edward Tandi, perex, alsa-devel, Linux Kernel Mailing Lists,
	Rob Love, Andrew Morton, Stan Bubrouski

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

On Sat, 2003-12-27 at 20:35, Martin J. Bligh wrote:
> >> > Something appears to have broken OSS sound emulation between 
> >> > test2 and test3. Best I can tell (despite the appearance of the BK logs), 
> >> > that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
> >> > understands the sound architecture better than I can fix this?
> >> > 
> >> 
> >> I wont say I understand it, but a quick look seems the major change is
> >> the addition of the 'whole-frag' and 'no-silence' opts.  You might try
> >> the following to revert what 'no-silence' change at least does:
> >> 
> >> --
> >>  # echo 'xmms 0 0 no-silence' > /proc/asound/card0/pcm0p/oss
> >>  # echo 'xmms 0 0 whole-frag' > /proc/asound/card0/pcm0p/oss
> >> --
> > 
> > Thanks, that fixes it for me. I too have been seeing terrible problems
> > with XMMS since the early 2.6 pre- kernels.
> > 
> > Because it only happens in XMMS I thought it was one of those
> > application bugs brought out by scheduler changes. I now use Zinf BTW
> > -It's better for large music collections (although not as stable or
> > flash).
> > 
> > I guess someone ought to revert the standard behaviour.
> 
> OK, the following patch from Andrew fixes it up 80% or so, but I still 
> don't think it's as good as test2 was - turning on whole-frag seems to
> fix the rest of it. It's much more difficult to tell now though, so I'd 
> like other people's opinions on it. If you want to switch between the
> two, the above switches it on, and:
> 
> # echo 'clear' > /proc/asound/card0/pcm0p/oss
> 
> switches whole-frag back off. I'm using a 192kbps MP3 to test it, repeating
> the first 30s of the same song again and again (I'm gonna hate that song 
> soon ;-)). Different bitrates might give better differentation of the problem.
> 
> Please, please experiment with this, and let us know.
> 
> M.
> 
> --- compile/sound/core/oss/pcm_oss.c.old	Mon Nov 17 18:29:43 2003
> +++ compile/sound/core/oss/pcm_oss.c	Sat Dec 27 10:32:30 2003
> @@ -814,7 +814,7 @@
>  			xfer += tmp;
>  			if (substream->oss.setup == NULL || !substream->oss.setup->wholefrag ||
>  			    runtime->oss.buffer_used == runtime->oss.period_bytes) {
> -				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.buffer_used, 1);
> +				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.period_bytes, 1);
>  				if (tmp <= 0)
>  					return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
>  				runtime->oss.bytes += tmp;

I cannot see that this is a very clean approach.  Sure, this is how it
was, but the test was also different:

--
if (runtime->oss.buffer_used == runtime->oss.period_bytes) {
--

Meaning the buffer was only written when it was full (period_bytes is
your period size, meaning buffer size).  What you will have now, is that
you will write the full buffer with your valid data, and whatever crud
is left from a previous pass that used the buffer to its full extend,
or at least more of it than this pass (which might very well be the
reason for the 20% noise/whatever left).  Basically writing a chunk of
crap at the end of every user buffer.

You might try something like below, but I will be honest if I do not
know for a fact that

--
--- a/sound/core/oss/pcm_oss.c    2003-12-27 12:53:06.000000000 +0200
+++ b/sound/core/oss/pcm_oss.c    2003-12-27 22:00:47.323058872 +0200
@@ -814,6 +814,12 @@
                        xfer += tmp;
                        if (substream->oss.setup == NULL || !substream->oss.setup->wholefrag ||
                            runtime->oss.buffer_used == runtime->oss.period_bytes) {
+                               if (runtime->oss.buffer_used != runtime->oss.period_bytes) {
+
+                                       memset(runtime->oss.buffer + runtime->oss.buffer_used,
+                                               (u_int8_t)snd_pcm_format_silence_64(snd_pcm_oss_format_from(runtime->oss.format)),
+                                               runtime->oss.period_bytes - runtime->oss.buffer_used);
+                               }
                                tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.buffer_used, 1);
                                if (tmp <= 0)
                                        return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
--

But I would imagine the 'silent parts' in the song (if that long, and
dont anyhow sound like skips or choppy) will still be annoying =)


-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 20:25                       ` Martin Schlemmer
@ 2003-12-27 20:44                         ` Martin Schlemmer
  2003-12-28  0:27                           ` Martin J. Bligh
  0 siblings, 1 reply; 41+ messages in thread
From: Martin Schlemmer @ 2003-12-27 20:44 UTC (permalink / raw)
  To: Martin J. Bligh
  Cc: Edward Tandi, perex, alsa-devel, Linux Kernel Mailing Lists,
	Rob Love, Andrew Morton, Stan Bubrouski

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

On Sat, 2003-12-27 at 22:25, Martin Schlemmer wrote:
> On Sat, 2003-12-27 at 20:35, Martin J. Bligh wrote:
> > >> > Something appears to have broken OSS sound emulation between 
> > >> > test2 and test3. Best I can tell (despite the appearance of the BK logs), 
> > >> > that included ALSA updates 0.9.5 and 0.9.6. Hopefully someone who
> > >> > understands the sound architecture better than I can fix this?
> > >> > 
> > >> 
> > >> I wont say I understand it, but a quick look seems the major change is
> > >> the addition of the 'whole-frag' and 'no-silence' opts.  You might try
> > >> the following to revert what 'no-silence' change at least does:
> > >> 
> > >> --
> > >>  # echo 'xmms 0 0 no-silence' > /proc/asound/card0/pcm0p/oss
> > >>  # echo 'xmms 0 0 whole-frag' > /proc/asound/card0/pcm0p/oss
> > >> --
> > > 
> > > Thanks, that fixes it for me. I too have been seeing terrible problems
> > > with XMMS since the early 2.6 pre- kernels.
> > > 
> > > Because it only happens in XMMS I thought it was one of those
> > > application bugs brought out by scheduler changes. I now use Zinf BTW
> > > -It's better for large music collections (although not as stable or
> > > flash).
> > > 
> > > I guess someone ought to revert the standard behaviour.
> > 
> > OK, the following patch from Andrew fixes it up 80% or so, but I still 
> > don't think it's as good as test2 was - turning on whole-frag seems to
> > fix the rest of it. It's much more difficult to tell now though, so I'd 
> > like other people's opinions on it. If you want to switch between the
> > two, the above switches it on, and:
> > 
> > # echo 'clear' > /proc/asound/card0/pcm0p/oss
> > 
> > switches whole-frag back off. I'm using a 192kbps MP3 to test it, repeating
> > the first 30s of the same song again and again (I'm gonna hate that song 
> > soon ;-)). Different bitrates might give better differentation of the problem.
> > 
> > Please, please experiment with this, and let us know.
> > 
> > M.
> > 
> > --- compile/sound/core/oss/pcm_oss.c.old	Mon Nov 17 18:29:43 2003
> > +++ compile/sound/core/oss/pcm_oss.c	Sat Dec 27 10:32:30 2003
> > @@ -814,7 +814,7 @@
> >  			xfer += tmp;
> >  			if (substream->oss.setup == NULL || !substream->oss.setup->wholefrag ||
> >  			    runtime->oss.buffer_used == runtime->oss.period_bytes) {
> > -				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.buffer_used, 1);
> > +				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.period_bytes, 1);
> >  				if (tmp <= 0)
> >  					return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
> >  				runtime->oss.bytes += tmp;
> 
> I cannot see that this is a very clean approach.  Sure, this is how it
> was, but the test was also different:
> 
> --
> if (runtime->oss.buffer_used == runtime->oss.period_bytes) {
> --
> 
> Meaning the buffer was only written when it was full (period_bytes is
> your period size, meaning buffer size).  What you will have now, is that
> you will write the full buffer with your valid data, and whatever crud
> is left from a previous pass that used the buffer to its full extend,
> or at least more of it than this pass (which might very well be the
> reason for the 20% noise/whatever left).  Basically writing a chunk of
> crap at the end of every user buffer.
> 
> You might try something like below, but I will be honest if I do not
> know for a fact that
> 
> --
> --- a/sound/core/oss/pcm_oss.c    2003-12-27 12:53:06.000000000 +0200
> +++ b/sound/core/oss/pcm_oss.c    2003-12-27 22:00:47.323058872 +0200
> @@ -814,6 +814,12 @@
>                         xfer += tmp;
>                         if (substream->oss.setup == NULL || !substream->oss.setup->wholefrag ||
>                             runtime->oss.buffer_used == runtime->oss.period_bytes) {
> +                               if (runtime->oss.buffer_used != runtime->oss.period_bytes) {
> +
> +                                       memset(runtime->oss.buffer + runtime->oss.buffer_used,
> +                                               (u_int8_t)snd_pcm_format_silence_64(snd_pcm_oss_format_from(runtime->oss.format)),
> +                                               runtime->oss.period_bytes - runtime->oss.buffer_used);
> +                               }
>                                 tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.buffer_used, 1);
>                                 if (tmp <= 0)
>                                         return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
> --
> 
> But I would imagine the 'silent parts' in the song (if that long, and
> dont anyhow sound like skips or choppy) will still be annoying =)

Besides for me forgetting to change runtime->oss.buffer_used to
runtime->oss.period_bytes as other patch, the memset part should really
test if it should use 8, 16, 32 or 64 bit first, and I am sure there is
more to it to get the start position aligned, etc ...  But then, I do
not see how its going to fix anything, as you will now have silence
instead of it breaking up.

-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 16:55                           ` Edward Tandi
  2003-12-27 17:22                             ` Martin Schlemmer
@ 2003-12-27 21:56                             ` Henrik Storner
  2003-12-27 22:51                               ` Edward Tandi
  1 sibling, 1 reply; 41+ messages in thread
From: Henrik Storner @ 2003-12-27 21:56 UTC (permalink / raw)
  To: linux-kernel

In <1072544151.8611.18.camel@wires.home.biz> Edward Tandi <ed@efix.biz> writes:

>I would say the symptoms are that the music starts playing OK bit after
>a short period (18-19 seconds), the music changes overall speed (by a
>semi-tone or so). When it does this, the sound also starts to break up.

Just a "me too" post - I've been trying out 2.6.0 over the past couple
of days, and this is the only real issue I've encountered. Just like
you describe, the pace of the music playing speeds up slightly, and
there are some mis-sounds for a few seconds. Then it comes back to
normal.

>It could be a driver issue. FYI, I am using a VIA KT400 chipset.

Could be. I have the same chipset (KT400A, actually).

-- 
Henrik Storner

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

* Re: 2.6.0 sound output - wierd effects
  2003-12-27  5:10                   ` Rob Love
  2003-12-27  5:45                     ` Stan Bubrouski
@ 2003-12-27 22:44                     ` szonyi calin
  1 sibling, 0 replies; 41+ messages in thread
From: szonyi calin @ 2003-12-27 22:44 UTC (permalink / raw)
  To: Rob Love; +Cc: linux-kernel

 --- Rob Love <rml@ximian.com> a écrit : > On Sat, 2003-12-27 at
00:02, Martin J. Bligh wrote:
> 
> > Because someone broke it ... that's what this thread is
> about ;-)
> 
> Right, sorry :-)
> 
> But what does that have to do with OSS remaining in the kernel
> and the
> guy I was responding to having to continue to use OSS?
> 
> I mean, it is a bug, and we will fix it.  Keeping OSS is
> orthogonal. 
> That was my point.
> 

The problem is that alsa is not stable. At least not like oss.
I switched from alsa to oss because i could compile oss
directly in my kernel
 (that was a long time ago).

and when 2.6.0-test apeared i compiled alsa in the kernel but i
had
problems with it and came back to oss:
1. SOund was jerky compared to oss (almost inaudible)
with oss emulation.
2. doesn't have an btaudio driver and i wasn't been able to
compile alsa and oss btaudio driver in the same kernel 
so i couldn't watch tv with the alsa kernel :-(
3. Many old sound applications require oss (even emulated)
And oss emulation is far from stable. 

These are my opinions. I hope they will change soon :-)

> 	Rob Love
> 
Calin


=====
--
A mouse is a device used to point at 
the xterm you want to type in.
Kim Alm on a.s.r.

_________________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 21:56                             ` Henrik Storner
@ 2003-12-27 22:51                               ` Edward Tandi
  0 siblings, 0 replies; 41+ messages in thread
From: Edward Tandi @ 2003-12-27 22:51 UTC (permalink / raw)
  To: Henrik Storner; +Cc: Kernel mailing list

On Sat, 2003-12-27 at 21:56, Henrik Storner wrote:
> In <1072544151.8611.18.camel@wires.home.biz> Edward Tandi <ed@efix.biz> writes:
> 
> >I would say the symptoms are that the music starts playing OK bit after
> >a short period (18-19 seconds), the music changes overall speed (by a
> >semi-tone or so). When it does this, the sound also starts to break up.
> 
> Just a "me too" post - I've been trying out 2.6.0 over the past couple
> of days, and this is the only real issue I've encountered. Just like
> you describe, the pace of the music playing speeds up slightly, and
> there are some mis-sounds for a few seconds. Then it comes back to
> normal.

Yes, it lasts for about 5 seconds then continues as normal. The problem
then re-occurs about 1.5-2.5 minutes after that. The recurrence after
that becomes harder to predict.

Interestingly, if you leave XMMS playing long enough (over an hour) such
as listening to a vorbis radio stream, it finally goes into permanent
break-up mode. It's so bad that you really have to stop playing and
start again (no need to shut down XMMS though).

Ed-T.



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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 20:44                         ` Martin Schlemmer
@ 2003-12-28  0:27                           ` Martin J. Bligh
  0 siblings, 0 replies; 41+ messages in thread
From: Martin J. Bligh @ 2003-12-28  0:27 UTC (permalink / raw)
  To: azarah
  Cc: Edward Tandi, perex, alsa-devel, Linux Kernel Mailing Lists,
	Rob Love, Andrew Morton, Stan Bubrouski, Henrik Storner

OK, I chose to just back out the wholefrag stuff - it doesn't seem to
work. Presumably someone from the ALSA project will come up with a
better fix than this, if not, I'll send this upstream. This should
just fix it, without the need to do other stuff in userspace to work
around it ... at least it does for me. 

This is the way the world was in -test2, and maybe it should have stayed 
like that - the new feature seems to me to default wholefrag off, where
it was on before. Patch is also in 2.6.0-mjb2, which I'll release in a bit.

M.

diff -urpN -X /home/fletch/.diff.exclude 610-alsa_100rc2/include/sound/pcm_oss.h 620-force_wholefrag/include/sound/pcm_oss.h
--- 610-alsa_100rc2/include/sound/pcm_oss.h	Mon Nov 17 18:29:43 2003
+++ 620-force_wholefrag/include/sound/pcm_oss.h	Sat Dec 27 14:50:15 2003
@@ -31,7 +31,6 @@ struct _snd_pcm_oss_setup {
 		     direct:1,
 		     block:1,
 		     nonblock:1,
-		     wholefrag:1,
 		     nosilence:1;
 	unsigned int periods;
 	unsigned int period_size;
diff -urpN -X /home/fletch/.diff.exclude 610-alsa_100rc2/sound/core/oss/pcm_oss.c 620-force_wholefrag/sound/core/oss/pcm_oss.c
--- 610-alsa_100rc2/sound/core/oss/pcm_oss.c	Sat Dec 27 14:50:08 2003
+++ 620-force_wholefrag/sound/core/oss/pcm_oss.c	Sat Dec 27 14:50:15 2003
@@ -814,9 +814,8 @@ static ssize_t snd_pcm_oss_write1(snd_pc
 			buf += tmp;
 			bytes -= tmp;
 			xfer += tmp;
-			if (substream->oss.setup == NULL || !substream->oss.setup->wholefrag ||
-			    runtime->oss.buffer_used == runtime->oss.period_bytes) {
-				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.buffer_used, 1);
+			if (runtime->oss.buffer_used == runtime->oss.period_bytes) {
+				tmp = snd_pcm_oss_write2(substream, runtime->oss.buffer, runtime->oss.period_bytes, 1);
 				if (tmp <= 0)
 					return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
 				runtime->oss.bytes += tmp;
@@ -2195,7 +2194,7 @@ static void snd_pcm_oss_proc_read(snd_in
 	snd_pcm_oss_setup_t *setup = pstr->oss.setup_list;
 	down(&pstr->oss.setup_mutex);
 	while (setup) {
-		snd_iprintf(buffer, "%s %u %u%s%s%s%s%s%s\n",
+		snd_iprintf(buffer, "%s %u %u%s%s%s%s%s\n",
 			    setup->task_name,
 			    setup->periods,
 			    setup->period_size,
@@ -2203,7 +2202,6 @@ static void snd_pcm_oss_proc_read(snd_in
 			    setup->direct ? " direct" : "",
 			    setup->block ? " block" : "",
 			    setup->nonblock ? " non-block" : "",
-			    setup->wholefrag ? " whole-frag" : "",
 			    setup->nosilence ? " no-silence" : "");
 		setup = setup->next;
 	}
@@ -2270,8 +2268,6 @@ static void snd_pcm_oss_proc_write(snd_i
 				template.block = 1;
 			} else if (!strcmp(str, "non-block")) {
 				template.nonblock = 1;
-			} else if (!strcmp(str, "whole-frag")) {
-				template.wholefrag = 1;
 			} else if (!strcmp(str, "no-silence")) {
 				template.nosilence = 1;
 			}






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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27  7:50               ` OSS sound emulation broken between 2.6.0-test2 and test3 Martin J. Bligh
  2003-12-27 11:11                 ` Martin Schlemmer
@ 2003-12-28  5:06                 ` Joshua Schmidlkofer
  1 sibling, 0 replies; 41+ messages in thread
From: Joshua Schmidlkofer @ 2003-12-28  5:06 UTC (permalink / raw)
  To: Martin J. Bligh
  Cc: perex, alsa-devel, azarah, Linux Kernel Mailing Lists, Rob Love,
	Andrew Morton, Stan Bubrouski, swidmer

> If I leave xmms playing (in random shuffle mode) every 2 minutes or so,
> I'll get some wierd effect for a few seconds, either static, or the track
> will mysteriously speed up or slow down. Then all is back to normal for
> another couple of minutes.

We had this problem with an Intel 8x0 sound chipset, turned out to be
that the chipset requires a fixed bit rate.  I can't remember what we
did to fix it, but I will ask my friend who has the system.


js


-- 
VB programmers ask why no one takes them seriously, 
it's somewhat akin to a McDonalds manager asking employees 
why they don't take their 'career' seriously.


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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2003-12-27 11:44                   ` Edward Tandi
  2003-12-27 12:24                     ` Martin Schlemmer
  2003-12-27 18:35                     ` Martin J. Bligh
@ 2004-01-03  0:53                     ` Chris Shafer
  2004-01-03 22:23                       ` Martin Schlemmer
  2 siblings, 1 reply; 41+ messages in thread
From: Chris Shafer @ 2004-01-03  0:53 UTC (permalink / raw)
  To: Edward Tandi; +Cc: Linux Kernel Mailing Lists

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

On Sat, Dec 27, 2003 at 11:44:11AM +0000, Edward Tandi scrawled:
> 
> Because it only happens in XMMS I thought it was one of those
> application bugs brought out by scheduler changes. I now use Zinf BTW
> -It's better for large music collections (although not as stable or
> flash).

Have you tried and see if it occurs with the ALSA output driver for XMMS.
Without the whole frag line set?

Cheers,
Chris Shafer
-- 
My public key can be obtained from the MIT keyservers at pgp.mit.edu.
The key ID is 8F47ED2E. 

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

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

* Re: OSS sound emulation broken between 2.6.0-test2 and test3
  2004-01-03  0:53                     ` Chris Shafer
@ 2004-01-03 22:23                       ` Martin Schlemmer
  0 siblings, 0 replies; 41+ messages in thread
From: Martin Schlemmer @ 2004-01-03 22:23 UTC (permalink / raw)
  To: Chris Shafer; +Cc: Edward Tandi, Linux Kernel Mailing Lists

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

On Sat, 2004-01-03 at 02:53, Chris Shafer wrote:
> On Sat, Dec 27, 2003 at 11:44:11AM +0000, Edward Tandi scrawled:
> > 
> > Because it only happens in XMMS I thought it was one of those
> > application bugs brought out by scheduler changes. I now use Zinf BTW
> > -It's better for large music collections (although not as stable or
> > flash).
> 
> Have you tried and see if it occurs with the ALSA output driver for XMMS.
> Without the whole frag line set?
> 

That should work.  The chip used for the i8[67]5 boards used to behave
like this, but apparently to somebody else on the list it was because
it could not handle variable data lengths (could have the term wrong)
written to it, and was fixed driver side - this is not maybe an issue
for the sis based boards as well (using a realtek chip i think??) ?
Meaning its chip/driver side, not OSS-emu side?


Cheers,

-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2004-01-03 22:20 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-26 21:55 2.6.0 sound output - wierd effects Martin J. Bligh
2003-12-26 22:27 ` Sven-Haegar Koch
2003-12-27 16:14   ` Martin J. Bligh
2003-12-26 22:52 ` Martin Schlemmer
2003-12-26 23:00   ` Martin J. Bligh
2003-12-26 23:17     ` Martin Schlemmer
2003-12-26 23:24       ` Martin J. Bligh
2003-12-26 23:50         ` Martin Schlemmer
2003-12-26 23:59           ` Martin J. Bligh
2003-12-27  0:44             ` Martin Schlemmer
2003-12-27  0:53             ` Martin Schlemmer
2003-12-27  4:34               ` Martin J. Bligh
2003-12-27 11:12                 ` Martin Schlemmer
2003-12-27 16:17                   ` Martin J. Bligh
2003-12-27  4:48             ` Stan Bubrouski
2003-12-27  4:57               ` Rob Love
2003-12-27  5:02                 ` Martin J. Bligh
2003-12-27  5:10                   ` Rob Love
2003-12-27  5:45                     ` Stan Bubrouski
2003-12-27 22:44                     ` szonyi calin
2003-12-27  7:50               ` OSS sound emulation broken between 2.6.0-test2 and test3 Martin J. Bligh
2003-12-27 11:11                 ` Martin Schlemmer
2003-12-27 11:44                   ` Edward Tandi
2003-12-27 12:24                     ` Martin Schlemmer
2003-12-27 13:08                       ` Edward Tandi
2003-12-27 14:33                         ` Martin Schlemmer
2003-12-27 16:55                           ` Edward Tandi
2003-12-27 17:22                             ` Martin Schlemmer
2003-12-27 21:56                             ` Henrik Storner
2003-12-27 22:51                               ` Edward Tandi
2003-12-27 18:35                     ` Martin J. Bligh
2003-12-27 19:56                       ` Jaroslav Kysela
2003-12-27 20:12                         ` Martin J. Bligh
2003-12-27 20:25                       ` Martin Schlemmer
2003-12-27 20:44                         ` Martin Schlemmer
2003-12-28  0:27                           ` Martin J. Bligh
2004-01-03  0:53                     ` Chris Shafer
2004-01-03 22:23                       ` Martin Schlemmer
2003-12-28  5:06                 ` Joshua Schmidlkofer
2003-12-26 22:59 ` 2.6.0 sound output - wierd effects Sander Sweers
2003-12-26 23:02   ` Martin J. Bligh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).