Skip to contentSkip to conversation

Any missing patches?

PATCH In review Takashi Iwai 6 participants 23 messages Mar 20, 2006 – Apr 6, 2006 Documentation

lore
Share & tools
lore
#0 lore raw

Hi,

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#1 lore raw
Quoted 6 lines · Takashi Iwai

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

Here's a patch for generic dmix which fixes S16 byte swapping.

Tested on powerpc with snd-usb-audio. (Without the patch I get crackling.)

BTW: Is it normal that the dmix plug-in consumes 100% CPU?

Juergen

src/pcm/pcm_dmix_generic.c renamed from alsa-lib-1.0.11rc3/src/pcm/pcm_dmix_generic.c +2 -2
@@ -194,7 +194,7 @@ static void mix_areas1_swap(unsigned int
 	register signed int sample;
 
 	for (;;) {
-		sample = bswap_16(*src);
+		sample = (signed short) bswap_16(*src);
 		if (! *dst) {
 			*sum = sample;
 			*dst = *src;
@@ -205,7 +205,7 @@ static void mix_areas1_swap(unsigned int
 				sample = 0x7fff;
 			else if (sample < -0x8000)
 				sample = -0x8000;
-			*dst = bswap_16((signed short)sample);
+			*dst = (signed short) bswap_16((signed short) sample);
 		}
 		if (!--size)
 			return;

=

Signature · 9 lines
Juergen Kreileder, Blackdown Java-Linux Team
http://blog.blackdown.de/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
#2 lore raw

At Mon, 20 Mar 2006 21:18:33 +0100,

Quoted 6 lines · Juergen Kreileder
Quoted 3 lines · Takashi Iwai

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

Quoted 7 lines
Quoted 3 lines

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

Here's a patch for generic dmix which fixes S16 byte swapping.

Tested on powerpc with snd-usb-audio. (Without the patch I get crackling.)

Thanks. Applied now.

Quoted 1 line

BTW: Is it normal that the dmix plug-in consumes 100% CPU?

No, it's a new problem. Looks like happening only on ppc. Did it happen with the older kernel, too?

Anyway, the below are two different patches as workarounds. Could you test if either of them has any influence?

Takashi

Index: alsa-lib/src/pcm/pcm_direct.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-lib/src/pcm/pcm_direct.c,v retrieving revision 1.55

src/pcm/pcm_direct.c +13 -5
diff -u -r1.55 pcm_direct.c
@@ -1046,7 +1046,11 @@
 	char name[128];
 	int capture = dmix->type == SND_PCM_TYPE_DSNOOP ? 1 : 0;
 
+#ifdef __ppc__
+	dmix->tread = 0;
+#else
 	dmix->tread = 1;
+#endif
 	dmix->timer_need_poll = 0;
 	snd_pcm_info_alloca(&info);
 	ret = snd_pcm_info(dmix->spcm, info);
@@ -1059,14 +1063,18 @@
 				snd_pcm_info_get_card(info),
 				snd_pcm_info_get_device(info),
 				snd_pcm_info_get_subdevice(info) * 2 + capture);
-	ret = snd_timer_open(&dmix->timer, name, SND_TIMER_OPEN_NONBLOCK | SND_TIMER_OPEN_TREAD);
-	if (ret < 0) {
-		dmix->tread = 1;
-		ret = snd_timer_open(&dmix->timer, name, SND_TIMER_OPEN_NONBLOCK);
-		if (ret < 0) {
+	for (;;) {
+		int mode = SND_TIMER_OPEN_NONBLOCK;
+		if (dmix->tread)
+			mode |= SND_TIMER_OPEN_TREAD;
+		ret = snd_timer_open(&dmix->timer, name, mode);
+		if (ret >= 0)
+			break;
+		if (! dmix->tread) {
 			SNDERR("unable to open timer '%s'", name);
 			return ret;
 		}
+		dmix->tread = 0;
 	}
 
 	if (snd_timer_poll_descriptors_count(dmix->timer) != 1) {

Index: alsa-lib/src/pcm/pcm_direct.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-lib/src/pcm/pcm_direct.c,v retrieving revision 1.55

src/pcm/pcm_direct.c +4 -3
diff -u -r1.55 pcm_direct.c
@@ -522,9 +522,10 @@
 		}
 	} else {
 		if (dmix->tread) {
-			snd_timer_tread_t rbuf;
-			while (snd_timer_read(dmix->timer, &rbuf, sizeof(rbuf)) > 0)
-				process_timer_event(dmix, &rbuf);
+			char rbuf[sizeof(snd_timer_tread_t) * 2 - 1];
+			// snd_timer_tread_t rbuf;
+			while (snd_timer_read(dmix->timer, rbuf, sizeof(rbuf)) > 0)
+				; // process_timer_event(dmix, &rbuf);
 		} else {
 			snd_timer_read_t rbuf;
 			while (snd_timer_read(dmix->timer, &rbuf, sizeof(rbuf)) > 0)
#3 lore raw
Quoted 6 lines · Takashi Iwai

At Mon, 20 Mar 2006 21:18:33 +0100,

Quoted 1 line · Juergen Kreileder

BTW: Is it normal that the dmix plug-in consumes 100% CPU?

No, it's a new problem. Looks like happening only on ppc. Did it happen with the older kernel, too?

I'm not sure if it started with a kernel update or with the introduction of dmix in PMac.conf.

Quoted 2 lines

Anyway, the below are two different patches as workarounds. Could you test if either of them has any influence?

alsa-lib-pcm-timer-tread-for-ppc.diff works. The other patch had no effect.

Juergen

Signature · 9 lines
Juergen Kreileder, Blackdown Java-Linux Team
http://blog.blackdown.de/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
#4 lore raw

At Mon, 20 Mar 2006 22:15:03 +0100,

Quoted 10 lines · Juergen Kreileder
Quoted 6 lines · Takashi Iwai

At Mon, 20 Mar 2006 21:18:33 +0100,

Quoted 1 line · Juergen Kreileder

BTW: Is it normal that the dmix plug-in consumes 100% CPU?

No, it's a new problem. Looks like happening only on ppc. Did it happen with the older kernel, too?

Quoted 8 lines

I'm not sure if it started with a kernel update or with the introduction of dmix in PMac.conf.

Quoted 2 lines

Anyway, the below are two different patches as workarounds. Could you test if either of them has any influence?

alsa-lib-pcm-timer-tread-for-ppc.diff works. The other patch had no effect.

OK, I fixed now this problem on CVS. It's because of the difference of a struct read from 32bit app on 64bit kernel.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#5 lore raw
In reply to Takashi Iwai
Quoted 6 lines · Takashi Iwai

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

Here's a patch which adds support for S24_3LE and byte-swapped S16 and S32 to softvol. I've tested S24_3LE and byte-swapped S16 on powerpc with snd-usb-audio. All other cases are untested so far. (Config at http://blog.blackdown.de/static/alsa/USB-Audio.conf)

Juergen

src/pcm/pcm_softvol.c renamed from alsa-lib-1.0.11rc3/src/pcm/pcm_softvol.c +114 -25
@@ -96,10 +96,10 @@ typedef union {
 	int i;
 	short s[2];
 } val_t;
-static inline int MULTI_DIV_int(int a, unsigned short b)
+static inline int MULTI_DIV_int(int a, unsigned short b, int swap)
 {
 	val_t v, x, y;
-	v.i = a;
+	v.i = swap ? bswap_32(a) : a;
 	y.i = 0;
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 	x.i = (unsigned int)v.s[0] * b;
@@ -110,11 +110,14 @@ static inline int MULTI_DIV_int(int a, u
 	y.s[1] = x.s[0];
 	y.i += (int)v.s[0] * b;
 #endif
-	return y.i;
+	return swap ? bswap_32(y.i) : y.i;
 }
 
 /* (16bit x 16bit) >> 16 */
-#define MULTI_DIV_short(src,scale) (((int)(src) * (scale)) >> VOL_SCALE_SHIFT)
+#define MULTI_DIV_short(src, scale, swap)				  \
+(swap									  \
+ ? bswap_16(((short) bswap_16(src) * (scale)) >> VOL_SCALE_SHIFT)   \
+ : (((int) (src) * (scale)) >> VOL_SCALE_SHIFT))
 
 #endif /* DOC_HIDDEN */
 
@@ -125,7 +128,7 @@ static inline int MULTI_DIV_int(int a, u
  */
 
 #ifndef DOC_HIDDEN
-#define CONVERT_AREA(TYPE) do {	\
+#define CONVERT_AREA(TYPE, swap) do {	\
 	unsigned int ch, fr; \
 	TYPE *src, *dst; \
 	for (ch = 0; ch < channels; ch++) { \
@@ -150,15 +153,55 @@ static inline int MULTI_DIV_int(int a, u
 			} \
 		} else { \
 			while (fr--) { \
-				*dst = MULTI_DIV_##TYPE(*src, vol_scale);\
+				*dst = (TYPE) MULTI_DIV_##TYPE(*src, vol_scale, swap); \
 				src += src_step; \
 				dst += dst_step; \
 			} \
 		} \
 	} \
 } while (0)
-	
 
+#define CONVERT_AREA_S24_3LE() do {					\
+	unsigned int ch, fr;						\
+	unsigned char *src, *dst;					\
+	int tmp;							\
+	for (ch = 0; ch < channels; ch++) {				\
+		src_area = &src_areas[ch];				\
+		dst_area = &dst_areas[ch];				\
+		src = snd_pcm_channel_area_addr(src_area, src_offset);	\
+		dst = snd_pcm_channel_area_addr(dst_area, dst_offset);	\
+		src_step = snd_pcm_channel_area_step(src_area);		\
+		dst_step = snd_pcm_channel_area_step(dst_area);		\
+		GET_VOL_SCALE;						\
+		fr = frames;						\
+		if (! vol_scale) {					\
+			while (fr--) {					\
+				dst[0] = dst[1] = dst[2] = 0;		\
+				dst += dst_step;			\
+			}						\
+		} else if (vol_scale == 0xffff) {			\
+			while (fr--) {					\
+				dst[0] = src[0];			\
+				dst[1] = src[1];			\
+				dst[2] = src[2];			\
+				src += dst_step;			\
+				dst += src_step;			\
+			}						\
+		} else {						\
+			while (fr--) {					\
+				tmp = src[0] |				\
+				      (src[1] << 8) |			\
+				      (((signed char *) src)[2] << 16);	\
+				tmp = MULTI_DIV_int(tmp, vol_scale, 0);	\
+				dst[0] = tmp;				\
+				dst[1] = tmp >> 8;			\
+				dst[2] = tmp >> 16;			\
+				src += dst_step;			\
+				dst += src_step;			\
+			}						\
+		}							\
+	}								\
+} while (0)
 		
 #define GET_VOL_SCALE \
 	switch (ch) { \
@@ -204,12 +247,24 @@ static void softvol_convert_stereo_vol(s
 	vol[0] = svol->dB_value[svol->cur_vol[0]];
 	vol[1] = svol->dB_value[svol->cur_vol[1]];
 	vol_c = svol->dB_value[(svol->cur_vol[0] + svol->cur_vol[1]) / 2];
-	if (svol->sformat == SND_PCM_FORMAT_S16) {
+	switch (svol->sformat) {
+	case SND_PCM_FORMAT_S16_LE:
+	case SND_PCM_FORMAT_S16_BE:
 		/* 16bit samples */
-		CONVERT_AREA(short);
-	} else {
+		CONVERT_AREA(short, 
+			     !snd_pcm_format_cpu_endian(svol->sformat));
+		break;
+	case SND_PCM_FORMAT_S32_LE:
+	case SND_PCM_FORMAT_S32_BE:
 		/* 32bit samples */
-		CONVERT_AREA(int);
+		CONVERT_AREA(int,
+			     !snd_pcm_format_cpu_endian(svol->sformat));
+		break;
+	case SND_PCM_FORMAT_S24_3LE:
+		CONVERT_AREA_S24_3LE();
+		break;
+	default:
+		break;
 	}
 }
 
@@ -240,12 +295,24 @@ static void softvol_convert_mono_vol(snd
 	}
 
 	vol_scale = svol->dB_value[svol->cur_vol[0]];
-	if (svol->sformat == SND_PCM_FORMAT_S16) {
+	switch (svol->sformat) {
+	case SND_PCM_FORMAT_S16_LE:
+	case SND_PCM_FORMAT_S16_BE:
 		/* 16bit samples */
-		CONVERT_AREA(short);
-	} else {
+		CONVERT_AREA(short, 
+			     !snd_pcm_format_cpu_endian(svol->sformat));
+		break;
+	case SND_PCM_FORMAT_S32_LE:
+	case SND_PCM_FORMAT_S32_BE:
 		/* 32bit samples */
-		CONVERT_AREA(int);
+		CONVERT_AREA(int,
+			     !snd_pcm_format_cpu_endian(svol->sformat));
+		break;
+	case SND_PCM_FORMAT_S24_3LE:
+		CONVERT_AREA_S24_3LE();
+		break;
+	default:
+		break;
 	}
 }
 
@@ -287,14 +354,25 @@ static int snd_pcm_softvol_close(snd_pcm
 	return 0;
 }
 
-static int snd_pcm_softvol_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED,
+static int snd_pcm_softvol_hw_refine_cprepare(snd_pcm_t *pcm,
 					      snd_pcm_hw_params_t *params)
 {
 	int err;
+	snd_pcm_softvol_t *svol = pcm->private_data;
 	snd_pcm_access_mask_t access_mask = { SND_PCM_ACCBIT_SHM };
 	snd_pcm_format_mask_t format_mask = {
-		{ (1U << SND_PCM_FORMAT_S16) | (1U << SND_PCM_FORMAT_S32) }
+		{
+			(1ULL << SND_PCM_FORMAT_S16_LE) |
+			(1ULL << SND_PCM_FORMAT_S16_BE) |
+			(1ULL << SND_PCM_FORMAT_S32_LE) |
+ 			(1ULL << SND_PCM_FORMAT_S32_BE),
+			(1ULL << (SND_PCM_FORMAT_S24_3LE - 32))
+		}
 	};
+	if (svol->sformat != SND_PCM_FORMAT_UNKNOWN) {
+		snd_pcm_format_mask_none(&format_mask);
+		snd_pcm_format_mask_set(&format_mask, svol->sformat);
+	}
 	err = _snd_pcm_hw_param_set_mask(params, SND_PCM_HW_PARAM_ACCESS,
 					 &access_mask);
 	if (err < 0)
@@ -396,9 +474,13 @@ static int snd_pcm_softvol_hw_params(snd
 					  snd_pcm_generic_hw_params);
 	if (err < 0)
 		return err;
-	if (slave->format != SND_PCM_FORMAT_S16 &&
-	    slave->format != SND_PCM_FORMAT_S32) {
-		SNDERR("softvol supports only S16 or S32");
+	if (slave->format != SND_PCM_FORMAT_S16_LE &&
+	    slave->format != SND_PCM_FORMAT_S16_BE &&
+	    slave->format != SND_PCM_FORMAT_S24_3LE && 
+	    slave->format != SND_PCM_FORMAT_S32_LE &&
+	    slave->format != SND_PCM_FORMAT_S32_BE) {
+		SNDERR("softvol supports only S16_LE, S16_BE, S24_3LE, S32_LE "
+		       " or S32_BE");
 		return -EINVAL;
 	}
 	svol->sformat = slave->format;
@@ -619,8 +701,11 @@ int snd_pcm_softvol_open(snd_pcm_t **pcm
 	int err;
 	assert(pcmp && slave);
 	if (sformat != SND_PCM_FORMAT_UNKNOWN &&
-	    sformat != SND_PCM_FORMAT_S16 &&
-	    sformat != SND_PCM_FORMAT_S32)
+	    sformat != SND_PCM_FORMAT_S16_LE &&
+	    sformat != SND_PCM_FORMAT_S16_BE &&
+	    sformat != SND_PCM_FORMAT_S24_3LE && 
+	    sformat != SND_PCM_FORMAT_S32_LE &&
+	    sformat != SND_PCM_FORMAT_S32_BE)
 		return -EINVAL;
 	svol = calloc(1, sizeof(*svol));
 	if (! svol)
@@ -808,9 +893,13 @@ int _snd_pcm_softvol_open(snd_pcm_t **pc
 	if (err < 0)
 		return err;
 	if (sformat != SND_PCM_FORMAT_UNKNOWN &&
-	    sformat != SND_PCM_FORMAT_S16 &&
-	    sformat != SND_PCM_FORMAT_S32) {
-		SNDERR("only S16 or S32 format is supported");
+	    sformat != SND_PCM_FORMAT_S16_LE &&
+	    sformat != SND_PCM_FORMAT_S16_BE &&
+	    sformat != SND_PCM_FORMAT_S24_3LE && 
+	    sformat != SND_PCM_FORMAT_S32_LE &&
+	    sformat != SND_PCM_FORMAT_S32_BE) {
+		SNDERR("only S16_LE, S16_BE, S24_3LE, S32_LE or S32_BE format "
+		       "is supported");
 		snd_config_delete(sconf);
 		return -EINVAL;
 	}

=

Signature · 9 lines
Juergen Kreileder, Blackdown Java-Linux Team
http://blog.blackdown.de/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
#6 lore raw

At Mon, 20 Mar 2006 21:26:47 +0100,

Quoted 6 lines · Juergen Kreileder
Quoted 3 lines · Takashi Iwai

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

Quoted 8 lines
Quoted 3 lines

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

Here's a patch which adds support for S24_3LE and byte-swapped S16 and S32 to softvol. I've tested S24_3LE and byte-swapped S16 on powerpc with snd-usb-audio. All other cases are untested so far. (Config at http://blog.blackdown.de/static/alsa/USB-Audio.conf)

Ok, it's a bit bigger to apply too quickly. I'll check and apply it tomorrow.

Thanks,

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#7 lore raw
In reply to Juergen Kreileder

At Mon, 20 Mar 2006 21:26:47 +0100,

Quoted 16 lines · Juergen Kreileder
Quoted 6 lines · Takashi Iwai

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

Here's a patch which adds support for S24_3LE and byte-swapped S16 and S32 to softvol. I've tested S24_3LE and byte-swapped S16 on powerpc with snd-usb-audio. All other cases are untested so far. (Config at http://blog.blackdown.de/static/alsa/USB-Audio.conf)

Quoted 3 lines

Juergen

Applied to CVS now. I couldn't test all cases, too, but it's no regression at least :)

Thanks.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#8 lore raw
In reply to Takashi Iwai

Hi,

Quoted 2 lines

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

Here is a small and really not urgent patch (but since it is "time to push Linux kernel tree" :).

Summary: Fixes typos in alsa-kernel/Documentation/Audiophile-USB.txt

Documentation/Audiophile-Usb.txt.new renamed from Documentation/Audiophile-Usb.txt +16 -13
@@ -1,4 +1,4 @@
-	Guide to using M-Audio Audiophile USB with ALSA and Jack	v1.1
+	Guide to using M-Audio Audiophile USB with ALSA and Jack	v1.2
 	========================================================
 
 	    Thibault Le Meur <[email protected]>
@@ -13,6 +13,9 @@
 
 The device has 4 audio interfaces, and 2 MIDI ports:
  * Analog Stereo Input (Ai)
+   - This port supports 2 pairs of line-level audio inputs (1/4" TS and RCA) 
+   - When the 1/4" TS (jack) connectors are connected, the RCA connectors
+     are disabled
  * Analog Stereo Output (Ao)
  * Digital Stereo Input (Di)
  * Digital Stereo Output (Do)
@@ -42,7 +45,7 @@
 though I haven't tested it under linux
    - Note that in this setup only the Do interface can be enabled
  * Apart from recording an audio digital stream, enabling the Di port is a way 
-to syncrhonize the device to an external sample clock
+to synchronize the device to an external sample clock
    - As a consequence, the Di port must be enable only if an active Digital 
 source is connected
    - Enabling Di when no digital source is connected can result in a 
@@ -180,7 +183,7 @@
      or changing modprobe.conf)
    - turn on the device
 
-2.2.2.3 - Setting and switching configurations with the device_setup parameter
+2.2.2.3 - Audiophile USB's device_setup structure
 
 If you want to understand the device_setup magic numbers for the Audiophile 
 USB, you need some very basic understanding of binary computation. However, 
@@ -226,7 +229,7 @@
    - choosing b2 will prepare all interfaces for 24bits/96kHz but you'll
      only be able to use one at the same time
 
-2.2.3 -  Technical Details for Audiophile Usb 
+2.2.3 -  USB implementation details for this device
 
 You may safely skip this section if you're not interrested in driver 
 development.
@@ -234,20 +237,20 @@
 This section describes some internals aspect of the device and summarize the 
 data I got by usb-snooping the windows and linux drivers.
 
-The M-Audio Audiophile USB has 7 Usb Interfaces:
+The M-Audio Audiophile USB has 7 USB Interfaces:
 a "USB interface":
- * Usb Interface nb.0
- * Usb Interface nb.1
+ * USB Interface nb.0
+ * USB Interface nb.1
    - Audio Control function
- * Usb Interface nb.2
+ * USB Interface nb.2
    - Analog Output
- * Usb Interface nb.3
+ * USB Interface nb.3
    - Digital Output
- * Usb Interface nb.4
+ * USB Interface nb.4
    - Analog Input
- * Usb Interface nb.5
+ * USB Interface nb.5
    - Digital Input
- * Usb Interface nb.6
+ * USB Interface nb.6
    - MIDI interface compliant with the MIDIMAN quirk 
 
 Each interface has 5 altsettings (AltSet 1,2,3,4,5) except:
@@ -326,5 +329,5 @@
 
 After having applied the patch you can run jackd with the following command 
 line:
-# /usr/local/bin/jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1
+  % jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1
 
author Applied
#9 lore raw

At Tue, 21 Mar 2006 10:15:33 +0100,

Quoted 6 lines · Thibault LE MEUR

Hi,

Quoted 2 lines

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

Quoted 6 lines

Here is a small and really not urgent patch (but since it is "time to push Linux kernel tree" :).

Summary: Fixes typos in alsa-kernel/Documentation/Audiophile-USB.txt

Applied to CVS. Thanks.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#10 lore raw
In reply to Takashi Iwai

Hi Takashi,

Quoted 7 lines

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

if you don't mind, I'd like to polish ALC260 acer model a bit. I'll hopefully send a small untested patch for it this evening.

Rimas

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#11 lore raw

At Tue, 21 Mar 2006 12:18:17 +0200,

Quoted 6 lines · Rimas Kudelis

Hi Takashi,

Quoted 3 lines

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

Quoted 7 lines
Quoted 4 lines

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

if you don't mind, I'd like to polish ALC260 acer model a bit. I'll hopefully send a small untested patch for it this evening.

Yes, I'll sync up all patches in today, so hopefully it will get into the tree in the right time.

We'll have also a bit time after rc4 until the final release (but not long this time). If the patch isn't too destructive, it can be merged after rc4, too.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#12 lore raw

Hello,

Quoted 6 lines

Yes, I'll sync up all patches in today, so hopefully it will get into the tree in the right time.

We'll have also a bit time after rc4 until the final release (but not long this time). If the patch isn't too destructive, it can be merged after rc4, too.

The patch just removes some controls from the mixer.

BTW i heard they released Linux 2.6.16 today. Does it have what is in CVS (acer and other fixes)?

Rimas

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#13 lore raw

At Tue, 21 Mar 2006 13:30:36 +0200,

Quoted 6 lines · Rimas Kudelis

Hello,

Quoted 3 lines

Yes, I'll sync up all patches in today, so hopefully it will get into the tree in the right time.

Quoted 7 lines
Quoted 3 lines

We'll have also a bit time after rc4 until the final release (but not long this time). If the patch isn't too destructive, it can be merged after rc4, too.

The patch just removes some controls from the mixer.

BTW i heard they released Linux 2.6.16 today. Does it have what is in CVS (acer and other fixes)?

No. It'll be in 2.6.17.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#14 lore raw
In reply to Takashi Iwai

Hi,

this patch cleans up the mixer interface by removing unpractical/non-working features. Applies for ALC260 "acer" model in hda-intel module. It also adds/changes a few comments in the source.

The patch is tested and works with an Acer Travelmate 4061NLMi.

Rimas Kudelis <[email protected]>

pci/hda/patch_realtek.c renamed from pci/hda/patch_realtek.c.orig +22 -21
@@ -2738,16 +2738,14 @@
 	},
 };
 
-/* Acer TravelMate(/Extensa/Aspire) notebooks have similar configutation to
- * the Fujitsu S702x, but jacks are marked differently. We won't allow
- * retasking the Headphone jack, so it won't be available here.
+/* Capture sources suitable for Acer TravelMate 4060, Aspire 1640 and similar
+ * laptops.
  */
 static struct hda_input_mux alc260_acer_capture_source = {
-	.num_items = 3,
+	.num_items = 2,
 	.items = {
 		{ "Mic", 0x0 },
 		{ "Line", 0x2 },
-		{ "CD", 0x4 },
 	},
 };
 
@@ -2830,16 +2828,18 @@
 static struct snd_kcontrol_new alc260_acer_mixer[] = {
 	HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
 	HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT),
-	HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
-	HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
 	HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
 	HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
-	ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
+	/* Mic jack works as output too, actually, but it only outputs both stereo
+	 * channels mixed to left channel then. Furthermore, the same pin is
+	 * connected to the internal microphone. So, let's forget it.
+	 */
 	HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
 	HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
+	/* Line jack doesn't actually preamplify the mic even if set to one of the
+	 * Mic modes. However, it doesn't seem like these can be disabled ATM.
+	 */
 	ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
-	HDA_CODEC_VOLUME("Beep Playback Volume", 0x07, 0x05, HDA_INPUT),
-	HDA_CODEC_MUTE("Beep Playback Switch", 0x07, 0x05, HDA_INPUT),
 	{ } /* end */
 };
 
@@ -3128,18 +3128,18 @@
  * similar laptops (adapted from Fujitsu init verbs).
  */
 static struct hda_verb alc260_acer_init_verbs[] = {
-	/* On TravelMate laptops, GPIO 0 enables the internal speaker and
-	 * the headphone jack.  Turn this on and rely on the standard mute
-	 * methods whenever the user wants to turn these outputs off.
+	/* On TravelMate 4060, Aspire 1640 and similar laptops, GPIO 0 enables the
+	 * internal speaker and the headphone jack. Turn this on and rely on the
+	 * standard mute methods whenever the user wants to turn these outputs off.
 	 */
 	{0x01, AC_VERB_SET_GPIO_MASK, 0x01},
 	{0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
 	{0x01, AC_VERB_SET_GPIO_DATA, 0x01},
-	/* Internal speaker/Headphone jack is connected to Line-out pin */
+	/* Internal speaker and Headphone jack are connected to line-out pin */
 	{0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
-	/* Internal microphone/Mic jack is connected to Mic1 pin */
+	/* Internal microphone and Mic jack are connected to mic1 pin */
 	{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
-	/* Line In jack is connected to Line1 pin */
+	/* Line In jack is connected to line1 pin */
 	{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
 	/* Ensure all other unused pins are disabled and muted. */
 	{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
@@ -3154,7 +3154,7 @@
 	{0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
 	{0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
 
-	/* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum 
+	/* Ensure mic1 and line1 pin widgets take input from the OUT1 sum 
 	 * bus when acting as outputs.
 	 */
 	{0x0b, AC_VERB_SET_CONNECT_SEL, 0},
@@ -3173,10 +3173,10 @@
 
 	/* Unmute Line-out pin widget amp left and right (no equiv mixer ctrl) */
 	{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-	/* Unmute Mic1 and Line1 pin widget input buffers since they start as
+	/* Unmute mic1 and line1 pin widget input buffers since they start as
 	 * inputs. If the pin mode is changed by the user the pin mode control
 	 * will take care of enabling the pin's input/output buffers as needed.
-	 * Therefore there's no need to enable the input buffer at this
+	 * Therefore there's no need to enable the output buffer at this
 	 * stage.
 	 */
 	{0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
@@ -3184,13 +3184,14 @@
 
 	/* Mute capture amp left and right */
 	{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-	/* Set ADC connection select to match default mixer setting - mic
+	/* Set ADC connection select to match default mixer setting - Mic
 	 * (on mic1 pin)
 	 */
 	{0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
 
 	/* Do similar with the second ADC: mute capture input amp and
-	 * set ADC connection to line (on line1 pin)
+	 * set ADC connection to Line (on line1 pin)
+	 * FIXME: the connection is still set to Mic for some reason
 	 */
 	{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
 	{0x05, AC_VERB_SET_CONNECT_SEL, 0x02},
#15 lore raw
Quoted 9 lines · Rimas Kudelis

Hi,

this patch cleans up the mixer interface by removing unpractical/non-working features. Applies for ALC260 "acer" model in hda-intel module. It also adds/changes a few comments in the source.

The patch is tested and works with an Acer Travelmate 4061NLMi.

Rimas Kudelis <[email protected]>

Did you verify (eg with Windows) that CD is not connected to anything or is this just speculation?

Lee

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#16 lore raw

At Tue, 21 Mar 2006 17:06:43 -0500,

Quoted 8 lines · Lee Revell
Quoted 6 lines · Rimas Kudelis

Hi,

this patch cleans up the mixer interface by removing unpractical/non-working features. Applies for ALC260 "acer" model in hda-intel module. It also adds/changes a few comments in the source.

Quoted 6 lines
Quoted 3 lines

The patch is tested and works with an Acer Travelmate 4061NLMi.

Rimas Kudelis <[email protected]>

Did you verify (eg with Windows) that CD is not connected to anything or is this just speculation?

If CD doesn't work despite Mic/Line works with the latest code, it implies that the CD analog doesn't exist. Of course, you should check the codec proc file and the corresponding PIN setup to make sure.

I wouldn't be surprised at all if CD analog doesn't exist. Most of recent laptops have really no CD analog input. Disabling unfunctional things is good for usability.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#17 lore raw
In reply to Takashi Iwai
Quoted 9 lines · Takashi Iwai

Hi,

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

Can you look at bug #1952 (speakers not disabled when headphones plugged with hda-intel + STAC92xx)? amixer output shows no "Jack sense" controls present. It looks like it just needs an HP_MUTE quirk (or whatever the hda-intel equivalent is)

Lee

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#18 lore raw
Quoted 11 lines · Lee Revell
Quoted 9 lines · Takashi Iwai

Hi,

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

Quoted 4 lines

Can you look at bug #1952 (speakers not disabled when headphones plugged with hda-intel + STAC92xx)? amixer output shows no "Jack sense" controls present. It looks like it just needs an HP_MUTE quirk (or whatever the hda-intel equivalent is)

Never mind - user reports fixed in CVS.

Lee

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#19 lore raw
In reply to Takashi Iwai
Quoted 8 lines · Takashi Iwai

Hi,

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

It would also be nice if everyone with developer access to the bug tracker could take a few minutes to look at some old bugs and clear the invalid or fixed ones, ask for feedback, mark some relationships, etc. I spent an hour or two on this yesterday and was able to close ~50 bugs (out of about 700 open). At this rate we could clean up the bug tracker nicely with just a few hours developer time.

Lee

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#20 lore raw

At Wed, 22 Mar 2006 13:32:41 -0500,

Quoted 11 lines · Lee Revell
Quoted 8 lines · Takashi Iwai

Hi,

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

I think the current ALSA CVS tree is forming to a relatively good shape now, and it's good time to push Linux kernel tree, too. Let's be not too late to ride a bus.

Quoted 6 lines

It would also be nice if everyone with developer access to the bug tracker could take a few minutes to look at some old bugs and clear the invalid or fixed ones, ask for feedback, mark some relationships, etc. I spent an hour or two on this yesterday and was able to close ~50 bugs (out of about 700 open). At this rate we could clean up the bug tracker nicely with just a few hours developer time.

Thanks for doing that!
Yeah, it's a thing like a homework for a summer vacation ;)

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

#21 lore raw

PATCH 1/1 asihpi unbalanced spinlocks

In reply to Takashi Iwai
Quoted 4 lines · Takashi Iwai

Hi,

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

Fix unbalanced spin_lock/unlocks
(Note we have huge changes in the pipeline, but lets get this hopefully uncontroversial fix in first)

asihpi.c renamed from asihpi_orig.c +3 -0
@@ -1825,6 +1825,7 @@
 				    &wSourceType, &wSourceIndex);
 	HPI_Multiplexer_SetSource(phSubSys, hControl, wSourceType,
 				  wSourceIndex);
+	spin_unlock_irqrestore(&asihpi->mixer_lock, flags);
 	return change;
 }
 
@@ -1902,6 +1903,7 @@
 
 	HPI_ChannelModeSet(phSubSys, hControl,
 			   ucontrol->value.enumerated.item[0] + 1);
+	spin_unlock_irqrestore(&asihpi->mixer_lock, flags);
 	return change;
 }
 
@@ -1979,6 +1981,7 @@
 
 	HPI_SampleClock_SetSource(phSubSys, hControl,
 				  ucontrol->value.enumerated.item[0] + 1);
+	spin_unlock_irqrestore(&asihpi->mixer_lock, flags);
 	return change;
 }
 
asihpi.c renamed from asihpi_orig.c +3 -0
@@ -1825,6 +1825,7 @@
 				    &wSourceType, &wSourceIndex);
 	HPI_Multiplexer_SetSource(phSubSys, hControl, wSourceType,
 				  wSourceIndex);
+	spin_unlock_irqrestore(&asihpi->mixer_lock, flags);
 	return change;
 }
 
@@ -1902,6 +1903,7 @@
 
 	HPI_ChannelModeSet(phSubSys, hControl,
 			   ucontrol->value.enumerated.item[0] + 1);
+	spin_unlock_irqrestore(&asihpi->mixer_lock, flags);
 	return change;
 }
 
@@ -1979,6 +1981,7 @@
 
 	HPI_SampleClock_SetSource(phSubSys, hControl,
 				  ucontrol->value.enumerated.item[0] + 1);
+	spin_unlock_irqrestore(&asihpi->mixer_lock, flags);
 	return change;
 }
 
#22 lore raw

Re: [PATCH] asihpi unbalanced spinlocks

At Wed, 5 Apr 2006 15:58:12 +1200,

Quoted 4 lines · Eliot Blennerhassett
Quoted 2 lines · Takashi Iwai

Hi,

Quoted 8 lines
Quoted 2 lines

if someone has patches intended for merging to ALSA tree, please submit them ASAP.

Fix unbalanced spin_lock/unlocks
(Note we have huge changes in the pipeline, but lets get this hopefully uncontroversial fix in first)

Thanks, now committed to ALSA tree.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642