any hope for maestro support?

Pyun YongHyeon pyunyh at gmail.com
Wed Sep 14 20:36:31 PDT 2005


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
-------------- next part --------------
--- 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);


More information about the freebsd-multimedia mailing list