serdarsen / budgie-advanced-brightness-controller

[This Applet Moved Under The UbuntuBudgie/budgie-extras ]
https://github.com/UbuntuBudgie/budgie-extras/tree/master/budgie-brightness-controller
GNU General Public License v3.0
4 stars 2 forks source link

Errors seen in terminal on adding new 1.3.1 plugin #11

Closed fossfreedom closed 5 years ago

fossfreedom commented 5 years ago

Saw the following terminal errors:


(budgie-panel:25316): Gtk-CRITICAL **: 21:00:44.427: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
cat: '/sys/class/backlight/ /max_brightness': No such file or directory

(budgie-panel:25316): GLib-CRITICAL **: 21:00:59.010: g_ascii_strtod: assertion 'nptr != NULL' failed
cat: '/sys/class/backlight/ /brightness': No such file or directory

(budgie-panel:25316): GLib-CRITICAL **: 21:00:59.015: g_ascii_strtod: assertion 'nptr != NULL' failed
** Message: 21:00:59.020: ConfigHelper.vala:118: Failed to make dir : Error creating directory /home/dad/Downloads/.config/budgie-advanced-brightness-controller: No such file or directory
** Message: 21:00:59.020: ConfigHelper.vala:63: Failed to write : Error opening file “/home/dad/Downloads/.config/budgie-advanced-brightness-controller/dim”: No such file or directory

The vala 63: Failed .... repeats when changing the Dim scrollbar. Changing the Dim scrollbar works fine and changes the brightness of the screen.

fossfreedom commented 5 years ago

Note - for the backlight message I have the following:

dad@dad-HP-Pavilion-Notebook:/sys/class/backlight/intel_backlight$ ls
actual_brightness  bl_power  brightness  device  max_brightness  power  subsystem  type  uevent
dad@dad-HP-Pavilion-Notebook:/sys/class/backlight/intel_backlight$ 
serdarsen commented 5 years ago

@fossfreedom can you show result of the following

 ls /sys/class/backlight 
fossfreedom commented 5 years ago

That was above ... the intel_backlight subfolder

serdarsen commented 5 years ago

@fossfreedom can you try https://github.com/serdarsen/budgie-advanced-brightness-controller/releases/tag/v1.3.2 . I think ls /sys/class/backlight can return first line empty if that is the case this must be fixe it. And config user dir issue fixed with Environment as well.

fossfreedom commented 5 years ago
dad@dad-HP-Pavilion-Notebook:~/Downloads$ ** Message: 10:20:52.030: manager.vala:1454: Replaced existing budgie-panel
cat: /sys/class/backlight/ight/max_brightness: No such file or directory

(budgie-panel:29111): GLib-CRITICAL **: 10:20:52.482: g_ascii_strtod: assertion 'nptr != NULL' failed
cat: /sys/class/backlight/ight/brightness: No such file or directory

(budgie-panel:29111): GLib-CRITICAL **: 10:20:52.487: g_ascii_strtod: assertion 'nptr != NULL' failed
** Message: 10:20:54.531: libsession.vala:50: DESKTOP_AUTOSTART_ID not set, session registration may be broken (not running budgie-desktop?)

(budgie-panel:29111): Bluetooth-WARNING **: 10:20:54.586: Error setting property 'Powered' on interface org.bluez.Adapter1: GDBus.Error:org.bluez.Error.Blocked: Blocked through rfkill (g-io-error-quark, 36)

** (budgie-panel:29111): WARNING **: 10:20:54.821: BudgieMenuWindow.vala:190: Software has no parent directory, not adding to menu

(budgie-panel:29111): Gtk-CRITICAL **: 10:20:54.907: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed

This time I see cat: /sys/class/backlight/ight/max_brightness: No such file or directory

"ight" is a truncation of "intel_backlight" ?

serdarsen commented 5 years ago

"ight" is very interesting.

@fossfreedom I prepared a simple script to understand this.

// File Name: 
//     hello.vala
//
// Compile Command (Ignore compile warnings): 
//     valac hello.vala --pkg gtk+-3.0
//
// Execute Command: 
//     ./hello
//
// Sources:
//     https://wiki.gnome.org/Projects/Vala/Tutorial

class Demo.HelloWorld : GLib.Object 
{
    public static int main(string[] args) 
    {
        Bytes output;
        try 
        {
            var cmdLine = new string[]{"ls", "/sys/class/backlight"};
            var subprocess = new GLib.Subprocess.newv(cmdLine, SubprocessFlags.STDOUT_PIPE);
            subprocess.communicate(null, null, out output, null);
            var data = (string)output.get_data();
            stdout.printf(@"data:\n'$data'\n");

            var cleanData = data._strip(); // trims whitespaces

            stdout.printf(@"cleanData:\n'$cleanData'\n");

            var backLightArray = cleanData.split("\n");

            foreach (var light in backLightArray) 
            {
                stdout.printf(@"light:\n'$light'\n");
            }
        } 
        catch (Error e) 
        {
            GLib.message("Failed to run : %s", e.message);
        }

        return 0;
    }
}

