linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] Microphone problem on GalaxyS with CyanogenMod


From: Guillaume Beraudo
Subject: Re: [Linphone-developers] Microphone problem on GalaxyS with CyanogenMod
Date: Wed, 30 Oct 2013 08:53:34 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Ben,


Thank you for the patch.
It looks good to me and I will ask for its merging.

Guillaume


On Wed, Oct 30, 2013 at 04:00:28AM +0100, Ben Sartor wrote:
> Hi Guillaume,
> 
> here is a patch implementing parsing /proc/version and working with my 
> friends 
> phone. Maybe you can use it?
> 
> Best Regards
>  Ben
> 
> > Hi Ben,
> > 
> > Parsing /proc/version seems reasonable.
> > 
> > We will have a look to this.
> > 
> > Guillaume
> > 
> > On Wed, Oct 23, 2013 at 01:49:50AM +0200, Ben Sartor wrote:
> > > Hi Guillaume,
> > > 
> > > thanks for your reply.
> > > 
> > > I tried the solutions from the following stackoverflow thread to detect
> > > cyanogenmod:
> > > http://stackoverflow.com/questions/5499217/how-to-recognize-that-cyanogen
> > > mod- is-on-a-board/9801191
> > > 
> > > System.getProperty("os.version").toLowerCase().contains("cyanogenmod")
> > > Does not work. With the version of cyanogenmod my friend uses (about a
> > > week old) "os.version" showes nothing indicating CyanogenMod.
> > > 
> > > Parsing "/proc/version" works.
> > > 
> > > getPackageManager().hasSystemFeature("com.cyanogenmod.android")
> > > Works. Probably the best way to detect cyanogenmod as
> > > com.cyanogenmod.trebuchet uses it for detection, too. But we do not have
> > > a Context in Hacks.java to call getPackageManager(). A patch, adding a
> > > Context as  parameter to e.g. Hacks.needGalaxySAudioHack() and handling
> > > it down toisGT9000,  would be much more invasive.
> > > 
> > > What do you think?
> > > 
> > > Best Regards
> > > 
> > >  Ben
> > >  
> > > > Hi Ben,
> > > > 
> > > > Thanks for the patch.
> > > > 
> > > > However, I prefer if we detect CyanogenMod to disable the hack.
> > > > How may I detect CyanogenMod?
> > > > 
> > > > 
> > > > Guillaume
> > > > 
> > > > On Tue, Oct 22, 2013 at 02:57:15AM +0200, Ben Sartor wrote:
> > > > > Hi,
> > > > > 
> > > > > thanks for linphone. It is working great at my place.
> > > > > 
> > > > > However, a friend of mine has a problem with linphone on his GalaxyS
> > > > > running CyanogenMod: The microphone is not working.
> > > > > 
> > > > > Attached is a little mediastreamer2 patch, disabling AudioHacks on
> > > > > the GalaxyS if it has at least Gingerbread. Would you mind including
> > > > > it?
> > > > > 
> > > > > Of course I accept yout Contributors Agreement.
> > > > > 
> > > > > Best Regards
> > > > > 
> > > > >  Ben
> > > > > 
> > > > > From 4dd0ebe9dc693c7bad7bec2315d1f51a275259d0 Mon Sep 17 00:00:00
> > > > > 2001 From: Ben Sartor <address@hidden>
> > > > > Date: Thu, 17 Oct 2013 13:53:11 +0200
> > > > > Subject: [PATCH] Do not use galaxyS hacks if android version >=
> > > > > Gingerbread
> > > > > 
> > > > >  since it is fixed in mods.
> > > > > 
> > > > > ---
> > > > > 
> > > > >  java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java | 
> > > > >    2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > 
> > > > > diff --git
> > > > > a/java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java
> > > > > b/java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java
> > > > > index ac22f76..ace0c9a 100644
> > > > > ---
> > > > > a/java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java
> > > > > +++
> > > > > b/java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java
> > > > > @@ -76,7 +76,7 @@ public final class Hacks {
> > > > > 
> > > > >       // Galaxy S variants
> > > > >       private static final boolean isSPHD700() {return
> > > > >       Build.DEVICE.startsWith("SPH-D700");} // Epic private static
> > > > >       boolean isSGHI896() {return Build.DEVICE.startsWith("SGH-
> I896");}
> > > > >       //
> > > 
> > > Captivate
> > > 
> > > > > -     private static boolean isGT9000() {return
> > > > > Build.DEVICE.startsWith("GT-I9000");} // Galaxy S +   private static
> > > > > boolean isGT9000() {return Build.DEVICE.startsWith("GT-I9000") &&
> > > > > Version.sdkStrictlyBelow(Version.API09_GINGERBREAD_23);} // GalaxyS
> > > > > not modded
> > > > > 
> > > > >       private static boolean isSC02B() {return
> > > > >       Build.DEVICE.startsWith("SC-02B");} // Docomo private static
> > > > >       boolean isGTP1000() {return Build.DEVICE.startsWith("GT-
> P1000");}
> > > > >       // Tab
> > > > > 
> > > > > _______________________________________________
> > > > > Linphone-developers mailing list
> > > > > address@hidden
> > > > > https://lists.nongnu.org/mailman/listinfo/linphone-developers
> > > > 
> > > > _______________________________________________
> > > > Linphone-developers mailing list
> > > > address@hidden
> > > > https://lists.nongnu.org/mailman/listinfo/linphone-developers
> > > 
> > > _______________________________________________
> > > Linphone-developers mailing list
> > > address@hidden
> > > https://lists.nongnu.org/mailman/listinfo/linphone-developers
> > 
> > _______________________________________________
> > Linphone-developers mailing list
> > address@hidden
> > https://lists.nongnu.org/mailman/listinfo/linphone-developers

> From 7b48b2d92313728b61041d10cda6a725afb885a5 Mon Sep 17 00:00:00 2001
> From: Ben Sartor <address@hidden>
> Date: Tue, 29 Oct 2013 03:06:55 +0100
> Subject: [PATCH] Disable galaxyS hacks if running on CyanogenMod
> 
> ---
>  .../mediastream/video/capture/hwconf/Hacks.java    |   34 
> +++++++++++++++++++-
>  1 file changed, 33 insertions(+), 1 deletion(-)
> 
> diff --git 
> a/java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java 
> b/java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java
> index ac22f76..5cc47bb 100644
> --- a/java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java
> +++ b/java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java
> @@ -18,6 +18,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
> 02111-1307, USA.
>   */
>  package org.linphone.mediastream.video.capture.hwconf;
>  
> +import java.io.BufferedReader;
> +import java.io.FileNotFoundException;
> +import java.io.FileReader;
> +import java.io.IOException;
> +import java.util.Locale;
> +
>  import org.linphone.mediastream.Log;
>  import org.linphone.mediastream.Version;
>  
> @@ -76,10 +82,36 @@ public final class Hacks {
>       // Galaxy S variants
>       private static final boolean isSPHD700() {return 
> Build.DEVICE.startsWith("SPH-D700");} // Epic 
>       private static boolean isSGHI896() {return 
> Build.DEVICE.startsWith("SGH-I896");} // Captivate
> -     private static boolean isGT9000() {return 
> Build.DEVICE.startsWith("GT-I9000");} // Galaxy S
> +     private static boolean isGT9000() {return 
> Build.DEVICE.startsWith("GT-I9000") && !isCyanogenMod();} // CyanogenMod 
> fixed issues on GT-I9000
>       private static boolean isSC02B() {return 
> Build.DEVICE.startsWith("SC-02B");} // Docomo
>       private static boolean isGTP1000() {return 
> Build.DEVICE.startsWith("GT-P1000");} // Tab
>  
> +     private static boolean isCyanogenMod()
> +     {
> +             BufferedReader reader = null;
> +             try {
> +                     reader = new BufferedReader(new 
> FileReader("/proc/version"));
> +                     final String procVersion = reader.readLine();
> +                     if (procVersion != null) {
> +                             if 
> (procVersion.toLowerCase(Locale.ENGLISH).contains("cyanogenmod")) {
> +                                     Log.i("detected CyanogenMod");
> +                                     return true;
> +                             }
> +                     }
> +             } catch (FileNotFoundException e) {
> +                     Log.e("file not found: /proc/version");
> +             } catch (IOException e) {
> +                     Log.e("IOException: " + e.getMessage());
> +             } finally {
> +                     if (reader != null) {
> +                             try {
> +                                     reader.close();
> +                             } catch (IOException e) {}
> +                     }
> +             }
> +             return false;
> +     }
> +
>       // LG with two cameras
>       private static final boolean isLGP970() {return 
> Build.DEVICE.startsWith("LG-P970");}
>  
> -- 
> 1.7.10.4
> 

> _______________________________________________
> Linphone-developers mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/linphone-developers




reply via email to

[Prev in Thread] Current Thread [Next in Thread]