Re: volume applet

Dmitriy Korovkin <[email protected]> Sun, 07 Jan 2007 22:11:37 +0300
Newsgroups gmane.comp.handhelds.opie.devel
Message-ID <[email protected]>
I have h5550. I had problem with volume applet.
I decided to fix the ak4535.c driver to handle the SOUND_MIXER_VOLUME
ioctl. Patch is attached. (It also makes side buttons work as up/down
buttons).
I submitted this patch to the familiar guys but had no response from
them. May be it's time to do it again.
Regards,

Dmitriy



Erik Hovland wrote:
> I am daft or does the volume applet do nothing?
>
> I am considering making it work with OSS since I have only seen h5x5x
> users complain and because alsa can still be compiled with an OSS
> compatibility module. But I would like to take the temperature of the
> list. One of the things that makes me lean this way is because the
> volume applet supports only three different levels and at least on h5x5x
> there are something like 6. So it begs for proper fixing (which begs for
> proper hardware abstraction).
>
> Anyhow, please give me your opinions. I especially want to know if the
> hx4700, zaurii and h2200 porters have the OSS compat module in their
> kernels.
>
> E
>
>

_______________________________________________

http://opie.handhelds.org/cgi-bin/moin.cgi/DeveloperWikiIndex

Opie-devel mailing list
[email protected]
https://handhelds.org/mailman/listinfo/opie-devel
ipaq5550_fun.patch (text/plain, 4.1 KB)
Index: arch/arm/mach-pxa/h5400_asic_io.c
===================================================================
RCS file: /cvs/linux/kernel/arch/arm/mach-pxa/h5400_asic_io.c,v
retrieving revision 1.36
diff -u -r1.36 h5400_asic_io.c
--- arch/arm/mach-pxa/h5400_asic_io.c	8 Mar 2004 23:38:21 -0000	1.36
+++ arch/arm/mach-pxa/h5400_asic_io.c	25 Sep 2005 18:43:39 -0000
@@ -62,8 +62,8 @@
 #define PERROR(format,arg...) printk(KERN_ERR __FILE__ ":%s - " format "\n", __FUNCTION__, ## arg)
 
 #define ADC_DATA_MASK	0x3ff
+#define MAX_BITS_IN_BUTTONS 14
 
-
 /***********************************************************************************
  *   ADC support (stolen from the H3900 code)
  ***********************************************************************************/
@@ -542,12 +542,12 @@
 	static unsigned long oldkeys;
 
 	bits = h5400_asic_read_register (H5400_ASIC_GPIO_GPA_DAT);
-
+	
 	keys = gpio_to_keys (bits);
 
 	d = keys ^ oldkeys;
-	
-	for (i = 0; i < 11; i++) {
+
+	for (i = 0; i < MAX_BITS_IN_BUTTONS; i++) {
 		if (d & (1 << i)) {
 			unsigned char down = (keys & (1 << i)) ? 1 : 0;
 			h3600_hal_keypress (H3600_MAKEKEY (i, down));
Index: drivers/char/h3600_ts.c
===================================================================
RCS file: /cvs/linux/kernel/drivers/char/h3600_ts.c,v
retrieving revision 1.76
diff -u -r1.76 h3600_ts.c
--- drivers/char/h3600_ts.c	27 Nov 2003 02:21:29 -0000	1.76
+++ drivers/char/h3600_ts.c	25 Sep 2005 18:43:46 -0000
@@ -140,9 +140,11 @@
         H3600_SCANCODE_RIGHT,    /* 7 -> right */
         H3600_SCANCODE_LEFT,     /* 8 -> left */
         H3600_SCANCODE_DOWN,     /* 9 -> down */
-	H3600_SCANCODE_ACTION,   /* 10 -> action button (synthesized, not from Atmel) */
-	H3600_SCANCODE_SUSPEND,  /* 11 -> power button (synthesized, not from Atmel)  */
-	0, 0, 0, 0               /* pad out to 16 total bytes */
+        H3600_SCANCODE_ACTION,   /* 10 -> action button (synthesized, not from Atmel) */
+        H3600_SCANCODE_SUSPEND,  /* 11 -> power button (synthesized, not from Atmel)  */
+        H3600_SCANCODE_UP,       /* 12 -> up */
+        H3600_SCANCODE_DOWN,     /* 13 -> down */
+				0, 0               /* pad out to 16 total bytes */
 };
 
 enum {
Index: drivers/sound/ak4535.c
===================================================================
RCS file: /cvs/linux/kernel/drivers/sound/ak4535.c,v
retrieving revision 1.23
diff -u -r1.23 ak4535.c
--- drivers/sound/ak4535.c	29 Mar 2005 23:28:35 -0000	1.23
+++ drivers/sound/ak4535.c	25 Sep 2005 18:43:53 -0000
@@ -25,7 +25,7 @@
 #include "ak4535.h"
 
 #define REC_MASK	(SOUND_MASK_LINE | SOUND_MASK_MIC)
-#define DEV_MASK (REC_MASK | SOUND_MASK_PCM |SOUND_MASK_BASS)
+#define DEV_MASK (REC_MASK | SOUND_MASK_PCM | SOUND_MASK_BASS | SOUND_MASK_VOLUME)
 
 #define REG_MAX 0x10
 
@@ -432,7 +432,6 @@
 
 		switch (nr) {
 		case SOUND_MIXER_PCM:
-			akm->volume = val;
 			akm->pcm = val;
 			akm->mod_cnt++;
 			/* input value [0,100], ak4535 uses [0,7] */
@@ -453,12 +452,15 @@
 		case SOUND_MIXER_TREBLE:
 			return -EINVAL;
 
+		case SOUND_MIXER_VOLUME:
 		case SOUND_MIXER_LINE:
+			akm->volume = val;
 			akm->line = val;
 			akm->mod_cnt++;
 			/* input value [0,100], ak4535 uses [255,0] */
 			val = gain.left;
-			val = 0xff & ~(255 * val / 100);
+////			val = 0xff & ~(255 * val / 100);
+			val = 156 - (val * 156) / 100;
 			ak4535_update(clnt, I2C_SET_LINE_GAIN, &val);
 			break;
 
Index: scripts/ipkg-make-kernel-packages
===================================================================
RCS file: /cvs/linux/kernel/scripts/ipkg-make-kernel-packages,v
retrieving revision 1.96
diff -u -r1.96 ipkg-make-kernel-packages
--- scripts/ipkg-make-kernel-packages	4 Jul 2004 22:37:09 -0000	1.96
+++ scripts/ipkg-make-kernel-packages	25 Sep 2005 18:44:05 -0000
@@ -762,11 +762,11 @@
 ############################################################
 popd
 
-ipkg-build -o root -g root $kernel_ipkg_src 
-ipkg-build -o root -g root $km_ipkg_src 
+ipkg-build $kernel_ipkg_src 
+ipkg-build $km_ipkg_src 
 
 for package_src in $package_srcs; do
-  ipkg-build -o root -g root $package_src 
+  ipkg-build $package_src 
 done
 
 rm -rf $tmpdir