From owner-freebsd-sparc64@FreeBSD.ORG Wed Aug 19 21:08:43 2009 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D160C106568E for ; Wed, 19 Aug 2009 21:08:43 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.224]) by mx1.freebsd.org (Postfix) with ESMTP id 9EF248FC3F for ; Wed, 19 Aug 2009 21:08:43 +0000 (UTC) Received: by rv-out-0506.google.com with SMTP id f9so1360780rvb.43 for ; Wed, 19 Aug 2009 14:08:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=9UUmIxbzSfX4JwyAdBZsndJS/froTWVy89B/H9AI2qc=; b=ctHzdkRM5kLJWB0axHMQXHKs19elyGGJEBqRvhAgRd4dO8dOizeCTBD7HwjT0ykI/s JoNaMBd47+t8F2hV3I5Ttd3zAeMFPBVlUEcjWD5SNJz3jxil4RgXnGf14TqAy8opWqAz Lk5Apd98vGxkkO7tPQVHpngb4Usvd0hrDKH6M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=F2W9jI3HfEnkbSE9yTJTwmj3k1FSaExRuBDy6wq6yZWzPIMEvtV8rQzyKq8SpA8s+1 7tjGIrefHY7M69knBt8FUtccw9Zr6ZK/TPMM0UiURQW/AzE63ONwbE47t1IkRwaWgETE 8f9GvMCQOwkmBJsP1a+3vU0neUQbeIQJJfOFw= Received: by 10.140.187.21 with SMTP id k21mr212068rvf.274.1250716123154; Wed, 19 Aug 2009 14:08:43 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id g31sm7118rvb.16.2009.08.19.14.08.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 19 Aug 2009 14:08:42 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Wed, 19 Aug 2009 14:08:04 -0700 From: Pyun YongHyeon Date: Wed, 19 Aug 2009 14:08:04 -0700 To: Marius Strobl Message-ID: <20090819210804.GC20481@michelle.cdnetworks.com> References: <4A7C6B50.3070503@networkz.ch> <20090817205340.GA75477@alchemy.franken.de> <20090817215612.GB75477@alchemy.franken.de> <20090818192748.GA6585@alchemy.franken.de> <20090819175610.GA20481@michelle.cdnetworks.com> <20090819204603.GL25891@alchemy.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090819204603.GL25891@alchemy.franken.de> User-Agent: Mutt/1.4.2.3i Cc: freebsd-sparc64@freebsd.org Subject: Re: Audio on Sunblade 100 X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 21:08:43 -0000 On Wed, Aug 19, 2009 at 10:46:03PM +0200, Marius Strobl wrote: > On Wed, Aug 19, 2009 at 10:56:10AM -0700, Pyun YongHyeon wrote: > > On Tue, Aug 18, 2009 at 09:27:48PM +0200, Marius Strobl wrote: > > > On Mon, Aug 17, 2009 at 11:56:12PM +0200, Marius Strobl wrote: > > > > On Mon, Aug 17, 2009 at 10:53:40PM +0200, Marius Strobl wrote: > > > > > On Fri, Aug 07, 2009 at 07:58:40PM +0200, Christian Ramseyer wrote: > > > > > > Hi > > > > > > > > > > > > I'm trying to get sound on a Sunblade 100 with 7.2R. I've added > > > > > > > > > > > > device sound > > > > > > device snd_t4dwave > > > > > > > > > > > > to the kernel and recompiled. pciconf shows an attached driver: > > > > > > > > > > > > pcm0@pci0:0:8:0: class=0x040100 card=0x545110b9 chip=0x545110b9 > > > > > > rev=0x01 hdr=0x00 > > > > > > vendor = 'Acer Labs Incorporated (ALi/ULi)' > > > > > > device = 'ALI M5451 PCI AC-Link Controller Audio Device' > > > > > > class = multimedia > > > > > > subclass = audio > > > > > > > > > > > > However, there are errors in dmesg: > > > > > > > > > > > > pcm0: port 0x900-0x9ff mem 0x424000-0x424fff at device > > > > > > 8.0 on pci0 > > > > > > pcm0: > > > > > > pcm0: [GIANT-LOCKED] > > > > > > pcm0: [ITHREAD] > > > > > > pcm0: chn_init(pcm0:record:dsp0.r0) failed: err = 19 > > > > > > pcm0: pcm_chn_create(trrchan, -1, 0xfffff80001370800) failed > > > > > > pcm0: chn_init(pcm0:play:dsp0.p0) failed: err = 19 > > > > > > pcm0: pcm_chn_create(trpchan, 1, 0xfffff80001370800) failed > > > > > > > > > > > > I've also found this message from 2006: > > > > > > http://lists.freebsd.org/mailman/htdig/freebsd-sparc64/2006-June/004168.html > > > > > > > > > > > > So, am I just doing something wrong or are there problems with 5451 > > > > > > audio on SPARC? I see that the release notes only list i386 and amd64 as > > > > > > architectures for the t4dwave driver. > > > > > > > > > > > > By the way, thanks a lot for all the work your guys are doing in general > > > > > > and for the SPARC port in particular. I'm currently trying BSD for the > > > > > > first time in my life and I like it a lot. It runs surprisingly well on > > > > > > this outdated platform. > > > > > > > > > > > > > > > > Could you (or any other Blade 100 user) please give the following > > > > > patch at try? > > > > > http://people.freebsd.org/~marius/t4dwave_sparc64_32-bit.diff > > > > > This gets at least the line-out of the M5451 in my Blade 1500 > > > > > working (I've no idea whether its internal speaker is also > > > > > connected to the sound chip like for example in a Blade 1000 > > > > > and thus supposed to also work or just to a PC-style beeper, > > > > > the firmware at least makes it beep that way...), but which > > > > > also has a newer revision of this chip. > > > > > > > > > > > > > Looks like I've spoken to soon; it only works when it happens > > > > to get certain buffer addresses, otherwise nothing is played > > > > and the interrupt times out (which according to google isn't > > > > a sparc64 specific problem). This probably means that some > > > > bus_dma(9) parameters are incorrect... > > > > > > > > > > Ok, I think I've identified the incorrect bus_dma(9) settings > > > with the help of Tatsuo YOKOGAWA's ali(4) (which as least for > > > the alignment requirement also matches the NetBSD autri(4). A > > > new patch is at: > > > http://people.freebsd.org/~marius/t4dwave_M5451_32-bit.diff > > > > The patch looks good to me but I have two questions. The alignment > > restriction specified in bus_dma_tag_create(9) really works even > > if the alignment is greater than PAGE_SIZE? I vaguely remember > > the alignment was not satisfied last time I tried it on i386 if I > > specified 256K. > > Hrm, from a quick check of the i386 busdma and the sparc64 > busdma and IOMMU code I see no indication why such an > alignment shouldn't work as expected, neither do relevant > man pages like bus_dma(9) and contigmalloc(9) indicate a > restriction to PAGE_SIZE. Based on the addresses of the > buffers I get on sparc64 (f.e. 0xc0000000 and 0xc0020000) > I'd also say it just works. But before possibly commiting > this change I've to also run-time check it on i386 anyway. > Hmm, I also have to check it again. But I guess there was an alignment issue for iwn(4) so the driver had to add a ugly workaround for it. > > The second question is number of channels > > supported for M5451. If I remember correctly there are some > > differences among 4D wave compatible chips and M5451 may have 32 > > channels instead of 64. > > Well, r173511 limited the driver to effectively only use > one channel with M5451 and given that the same change added > a knob I suspect that it was also actually tested with more > than one channel but that also failed. Do you mean that the I know t4dwave(4) uses 1p/1r for M5451, I meant wavetable/digital channel used in the hardware. I think original Trident 4Dwave supports 64 channels but [1] surely indicates it just supports up to 32 channels(32-voices directsound channels). > interation in the interrupt handler should be limited to 32 > (according to the M1535 datasheet [1] that number is correct) Yes, I think tr_intr() shuld not touch more than 32 channels for M5451. > for M5451 or maybe also to the number of channels registered? > > Marius > > [1]: www.nvidia.com/docs/CP/29993/m1535dm_web.pdf >