Jump to content


Photo

[TUT-KERNEL] How to build a kernel for Acer Based ROMs

* * * * * 1 votes

  • Please log in to reply
101 replies to this topic

#41
thepasto

thepasto

    Diehard

  • Members
  • PipPipPipPip
  • 430 posts
  • Gender:Male
  • Devices:Acer Liquid E
  • Twitter:@thepasto

Great news, thepasto fixed the problem. I'm compiling a new kernel right now. Download: http://www.multiupload.com/R5USTQFUEZ


I hope it is solved :rolleyes: i can't test it because i don't have this problem... Anyway for now only a bad workaround not really a solution :P

  • 0

Posted Image


Don't want to change phone yet? Support the devs!! :)


Posted Image


#42
rithchen

rithchen

    Regular

  • Members
  • PipPip
  • 67 posts

Okay, here is pastebin link:

apanic_20110519
And I upload the txt file here too.


What clock rate are you use?
And did you use my fix2 kerenl to compare?

I raise the voltage to 1300mv at 883mhz.
If your crash situation(gunfabio's kernel) was above 768mhz, change the speed to 768mhz, and try again.

BTW, i still working on the voice issue on skype, and it's not about mic, it's about audio encoding in qualcomm's dsp.

  • 0

#43
groverkai

groverkai

    Newbie

  • Members
  • Pip
  • 11 posts

I hope it is solved :D i can't test it because i don't have this problem... Anyway for now only a bad workaround not really a solution :rolleyes:


It works! Thank you gnufabio and thepasto <_<

What clock rate are you use?
And did you use my fix2 kerenl to compare?

I raise the voltage to 1300mv at 883mhz.
If your crash situation(gunfabio's kernel) was above 768mhz, change the speed to 768mhz, and try again.

BTW, i still working on the voice issue on skype, and it's not about mic, it's about audio encoding in qualcomm's dsp.


I use OC 998mhz because it is stable to me since 2.1 eclair. :D

I've tried your kernel (v1fix repacked by PhoenixWright) with fear_custom rom, and your kernel (v2fix) with T&L .08 rom.
Your kernel won't reboot but gnufabio's will.

It only reboots when connecting to PC, so I think OC is not the problem.....I guess :D
And rithchen your kernel is very great , besdies the temperature.

I just tried to set the speed to 768mhz but it still reboots. :P
It works now with the newset patch.



There is another discussion about Liquid reboot. HERE
Maybe some other roms also have this problem though there are fewer users have this situation.
Hope my questions can help you to make our Liquid better :(

Edited by groverkai, 19 May 2011 - 05:24 AM.

  • 0

#44
gnufabio

gnufabio

    Addict

  • Members
  • PipPipPipPipPip
  • 729 posts
  • Gender:Male
  • Devices:Acer liquid A1, Asus TF101
  • Twitter:@gnufabio

It works! Thank you gnufabio and thepasto :P
It works now with the newset patch.


Great :rolleyes:

  • 0

#45
ahyim

ahyim

    Newbie

  • Members
  • Pip
  • 6 posts
  • Devices:Acer Liquid
  • Twitter:@ahyim

I hope it is solved :rolleyes: i can't test it because i don't have this problem... Anyway for now only a bad workaround not really a solution :P

Thank you for great kernel, but I install your kernel all work fine except the buletooth cannot be turning on. Will you try to test it?

  • 0

#46
gnufabio

gnufabio

    Addict

  • Members
  • PipPipPipPipPip
  • 729 posts
  • Gender:Male
  • Devices:Acer liquid A1, Asus TF101
  • Twitter:@gnufabio

Thank you for great kernel, but I install your kernel all work fine except the buletooth cannot be turning on. Will you try to test it?

Do you mean on acer stock roms?

  • 0

#47
ahyim

ahyim

    Newbie

  • Members
  • Pip
  • 6 posts
  • Devices:Acer Liquid
  • Twitter:@ahyim

Do you mean on acer stock roms?

I try on this rom 4.005.05.AAP.GEN2_A22F_A_256mb_bbs.gfan.com

  • 0

#48
gnufabio

gnufabio

    Addict

  • Members
  • PipPipPipPipPip
  • 729 posts
  • Gender:Male
  • Devices:Acer liquid A1, Asus TF101
  • Twitter:@gnufabio

I try on this rom 4.005.05.AAP.GEN2_A22F_A_256mb_bbs.gfan.com

Uhm, i didn't tested bluetooth, have anyone the same problem?

  • 0

#49
ahyim

ahyim

    Newbie

  • Members
  • Pip
  • 6 posts
  • Devices:Acer Liquid
  • Twitter:@ahyim
Thanks gnufabio,

The bluetooth is ok on 4.002.14.EMEA.GEN1_A22F_A_256.

  • 0

#50
gnufabio

gnufabio

    Addict

  • Members
  • PipPipPipPipPip
  • 729 posts
  • Gender:Male
  • Devices:Acer liquid A1, Asus TF101
  • Twitter:@gnufabio

Thanks gnufabio,

The bluetooth is ok on 4.002.14.EMEA.GEN1_A22F_A_256.

So it worked? Great :P

  • 0

#51
rithchen

rithchen

    Regular

  • Members
  • PipPip
  • 67 posts

What clock rate are you use?
And did you use my fix2 kerenl to compare?

I raise the voltage to 1300mv at 883mhz.
If your crash situation(gunfabio's kernel) was above 768mhz, change the speed to 768mhz, and try again.

BTW, i still working on the voice issue on skype, and it's not about mic, it's about audio encoding in qualcomm's dsp.


I uploaded my voice iput fix, and here is what i have done.

fix vibrator problem
--- drivers/i2c/chips/avr.c 2011-05-21 21:26:04.918463238 -0700
+++ ../gnufabio-acer_liquid_chocolate-5318d09_ori/drivers/i2c/chips/avr.c 2011-05-21 21:25:24.766483670 -0700
@@ -74,21 +74,19 @@

#define AVR_KEYMASK_DIRECTION (AVR_KEY_UP|AVR_KEY_DOWN|AVR_KEY_LEFT|AVR_KEY_RIGHT)

-#define AVR_LED_DELAY_TIME 10000
+#define AVR_LED_DELAY_TIME 5000

#define BACKLIGHT_LEVEL_ON 0x8

/* AVR Sensitivity */
#define USE_FS 1
#define SENSITIVITY_REG 0x60
-#define SENSITIVITY 20
+#define SENSITIVITY 30

/* Vibrator */
-#define PM_LIBPROG 0x30000061
-#define PM_LIBVERS 0x10001
-#define ONCRPC_PM_VIB_MOT_SET_VOLT_PROC 22
-#define ONCRPC_PM_VIB_MOT_SET_MODE_PROC 23
-#define VIB_DELAY_TIME 30
+#define VIB_DELAY_TIME 35
+void pmic_vibrator_on(struct work_struct *work);
+void pmic_vibrator_off(struct work_struct *work);

static int __init avr_init(void);
static int avr_probe(struct i2c_client *client, const struct i2c_device_id *id);
@@ -108,6 +106,7 @@
static void low_power_mode(struct i2c_client *client, int mode);
static void key_clear(struct i2c_client *client);
static void avr_led_work_func(struct work_struct *work);
+static void avr_vib_work_func(struct work_struct *work);
#ifdef CONFIG_HAS_EARLYSUSPEND
static void avr_early_suspend(struct early_suspend *h);
static void avr_early_resume(struct early_suspend *h);
@@ -119,15 +118,16 @@
static bool kpd_pwr_key_check = false;
static struct mutex avr_mutex;
static struct delayed_work led_wq;
-static bool led_call = false;
+static struct delayed_work vib_wq;
+
+static int vibr=1;
+module_param(vibr, int, S_IRUGO | S_IWUSR | S_IWGRP);

static const struct i2c_device_id avr_id[] = {
{ AVR_DRIVER_NAME, 0 },
{ }
};

-
-
/* Data for I2C driver */
static struct avr_data {
struct i2c_client *client;
@@ -139,6 +139,7 @@
#endif
unsigned long last_jiffies;
int prekey;
+ int suspended;
} avr_data;

/*File operation of AVR device file */
@@ -223,20 +224,6 @@

#endif

-static int __init avr_init(void)
-{
- int res=0;
-
- res = i2c_add_driver(&avr_driver);
-
- if (res){
- pr_err("[AVR]i2c_add_driver failed! \n");
- return res;
- }
-
- return 0;
-}
-
static int avr_probe(struct i2c_client *client, const struct i2c_device_id *id)
{

@@ -264,6 +251,7 @@
init_waitqueue_head(&avr_data.wait);

INIT_DELAYED_WORK(&led_wq, avr_led_work_func);
+ INIT_DELAYED_WORK(&vib_wq, avr_vib_work_func);

/* input register */
avr_data.input = input_allocate_device();
@@ -382,24 +370,26 @@
#ifdef CONFIG_HAS_EARLYSUSPEND
static void avr_early_suspend(struct early_suspend *h)
{
- pr_info("[AVR] %s ++ entering\n", __FUNCTION__);
+ pr_debug("[AVR] %s ++ entering\n", __FUNCTION__);

- led_call = false;
kpd_resume_check = false;
+ avr_data.suspended=1;
key_clear(avr_data.client);
+ led_off(avr_data.client);
disable_irq(avr_data.client->irq);
- low_power_mode(avr_data.client,1);
+ low_power_mode(avr_data.client, 1);

- pr_info("[AVR] %s -- leaving\n", __FUNCTION__);
+ pr_debug("[AVR] %s -- leaving\n", __FUNCTION__);
}

static void avr_early_resume(struct early_suspend *h)
{
- pr_info("[AVR] %s ++ entering\n", __FUNCTION__);
+ pr_debug("[AVR] %s ++ entering\n", __FUNCTION__);

low_power_mode(avr_data.client,0);
enable_irq(avr_data.client->irq);

+ avr_data.suspended=0;
kpd_resume_check = true;

if(kpd_pwr_key_check){
@@ -407,7 +397,7 @@
led_on(avr_data.client);
}

- pr_info("[AVR] %s -- leaving\n", __FUNCTION__);
+ pr_debug("[AVR] %s -- leaving\n", __FUNCTION__);
}
#endif

@@ -464,17 +454,17 @@
mutex_unlock(&avr_mutex);
return;
}
-
+
cancel_delayed_work(&led_wq);

- if ( key_st != 0)
- {
+ /* TODO: Check KPD LED Function */
+ if ( key_st != 0)
led_on(client);
- led_call = true;
- }
else
schedule_delayed_work(&led_wq, msecs_to_jiffies(AVR_LED_DELAY_TIME));

+
+
if(kpd_fw_check) {
switch(key_st){
case AVR_KEY_MENU:
@@ -526,6 +516,10 @@
/* Send key release if not equal to last key */
if( key_code != avr_data.prekey ){
input_report_key(avr_data.input, avr_data.prekey, 0);
+ if(vibr == 1 && key_code != 0) {
+ pmic_vibrator_on(NULL);
+ schedule_delayed_work(&vib_wq, msecs_to_jiffies(VIB_DELAY_TIME));
+ }
}
/* Send key press if key_code != 0 */
if( key_code ) {
@@ -589,14 +583,6 @@
return -ENOTTY;
}

- if(_IOC_DIR(cmd) & _IOC_READ)
- err = !access_ok(VERIFY_WRITE,(void __user*)arg, _IOC_SIZE(cmd));
- else if(_IOC_DIR(cmd) & _IOC_WRITE)
- err = !access_ok(VERIFY_READ, (void __user*)arg, _IOC_SIZE(cmd));
- if(err){
- pr_err("cmd access_ok error\n");
- return -EFAULT;
- }
if( client == NULL){
pr_err("I2C driver not install (AVR_ioctl)\n");
return -EFAULT;
@@ -613,11 +599,6 @@
pr_debug("[AVR] IOCTL_bSIMPLE_TEST_ON. \n");
break;
case IOCTL_SET_LED_ON:
- if(led_call){
- led_call = false;
- return 0;
- }
-
if(kpd_resume_check){
data_buf[0] = I2C_REG_LED_1;
data_buf[1] = AVR_LED_ON;
@@ -681,7 +662,7 @@
i2c_write(client, data_buf);
mutex_unlock(&avr_mutex);

- pr_debug("[AVR] IOCTL_SET_BL_LV, Set backlight 0x%02X. \n", data_buf[1]);
+ pr_debug("[AVR] IOCTL_SET_BL_LV, Set backlight 0x%02X (asked 0x%02X). \n", data_buf[1], arg);
return err;
case IOCTL_KEY_LOCK_TOGGLE:
data_buf[0] = I2C_REG_KEY_LOCK;
@@ -757,6 +738,8 @@
static void led_on(struct i2c_client *client){
uint8_t data_buf[2] = {0};

+ if(!client)
+ return;
data_buf[0] = I2C_REG_LED_1;
data_buf[1] = AVR_LED_ON;
i2c_write(client, data_buf);
@@ -809,10 +792,66 @@
pr_debug("[AVR] Clear Key Value.\n");
}

-static void avr_led_work_func(struct work_struct *work)
-{
+static void avr_led_work_func(struct work_struct *work) {
led_off(avr_data.client);
- led_call = false;
+ pr_debug("[AVR] Enter LED delay 5 Sec\n");
+}
+
+static void avr_vib_work_func(struct work_struct *work) {
+ pmic_vibrator_off(NULL);
+}
+
+//Blinking code
+
+static struct delayed_work blink_wq;
+static int status=0;
+
+void avr_blink(int value) {
+ status=0;
+ if(value) {
+ if(avr_data.suspended)
+ low_power_mode(avr_data.client, 0);
+ printk("Scheduling blinking\n");
+ schedule_delayed_work(&blink_wq, msecs_to_jiffies(30));
+ } else {
+ cancel_delayed_work(&blink_wq);
+ if(avr_data.suspended) {
+ low_power_mode(avr_data.client, 1);
+ } else {
+ led_on(avr_data.client);
+ printk("Scheduling 5s off\n");
+ schedule_delayed_work(&led_wq, msecs_to_jiffies(AVR_LED_DELAY_TIME));
+ }
+ }
+}
+
+static void blink_work_func(struct work_struct *work) {
+ status=!status;
+ if(status) {
+ printk("Blink turning on\n");
+ led_on(avr_data.client);
+ schedule_delayed_work(&blink_wq, msecs_to_jiffies(500));
+ } else {
+ printk("Blink turning off\n");
+ led_off(avr_data.client);
+ schedule_delayed_work(&blink_wq, msecs_to_jiffies(4500));
+ }
+}
+
+static int __init avr_init(void)
+{
+ int res=0;
+
+ INIT_DELAYED_WORK(&blink_wq, blink_work_func);
+ cancel_delayed_work(&blink_wq);
+ res = i2c_add_driver(&avr_driver);
+
+ if (res){
+ pr_err("[AVR]i2c_add_driver failed! \n");
+ return res;
+ }
+
+ return 0;
}

module_init(avr_init);

fix usb problem
--- arch/arm/mach-msm/board-qsd8x50.c 2011-05-21 22:28:35.256471390 -0700
+++ ../gnufabio-acer_liquid_chocolate-5318d09_ori/arch/arm/mach-msm/board-qsd8x50.c 2011-05-18 14:43:27.000000000 -0700
@@ -194,21 +194,12 @@
/* dynamic composition */
static struct usb_composition usb_func_composition[] = {
{
- .product_id = 0x3203,
- /* DIAG + ADB + GENERIC MODEM + GENERIC NMEA + MSC*/
- .functions = 0x2764,
- .adb_product_id = 0x3202,
- .adb_functions = 0x27614
- },
-#ifdef CONFIG_USB_ANDROID_RNDIS
- {
- /* RNDIS */
.product_id = 0x3223,
- .functions = 0x764A,
+ /* DIAG + ADB + GENERIC MODEM + GENERIC NMEA + MSC+ RNDIS*/
+ .functions = 0x2764A,
.adb_product_id = 0x3222,
- .adb_functions = 0x7614A,
+ .adb_functions = 0x27614A,
},
-#endif
};
#else
/* dynamic composition */

--- drivers/usb/gadget/android.c 2011-05-21 21:36:23.610461922 -0700
+++ ../gnufabio-acer_liquid_chocolate-5318d09_ori/drivers/usb/gadget/android.c 2011-05-18 14:43:27.000000000 -0700
@@ -68,7 +68,7 @@
MODULE_VERSION("1.0");

/* product id */
-static u16 product_id = 0x3203;
+static u16 product_id = 0x3223;
static int android_set_pid(const char *val, struct kernel_param *kp);
static int android_get_pid(char *buffer, struct kernel_param *kp);
module_param_call(product_id, android_set_pid, android_get_pid,
@@ -290,8 +290,6 @@
.label = "android",
.bind = android_bind_config,
.bConfigurationValue = 1,
- .bmAttributes = (USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER |
- USB_CONFIG_ATT_WAKEUP),
.bMaxPower = 0xFA, /* 500ma */
};

@@ -300,9 +298,7 @@
if (acm_func_cnt || gser_func_cnt)
gserial_cleanup();
#if defined(CONFIG_USB_ANDROID_CDC_ECM) || defined(CONFIG_USB_ANDROID_RNDIS)
-#ifndef CONFIG_MACH_ACER_A1
gether_cleanup();
-#endif //#ifndef CONFIG_MACH_ACER_A1f
#endif

return 0;
@@ -348,28 +344,16 @@
device_desc.idProduct = __constant_cpu_to_le16(product_id);
if (gadget->ops->wakeup)
android_config_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
-
+ if (dev->pdata->self_powered && !usb_gadget_set_selfpowered(gadget))
+ android_config_driver.bmAttributes |= USB_CONFIG_ATT_SELFPOWER;
dev->cdev = cdev;
dev->gadget = gadget;

#if defined(CONFIG_USB_ANDROID_CDC_ECM) || defined(CONFIG_USB_ANDROID_RNDIS)
/* set up network link layer */
-#ifdef CONFIG_MACH_ACER_A1
- {
- static int x=0;
- if(!x){
- x++;
- ret = gether_setup(cdev->gadget, hostaddr);
- if (ret < 0)
- return ret;
- }
- }
-#else
ret = gether_setup(cdev->gadget, hostaddr);
if (ret < 0)
return ret;
-#endif //CONFIG_MACH_ACER_A1
-
#endif

/* register our configuration */
@@ -395,7 +379,6 @@
device_desc.bcdDevice = __constant_cpu_to_le16(0x9999);
}

- usb_gadget_set_selfpowered(gadget);
num_ports = acm_func_cnt + gser_func_cnt;
if (acm_func_cnt || gser_func_cnt) {
ret = gserial_setup(cdev->gadget, num_ports);
@@ -708,11 +691,6 @@

static void __exit cleanup(void)
{
-#ifdef CONFIG_MACH_ACER_A1
-#if defined(CONFIG_USB_ANDROID_CDC_ECM) || defined(CONFIG_USB_ANDROID_RNDIS)
- gether_cleanup();
-#endif
-#endif //CONFIG_MACH_ACER_A1
usb_composite_unregister(&android_usb_driver);
misc_deregister(&adb_enable_device);
platform_driver_unregister(&android_platform_driver);

fix voice input
--- arch/arm/mach-msm/qdsp6/q6audio.c 2011-05-21 20:56:23.566463307 -0700
+++ ../gnufabio-acer_liquid_chocolate-5318d09_ori/arch/arm/mach-msm/qdsp6/q6audio.c 2011-05-18 14:43:27.000000000 -0700
@@ -80,28 +80,28 @@
#else
static struct q6_hw_info q6_audio_hw[Q6_HW_COUNT] = {
[Q6_HW_HANDSET] = {
- .min_gain = -903,
- .max_gain = 602,
+ .min_gain = -400,
+ .max_gain = 1100,
},
[Q6_HW_HEADSET] = {
- .min_gain = -903,
- .max_gain = 602,
+ .min_gain = -1100,
+ .max_gain = 400,
},
[Q6_HW_SPEAKER] = {
- .min_gain = -903,
- .max_gain = 602,
+ .min_gain = -1000,
+ .max_gain = 500,
},
[Q6_HW_TTY] = {
- .min_gain = -2000,
+ .min_gain = 0,
.max_gain = 0,
},
[Q6_HW_BT_SCO] = {
- .min_gain = -903,
- .max_gain = 602,
+ .min_gain = -1100,
+ .max_gain = 400,
},
[Q6_HW_BT_A2DP] = {
- .min_gain = -903,
- .max_gain = 602,
+ .min_gain = -1100,
+ .max_gain = 400,
},
};
#endif
@@ -149,54 +149,69 @@
analog_ops = ops;
}

-static struct q6_device_info *q6_lookup_device(uint32_t device_id)
+static struct q6_device_info *q6_lookup_device(uint32_t device_id,
+ uint32_t acdb_id)
{
struct q6_device_info *di = q6_audio_devices;
- for (;:P {
- if (di->id == device_id)
- return di;
- if (di->id == 0) {
- pr_err("q6_lookup_device: bogus id 0x%08x\n",
- device_id);
- return di;
+
+ if (acdb_id) {
+ for (;:rolleyes: {
+ if (di->cad_id == acdb_id && di->id == device_id)
+ return di;
+ if (di->id == 0) {
+ pr_err("q6_lookup_device: bogus id 0x%08x\n",
+ device_id);
+ return di;
+ }
+ di++;
+ }
+ } else {
+ for (;<_< {
+ if (di->id == device_id)
+ return di;
+ if (di->id == 0) {
+ pr_err("q6_lookup_device: bogus id 0x%08x\n",
+ device_id);
+ return di;
+ }
+ di++;
}
- di++;
}
}

static uint32_t q6_device_to_codec(uint32_t device_id)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, 0);
return di->codec;
}

static uint32_t q6_device_to_dir(uint32_t device_id)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, 0);
return di->dir;
}

static uint32_t q6_device_to_cad_id(uint32_t device_id)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, 0);
return di->cad_id;
}

-static uint32_t q6_device_to_path(uint32_t device_id)
+static uint32_t q6_device_to_path(uint32_t device_id, uint32_t acdb_id)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, acdb_id);
return di->path;
}

static uint32_t q6_device_to_rate(uint32_t device_id)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, 0);
return di->rate;
}

int q6_device_volume(uint32_t device_id, int level)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, 0);
struct q6_hw_info *hw;

hw = &q6_audio_hw[di->hw];
@@ -622,8 +637,14 @@

memset(&rpc, 0, sizeof(rpc));
rpc.hdr.opcode = ADSP_AUDIO_IOCTL_SET_DEVICE_CONFIG_TABLE;
- if (q6_device_to_dir(device_id) == Q6_TX)
- rpc.hdr.data = tx_clk_freq;
+ if (q6_device_to_dir(device_id) == Q6_TX) {
+ if (tx_clk_freq > 16000)
+ rpc.hdr.data = 48000;
+ else if (tx_clk_freq > 8000)
+ rpc.hdr.data = 16000;
+ else
+ rpc.hdr.data = 8000;
+ }
rpc.device_id = device_id;
rpc.phys_addr = audio_phys;
rpc.phys_size = size;
@@ -1072,21 +1093,28 @@
{
audio_tx_analog_enable(1);

- adie_enable();
- adie_set_path(adie, audio_tx_path_id, ADIE_PATH_TX);
+ if (audio_tx_path_id) {
+ adie_enable();
+ adie_set_path(adie, audio_tx_path_id, ADIE_PATH_TX);

- if (tx_clk_freq > 8000)
- adie_set_path_freq_plan(adie, ADIE_PATH_TX, 48000);
- else
- adie_set_path_freq_plan(adie, ADIE_PATH_TX, 8000);
+ if (tx_clk_freq > 16000)
+ adie_set_path_freq_plan(adie, ADIE_PATH_TX, 48000);
+ else if (tx_clk_freq > 8000)
+ adie_set_path_freq_plan(adie, ADIE_PATH_TX, 16000);
+ else
+ adie_set_path_freq_plan(adie, ADIE_PATH_TX, 8000);

- adie_proceed_to_stage(adie, ADIE_PATH_TX, ADIE_STAGE_DIGITAL_READY);
- adie_proceed_to_stage(adie, ADIE_PATH_TX, ADIE_STAGE_DIGITAL_ANALOG_READY);
+ adie_proceed_to_stage(adie, ADIE_PATH_TX,
+ ADIE_STAGE_DIGITAL_READY);
+ adie_proceed_to_stage(adie, ADIE_PATH_TX,
+ ADIE_STAGE_DIGITAL_ANALOG_READY);
+ }

audio_update_acdb(audio_tx_device_id, acdb_id);

if (!reconf)
- qdsp6_devchg_notify(ac_control, ADSP_AUDIO_TX_DEVICE, audio_tx_device_id);
+ qdsp6_devchg_notify(ac_control, ADSP_AUDIO_TX_DEVICE,
+ audio_tx_device_id);
qdsp6_standby(ac_control);
qdsp6_start(ac_control);

@@ -1097,18 +1125,26 @@
{
audio_rx_analog_enable(0);

- adie_proceed_to_stage(adie, ADIE_PATH_RX, ADIE_STAGE_ANALOG_OFF);
- adie_proceed_to_stage(adie, ADIE_PATH_RX, ADIE_STAGE_DIGITAL_OFF);
- adie_disable();
+ if (audio_rx_path_id) {
+ adie_proceed_to_stage(adie, ADIE_PATH_RX,
+ ADIE_STAGE_ANALOG_OFF);
+ adie_proceed_to_stage(adie, ADIE_PATH_RX,
+ ADIE_STAGE_DIGITAL_OFF);
+ adie_disable();
+ }
}

static void _audio_tx_path_disable(void)
{
audio_tx_analog_enable(0);

- adie_proceed_to_stage(adie, ADIE_PATH_TX, ADIE_STAGE_ANALOG_OFF);
- adie_proceed_to_stage(adie, ADIE_PATH_TX, ADIE_STAGE_DIGITAL_OFF);
- adie_disable();
+ if (audio_tx_path_id) {
+ adie_proceed_to_stage(adie, ADIE_PATH_TX,
+ ADIE_STAGE_ANALOG_OFF);
+ adie_proceed_to_stage(adie, ADIE_PATH_TX,
+ ADIE_STAGE_DIGITAL_OFF);
+ adie_disable();
+ }
}

static int icodec_rx_clk_refcount;
@@ -1151,12 +1187,20 @@
static void _audio_tx_clk_enable(void)
{
uint32_t device_group = q6_device_to_codec(audio_tx_device_id);
+ uint32_t icodec_tx_clk_rate;

switch (device_group) {
case Q6_ICODEC_TX:
icodec_tx_clk_refcount++;
if (icodec_tx_clk_refcount == 1) {
- clk_set_rate(icodec_tx_clk, tx_clk_freq * 256);
+ if (tx_clk_freq > 16000)
+ icodec_tx_clk_rate = 48000;
+ else if (tx_clk_freq > 8000)
+ icodec_tx_clk_rate = 16000;
+ else
+ icodec_tx_clk_rate = 8000;
+
+ clk_set_rate(icodec_tx_clk, icodec_tx_clk_rate * 256);
clk_enable(icodec_tx_clk);
}
break;
@@ -1243,7 +1287,7 @@
}
}

-static void _audio_rx_clk_reinit(uint32_t rx_device)
+static void _audio_rx_clk_reinit(uint32_t rx_device, uint32_t acdb_id)
{
uint32_t device_group = q6_device_to_codec(rx_device);

@@ -1251,14 +1295,14 @@
_audio_rx_clk_disable();

audio_rx_device_id = rx_device;
- audio_rx_path_id = q6_device_to_path(rx_device);
+ audio_rx_path_id = q6_device_to_path(rx_device, acdb_id);

if (device_group != audio_rx_device_group)
_audio_rx_clk_enable();

}

-static void _audio_tx_clk_reinit(uint32_t tx_device)
+static void _audio_tx_clk_reinit(uint32_t tx_device, uint32_t acdb_id)
{
uint32_t device_group = q6_device_to_codec(tx_device);

@@ -1266,7 +1310,7 @@
_audio_tx_clk_disable();

audio_tx_device_id = tx_device;
- audio_tx_path_id = q6_device_to_path(tx_device);
+ audio_tx_path_id = q6_device_to_path(tx_device, acdb_id);

if (device_group != audio_tx_device_group)
_audio_tx_clk_enable();
@@ -1404,7 +1448,7 @@
static void do_rx_routing(uint32_t device_id, uint32_t acdb_id)
{
if (device_id == audio_rx_device_id &&
- audio_rx_path_id == q6_device_to_path(device_id)) {
+ audio_rx_path_id == q6_device_to_path(device_id, acdb_id)) {
if (acdb_id != rx_acdb) {
audio_update_acdb(device_id, acdb_id);
qdsp6_devchg_notify(ac_control, ADSP_AUDIO_RX_DEVICE, device_id);
@@ -1417,18 +1461,18 @@
if (audio_rx_path_refcount > 0) {
qdsp6_devchg_notify(ac_control, ADSP_AUDIO_RX_DEVICE, device_id);
_audio_rx_path_disable();
- _audio_rx_clk_reinit(device_id);
+ _audio_rx_clk_reinit(device_id, acdb_id);
_audio_rx_path_enable(1, acdb_id);
} else {
audio_rx_device_id = device_id;
- audio_rx_path_id = q6_device_to_path(device_id);
+ audio_rx_path_id = q6_device_to_path(device_id, acdb_id);
}
}

static void do_tx_routing(uint32_t device_id, uint32_t acdb_id)
{
if (device_id == audio_tx_device_id &&
- audio_tx_path_id == q6_device_to_path(device_id)) {
+ audio_tx_path_id == q6_device_to_path(device_id, acdb_id)) {
if (acdb_id != tx_acdb) {
audio_update_acdb(device_id, acdb_id);
qdsp6_devchg_notify(ac_control, ADSP_AUDIO_TX_DEVICE, device_id);
@@ -1441,11 +1485,12 @@
if (audio_tx_path_refcount > 0) {
qdsp6_devchg_notify(ac_control, ADSP_AUDIO_TX_DEVICE, device_id);
_audio_tx_path_disable();
- _audio_tx_clk_reinit(device_id);
+ _audio_tx_clk_reinit(device_id, acdb_id);
_audio_tx_path_enable(1, acdb_id);
} else {
audio_tx_device_id = device_id;
- audio_tx_path_id = q6_device_to_path(device_id);
+ audio_tx_path_id = q6_device_to_path(device_id, acdb_id);
+ tx_acdb = acdb_id;
}
}

@@ -1559,9 +1604,9 @@
}
} else {
/* TODO: consider concurrency with voice call */
- tx_clk_freq = rate;
audio_tx_path_refcount++;
if (audio_tx_path_refcount == 1) {
+ tx_clk_freq = rate;
_audio_tx_clk_enable();
_audio_tx_path_enable(0, acdb_id);
}
@@ -1632,10 +1677,11 @@

ac->flags = flags;
if (ac->flags & AUDIO_FLAG_WRITE)
- audio_rx_path_enable(1, 0);
+ audio_rx_path_enable(1, rx_acdb);
else {
- tx_clk_freq = 8000;
- audio_tx_path_enable(1, 0);
+ if (!audio_tx_path_refcount)
+ tx_clk_freq = 8000;
+ audio_tx_path_enable(1, tx_acdb);
}

return ac;
@@ -1754,7 +1800,8 @@
if (ac->flags & AUDIO_FLAG_WRITE)
audio_rx_path_enable(1, acdb_id);
else{
- tx_clk_freq = 48000;
+ if (!audio_tx_path_refcount)
+ tx_clk_freq = 48000;
audio_tx_path_enable(1, acdb_id);
}

@@ -1793,7 +1840,8 @@
if (ac->flags & AUDIO_FLAG_WRITE)
audio_rx_path_enable(1, acdb_id);
else{
- tx_clk_freq = 8000;
+ if (!audio_tx_path_refcount)
+ tx_clk_freq = 8000;
audio_tx_path_enable(1, acdb_id);
}

@@ -1829,7 +1877,8 @@
if (ac->flags & AUDIO_FLAG_WRITE)
audio_rx_path_enable(1, acdb_id);
else{
- tx_clk_freq = 8000;
+ if (!audio_tx_path_refcount)
+ tx_clk_freq = 8000;
audio_tx_path_enable(1, acdb_id);
}

  • 0

#52
gnufabio

gnufabio

    Addict

  • Members
  • PipPipPipPipPip
  • 729 posts
  • Gender:Male
  • Devices:Acer liquid A1, Asus TF101
  • Twitter:@gnufabio
Great, thanks rithchen :P The only thing to fix now is the drain related to wifi

  • 0

#53
gnufabio

gnufabio

    Addict

  • Members
  • PipPipPipPipPip
  • 729 posts
  • Gender:Male
  • Devices:Acer liquid A1, Asus TF101
  • Twitter:@gnufabio
V 110522-1255: http://www.multiupload.com/D69TIGKB92

You can find the logcat in the first page

  • 0

#54
zorginho

zorginho

    Addict

  • Members
  • PipPipPipPipPip
  • 573 posts
  • Gender:Male
  • Devices:Nexus 4

V 110522-1255: http://www.multiupload.com/D69TIGKB92

You can find the logcat in the first page

can i use it on top of the fear 1.0b1, or it can cause issues?

Edited by zorginho, 24 May 2011 - 07:47 PM.

  • 0

#55
gnufabio

gnufabio

    Addict

  • Members
  • PipPipPipPipPip
  • 729 posts
  • Gender:Male
  • Devices:Acer liquid A1, Asus TF101
  • Twitter:@gnufabio

can i use it on top of the fear 1.0b1, or it can cause issues?

Yep, i use it with fear rom every day, it runs great. The only problem is that you have to enable and disable the wifi on each boot to fix the fast battery drain. I'm trying to fix it but it seems to be hard :P

  • 0

#56
fear_factory84

fear_factory84

    Diehard

  • Members
  • PipPipPipPip
  • 370 posts
  • Gender:Male
  • Devices:nexus s, eee pad tf101 + dock

Yep, i use it with fear rom every day, it runs great. The only problem is that you have to enable and disable the wifi on each boot to fix the fast battery drain. I'm trying to fix it but it seems to be hard :P


So I never noticed battery drain because I use green power and it does that automatically to save power... lol!!!

  • 0
nexus s i9023 - cm9 v7.0
eee pad transformer - stock unrooted 9.2.1.21
previous device: acer liquid A1 liquidnext 1.9.2 + 4.008.08 rild + kernel with stock voltages on 4.002.14_EMEA_GEN1

#57
gnufabio

gnufabio

    Addict

  • Members
  • PipPipPipPipPip
  • 729 posts
  • Gender:Male
  • Devices:Acer liquid A1, Asus TF101
  • Twitter:@gnufabio
New version released.
Battery drain fix, see the first page for more details
Download: http://goo.gl/j7FTU

Edited by gnufabio, 29 May 2011 - 04:15 PM.

  • 0

#58
johnnyponny

johnnyponny

    Newbie

  • Members
  • Pip
  • 37 posts
  • Devices:Acer Liquid
How do you get this to work on the nightly build №83?

  • 0

#59
gnufabio

gnufabio

    Addict

  • Members
  • PipPipPipPipPip
  • 729 posts
  • Gender:Male
  • Devices:Acer liquid A1, Asus TF101
  • Twitter:@gnufabio

How do you get this to work on the nightly build №83?

This kernel is for Acer Based ROMs (stock, t&l ecc)

  • 0

#60
fear_factory84

fear_factory84

    Diehard

  • Members
  • PipPipPipPip
  • 370 posts
  • Gender:Male
  • Devices:nexus s, eee pad tf101 + dock

New version released.
Battery drain fix, see the first page for more details
Download: http://goo.gl/93Mae


My first battery cicle with this kernel.. very impressive!

Medium usage got 1 day and 7 hours and still got 34% left.

great job fabio

  • 0
nexus s i9023 - cm9 v7.0
eee pad transformer - stock unrooted 9.2.1.21
previous device: acer liquid A1 liquidnext 1.9.2 + 4.008.08 rild + kernel with stock voltages on 4.002.14_EMEA_GEN1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users