This is my terminal results when I run it:

Screenshot from 2019-06-01 05:27:29

Can you show me your results.

fossfreedom commented 5 years ago

data: 'intel_backlight ' cleanData: 'intel_backlight' light: 'intel_backlight'

On Sat, 1 Jun 2019 at 03:34, Serdar ŞEN notifications@github.com wrote:

"ight" is very interesting.

@fossfreedom https://github.com/fossfreedom I prepared a simple script to understand this.

// File Name: // hello.vala//// Compile Command (Ignore compile warnings): // valac hello.vala --pkg gtk+-3.0//// Execute Command: // ./hello//// Sources:// https://wiki.gnome.org/Projects/Vala/Tutorial class Demo.HelloWorld : GLib.Object { public static int main(string[] args) { Bytes output; try { var cmdLine = new string[]{"ls", "/sys/class/backlight"}; var subprocess = new GLib.Subprocess.newv(cmdLine, SubprocessFlags.STDOUT_PIPE); subprocess.communicate(null, null, out output, null); var data = (string)output.get_data(); stdout.printf(@"data:\n'$data'\n");

        var cleanData = data._strip(); // trims whitespaces

        stdout.printf(@"cleanData:\n'$cleanData'\n");

        var backLightArray = cleanData.split("\n");

        foreach (var light in backLightArray)
        {
            stdout.printf(@"light:\n'$light'\n");
        }
    }
    catch (Error e)
    {
        GLib.message("Failed to run : %s", e.message);
    }

    return 0;
}

}

This is my terminal results when I run it:

[image: Screenshot from 2019-06-01 05:27:29] https://user-images.githubusercontent.com/26231317/58742543-06441d00-842e-11e9-826e-da5ddb86b1d0.png

Can you show me your results.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/serdarsen/budgie-advanced-brightness-controller/issues/11?email_source=notifications&email_token=AAHTHEFBYEUIWY4VXJRUCHLPYHN43A5CNFSM4HPXLW52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWWW7DQ#issuecomment-497905550, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHTHEAYWTQL5GV2MF6DEJDPYHN43ANCNFSM4HPXLW5Q .

fossfreedom commented 5 years ago

I'm going to put some message debug lines into the code to find out what is going on.

So immediately after retrieving the backlight list it looks ok ...

Message: 09:46:57.258: LightHelper.vala:67: lights intel_backlight 60.00 q Message: 09:46:57.258: LightHelper.vala:73: retrieved intel_backlight ** Message: 09:46:57.258: LightHelper.vala:73: retrieved 60.00 q cat: '/sys/class/backlight/60.00 q/max_brightness': No such file or directory

(budgie-panel:23362): GLib-CRITICAL **: 09:46:57.260: g_ascii_strtod: assertion 'nptr != NULL' failed cat: '/sys/class/backlight/60.00 q/brightness': No such file or directory

(budgie-panel:23362): GLib-CRITICAL : 09:46:57.262: g_ascii_strtod: assertion 'nptr != NULL' failed Message: 09:46:58.252: libsession.vala:50: DESKTOP_AUTOSTART_ID not set, session registration may be broken (not running budgie-desktop?)

(budgie-panel:23362): Bluetooth-WARNING **: 09:46:58.276: Error setting property 'Powered' on interface org.bluez.Adapter1: GDBus.Error:org.bluez.Error.Blocked: Blocked through rfkill (g-io-error-quark, 36)

(budgie-panel:23362): WARNING : 09:46:58.400: BudgieMenuWindow.vala:190: Software has no parent directory, not adding to menu

but weirdly now getting"60.00 q" - so some sort of corruption/random memory string being used.

On Sat, 1 Jun 2019 at 09:10, David Mohammed davidmohammed@gmail.com wrote:

data: 'intel_backlight ' cleanData: 'intel_backlight' light: 'intel_backlight'

On Sat, 1 Jun 2019 at 03:34, Serdar ŞEN notifications@github.com wrote:

"ight" is very interesting.

@fossfreedom https://github.com/fossfreedom I prepared a simple script to understand this.

// File Name: // hello.vala//// Compile Command (Ignore compile warnings): // valac hello.vala --pkg gtk+-3.0//// Execute Command: // ./hello//// Sources:// https://wiki.gnome.org/Projects/Vala/Tutorial class Demo.HelloWorld : GLib.Object { public static int main(string[] args) { Bytes output; try { var cmdLine = new string[]{"ls", "/sys/class/backlight"}; var subprocess = new GLib.Subprocess.newv(cmdLine, SubprocessFlags.STDOUT_PIPE); subprocess.communicate(null, null, out output, null); var data = (string)output.get_data(); stdout.printf(@"data:\n'$data'\n");

        var cleanData = data._strip(); // trims whitespaces

        stdout.printf(@"cleanData:\n'$cleanData'\n");

        var backLightArray = cleanData.split("\n");

        foreach (var light in backLightArray)
        {
            stdout.printf(@"light:\n'$light'\n");
        }
    }
    catch (Error e)
    {
        GLib.message("Failed to run : %s", e.message);
    }

    return 0;
}

}

