Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Sep 2005 12:36:58 +0900
From:      Pyun YongHyeon <pyunyh@gmail.com>
To:        "Steven S." <steven@403forbidden.net>
Cc:        freebsd-multimedia@freebsd.org
Subject:   Re: any hope for maestro support?
Message-ID:  <20050915033658.GB17602@rndsoft.co.kr>
In-Reply-To: <20050914174543.L45764@atlantis.403forbidden.net>
References:  <20050914174543.L45764@atlantis.403forbidden.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--9amGYk9869ThD9tj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, Sep 14, 2005 at 05:54:41PM -0400, Steven S. wrote:
 > 
 > My original PR is now 1 1/2 years old (kern/63204) and still no luck of 
 > getting the maestro-2e (ES1978) to work. While you can load the sound 
 > driver and it "seems" to work the mixer has no options and you cannot get 
 > any output out of the speakers.
 > 
 > 
[...]

 > when i load the driver..
 > 
 > pcm0: <ESS Technology Maestro-2E> port 0xfc00-0xfcff irq 11 at device 12.0 
 > on pci0
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: will perform cold reset.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: agg_rdcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > pcm0: <Asahi Kasei AK4540 AC97 Codec>
 > pcm0: agg_rdcodec() PROGLESS timed out.
 > pcm0: agg_rdcodec() RW_DONE timed out.
 > pcm0: ac97 codec reports dac not ready
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > pcm0: agg_wrcodec() PROGLESS timed out.
 > 
 > 
 > Id Refs Address    Size     Name
 >  1    5 0xc0400000 36cf38   kernel
 >  2    1 0xc076d000 7200     snd_maestro.ko
 >  3   15 0xc0775000 58034    acpi.ko
 > 
 > FreeBSD Audio Driver (newpcm)
 > Installed devices:
 > pcm0: <ESS Technology Maestro-2E> at I/O port 0xfc00 irq 11 kld 
 > snd_maestro (4p/0r/4v
 >  channels duplex default)
 > 
Would you try attaced patch?
I don't have the hardware so it's just guess work.

-- 
Regards,
Pyun YongHyeon

--9amGYk9869ThD9tj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="maestro.patch"

--- sys/dev/sound/pci/maestro.c.orig	Tue Mar  1 17:58:05 2005
+++ sys/dev/sound/pci/maestro.c	Thu Sep 15 12:46:56 2005
@@ -227,7 +227,7 @@
 static inline u_int16_t	 wc_rdchctl(struct agg_info*, int);
 static inline void	 wc_wrchctl(struct agg_info*, int, u_int16_t);
 
-static inline void	 agg_stopclock(struct agg_info*, int part, int st);
+static void	 	 agg_stopclock(struct agg_info*, int, int);
 
 static inline void	 agg_initcodec(struct agg_info*);
 static void		 agg_init(struct agg_info*);
@@ -284,7 +284,7 @@
 {
 	int timo;
 
-	timo = msec * hz / 1000;
+	timo = ((msec) * hz + 999) / 1000;
 	if (timo == 0)
 		timo = 1;
 #ifdef USING_MUTEX
@@ -345,16 +345,18 @@
 static inline int
 agg_codec_wait4idle(struct agg_info *ess)
 {
-	unsigned t = 26;
+	int i, step, to;
 
-	while (AGG_RD(ess, PORT_CODEC_STAT, 1) & CODEC_STAT_MASK) {
-		if (--t == 0)
-			return EBUSY;
-		DELAY(2);	/* 20.8us / 13 */
+	to = 10000;	/* 10ms */
+	for (i = 0, step = 1; i < to; i += step) {
+		if ((AGG_RD(ess, PORT_CODEC_STAT, 1) & CODEC_STAT_MASK) == 0)
+			return (0);
+		step += step;
+		DELAY(step);
 	}
-	return 0;
-}
 
+	return (EBUSY);
+}
 
 static inline int
 agg_rdcodec(struct agg_info *ess, int regno)
@@ -562,7 +564,7 @@
 /* -------------------------------------------------------------------- */
 
 /* Power management */
-static inline void
+static void
 agg_stopclock(struct agg_info *ess, int part, int st)
 {
 	u_int32_t data;
@@ -614,9 +616,9 @@
 		AGG_WR(ess, PORT_GPIO_MASK, 0xff6, 2);
 		AGG_WR(ess, PORT_GPIO_DIR, data | 0x009, 2);
 		AGG_WR(ess, PORT_GPIO_DATA, 0x000, 2);
-		DELAY(2);
+		DELAY(20);
 		AGG_WR(ess, PORT_GPIO_DATA, 0x001, 2);
-		DELAY(1);
+		DELAY(20);
 		AGG_WR(ess, PORT_GPIO_DATA, 0x009, 2);
 		agg_sleep(ess, "agginicd", 500);
 		AGG_WR(ess, PORT_GPIO_DIR, data, 2);

--9amGYk9869ThD9tj--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050915033658.GB17602>