This is my terminal results when I run it:

[image: Screenshot from 2019-06-01 05:27:29] https://user-images.githubusercontent.com/26231317/58742543-06441d00-842e-11e9-826e-da5ddb86b1d0.png

Can you show me your results.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/serdarsen/budgie-advanced-brightness-controller/issues/11?email_source=notifications&email_token=AAHTHEFBYEUIWY4VXJRUCHLPYHN43A5CNFSM4HPXLW52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWWW7DQ#issuecomment-497905550, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHTHEAYWTQL5GV2MF6DEJDPYHN43ANCNFSM4HPXLW5Q .

fossfreedom commented 5 years ago

ok - looks like the bytes to string conversion is blowing up - in the subprocess helper I used the utf8 equivalent to fetch into a string instead of bytes and that works for me

public string RunAndGetResult(string[] cmdLine) { //Bytes output; string output; try { var proc = subprocessLauncher.spawnv(cmdLine); proc.communicate_utf8(null, null, out output, null); //var data = (string)output.get_data(); return output; } catch (Error e) { GLib.message("Failed to run : %s", e.message); return ""; } }

On Sat, 1 Jun 2019 at 09:49, David Mohammed davidmohammed@gmail.com wrote:

I'm going to put some message debug lines into the code to find out what is going on.

So immediately after retrieving the backlight list it looks ok ...

Message: 09:46:57.258: LightHelper.vala:67: lights intel_backlight 60.00 q Message: 09:46:57.258: LightHelper.vala:73: retrieved intel_backlight ** Message: 09:46:57.258: LightHelper.vala:73: retrieved 60.00 q cat: '/sys/class/backlight/60.00 q/max_brightness': No such file or directory

(budgie-panel:23362): GLib-CRITICAL **: 09:46:57.260: g_ascii_strtod: assertion 'nptr != NULL' failed cat: '/sys/class/backlight/60.00 q/brightness': No such file or directory

(budgie-panel:23362): GLib-CRITICAL : 09:46:57.262: g_ascii_strtod: assertion 'nptr != NULL' failed Message: 09:46:58.252: libsession.vala:50: DESKTOP_AUTOSTART_ID not set, session registration may be broken (not running budgie-desktop?)

(budgie-panel:23362): Bluetooth-WARNING **: 09:46:58.276: Error setting property 'Powered' on interface org.bluez.Adapter1: GDBus.Error:org.bluez.Error.Blocked: Blocked through rfkill (g-io-error-quark, 36)

(budgie-panel:23362): WARNING : 09:46:58.400: BudgieMenuWindow.vala:190: Software has no parent directory, not adding to menu

but weirdly now getting"60.00 q" - so some sort of corruption/random memory string being used.

On Sat, 1 Jun 2019 at 09:10, David Mohammed davidmohammed@gmail.com wrote:

data: 'intel_backlight ' cleanData: 'intel_backlight' light: 'intel_backlight'

On Sat, 1 Jun 2019 at 03:34, Serdar ŞEN notifications@github.com wrote:

"ight" is very interesting.

@fossfreedom https://github.com/fossfreedom I prepared a simple script to understand this.

// File Name: // hello.vala//// Compile Command (Ignore compile warnings): // valac hello.vala --pkg gtk+-3.0//// Execute Command: // ./hello//// Sources:// https://wiki.gnome.org/Projects/Vala/Tutorial class Demo.HelloWorld : GLib.Object { public static int main(string[] args) { Bytes output; try { var cmdLine = new string[]{"ls", "/sys/class/backlight"}; var subprocess = new GLib.Subprocess.newv(cmdLine, SubprocessFlags.STDOUT_PIPE); subprocess.communicate(null, null, out output, null); var data = (string)output.get_data(); stdout.printf(@"data:\n'$data'\n");

        var cleanData = data._strip(); // trims whitespaces

        stdout.printf(@"cleanData:\n'$cleanData'\n");

        var backLightArray = cleanData.split("\n");

        foreach (var light in backLightArray)
        {
            stdout.printf(@"light:\n'$light'\n");
        }
    }
    catch (Error e)
    {
        GLib.message("Failed to run : %s", e.message);
    }

    return 0;
}

}

This is my terminal results when I run it:

[image: Screenshot from 2019-06-01 05:27:29] https://user-images.githubusercontent.com/26231317/58742543-06441d00-842e-11e9-826e-da5ddb86b1d0.png

Can you show me your results.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/serdarsen/budgie-advanced-brightness-controller/issues/11?email_source=notifications&email_token=AAHTHEFBYEUIWY4VXJRUCHLPYHN43A5CNFSM4HPXLW52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWWW7DQ#issuecomment-497905550, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHTHEAYWTQL5GV2MF6DEJDPYHN43ANCNFSM4HPXLW5Q .

serdarsen commented 5 years ago

Awesome. I added the communicate_utf8 in v1.3.3