kgshank / gse-sound-output-device-chooser

Gnome Shell Extension to show a simple chooser to select Input & Output device based on gnome control center
https://extensions.gnome.org/extension/906/sound-output-device-chooser/
GNU General Public License v3.0
771 stars 95 forks source link

[BUG]Gnome shell 42 not support #229

Open plumlis opened 2 years ago

plumlis commented 2 years ago

Fedora 36 with Gnome-shell 42

Extension can't be installed and enabled.

See log:

JS ERROR: Extension sound-output-device-chooser@kgshank.net: Error: Wrong type undefined; string expected setIcon@resource:///org/gnome/shell/ui/popupMenu.js:479:13 _init@resource:///org/gnome/shell/ui/popupMenu.js:471:14 _init@/home/plum/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js:98:19 PopupBaseMenuItem@resource:///org/gnome/shell/ui/popupMenu.js:73:4 PopupImageMenuItem@resource:///org/gnome/shell/ui/popupMenu.js:454:1 SoundDeviceMenuItem@/home/plum/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js:92:9 _deviceAdded@/home/plum/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js:325:19 _onControlStateChanged@/home/plum/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js:280:22 SoundDeviceChooserBase@/home/plum/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js:231:18 SoundOutputDeviceChooser@/home/plum/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js:33:9 enable@/home/plum/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js:155:36 _callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:181:32 loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:363:26 _onInstallButtonPressed@resource:///org/gnome/shell/ui/extensionDownloader.js:267:35 Async*addButton/<@resource:///org/gnome/shell/ui/dialog.js:132:41

carlwgeorge commented 2 years ago

I get a similar error in the journal when I enable this extension. I'm using 4a6f0f2fc72eba991ffc3e75cc6a67620b580054 with gnome-shell-42~rc-3.fc36 on Fedora 36.

JS ERROR: Extension sound-output-device-chooser@kgshank.net: Error: Wrong type undefined; string expected
setIcon@resource:///org/gnome/shell/ui/popupMenu.js:479:13
_init@resource:///org/gnome/shell/ui/popupMenu.js:471:14
_init@/usr/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js:99:19
PopupBaseMenuItem@resource:///org/gnome/shell/ui/popupMenu.js:73:4
PopupImageMenuItem@resource:///org/gnome/shell/ui/popupMenu.js:454:1
SoundDeviceMenuItem@/usr/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js:93:9
_deviceAdded@/usr/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js:326:19
_onControlStateChanged@/usr/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js:281:22
SoundDeviceChooserBase@/usr/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/base.js:231:18
SoundOutputDeviceChooser@/usr/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js:35:9
enable@/usr/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js:157:36
_callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:181:32
_onEnabledExtensionsChanged/<@resource:///org/gnome/shell/ui/extensionSystem.js:507:35
_onEnabledExtensionsChanged@resource:///org/gnome/shell/ui/extensionSystem.js:507:14
createCheckedMethod/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:533:46
enableExtension@resource:///org/gnome/shell/ui/extensionSystem.js:208:29
EnableExtension@resource:///org/gnome/shell/ui/shellDBus.js:447:38
_handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:310:38
_wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:387:34
fortizc commented 2 years ago

Same error in Debian Sid

iadegesso commented 2 years ago

Here too on my Gentoo

palWorx commented 2 years ago

Same error on Debian sid. Is this extension still in active development, because the developer didn't even react to any of the last issues and there seems to be no action since beginning of february?

justinkb commented 2 years ago

I've found the problem:

https://github.com/kgshank/gse-sound-output-device-chooser/blob/4a6f0f2fc72eba991ffc3e75cc6a67620b580054/sound-output-device-chooser%40kgshank.net/base.js#L93

the code after the superclass constructor never gets executed, in this case the _init function (which is obviously important)

Why? no idea

edit: potentially related to gjs upgrade 1.72.0 that came with gnome 42. since 1.71.1 (prelease), they changed how constructor() functions and _init() functions work with GObject subclasses

bhack commented 2 years ago

These are the API changes/upgrade tips: https://gjs.guide/extensions/upgrading/gnome-shell-42.html

justinkb commented 2 years ago

Yeah, I've been looking at that page all day yesterday. Seems incomplete to say the least

On Sun, Mar 27, 2022, 2:04 PM bhack @.***> wrote:

These are the API changes/upgrade tips: https://gjs.guide/extensions/upgrading/gnome-shell-42.html

— Reply to this email directly, view it on GitHub https://github.com/kgshank/gse-sound-output-device-chooser/issues/229#issuecomment-1079916199, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVHKGHIT75KO3ZADGCBZDVCBME5ANCNFSM5RB4VDXQ . You are receiving this because you commented.Message ID: @.***>

jeffmahoney commented 2 years ago

I've created PR #230 with the above commit. It fixes it for me. The explanation is in the commit message but the tl;dr is that this extension has had a bug that violated the guidelines for subclassing GObject but it was harmless until gjs 1.72.0.

justinkb commented 2 years ago

@jeffmahoney tested on nixos and confirmed working perfectly!

minax007 commented 2 years ago

Dear @jeffmahoney

Thanks for your efforts!

I saw that @justinkb confirmed that it is working.

So I tested your reworked base.js file on my Debian Sid system with Gnome Shell 42 but it doesn't work.

It still shows "Extension initialising ..." even though I have adopted the shell version in the metadata.json file and restarted.

Do you have any idea what could be missing?

In the gnome-control-center my system shows "Gnome shell 42.0".

But if I check it via the command line it shows "Gnome shell 41.4".

So it could also be a problem of my system.

kgshank commented 2 years ago

I was held up with work. I will push the changes soon. Thanks @jeffmahoney for the PR. I will merge and test the changes

palWorx commented 2 years ago

@minax007 I am also on Debian sid and it worked for me even after F2+r instead of a restart, so i guess you possibly have a problem in the metadata.json change. Whats different to your setup is that i switched off the compatibility check for extensions with dconf.

justinkb commented 2 years ago

Ah right. In my nix package definition I've added that commit that enables 42 support too as a patch.

On Tue, Mar 29, 2022, 1:46 PM palWorx @.***> wrote:

@minax007 https://github.com/minax007 I am also on Debian sid and it worked for me even after F2+r instead of a restart, so i guess you possibly have a problem in the metadata.json change. Whats different to your setup is that i switched off the compatibility check for extensions with dconf.

— Reply to this email directly, view it on GitHub https://github.com/kgshank/gse-sound-output-device-chooser/issues/229#issuecomment-1081770218, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVHKDWQ4ETATRGSLB6LIDVCLURNANCNFSM5RB4VDXQ . You are receiving this because you were mentioned.Message ID: @.***>

minax007 commented 2 years ago

Dear @palWorx

thanks for the hint.

I have activated in dconf-editor the parameter "“disable-extension-version-validation”.

And have downloaded the latest build.

And now it works!

Thanks to all of of the contributors and supporters!

justinkb commented 2 years ago

You must not have applied the patch correctly to from wherever your system is loading the addon

On Tue, Mar 29, 2022, 2:24 PM minax007 @.***> wrote:

Dear @palWorx https://github.com/palWorx

thanks for the hint.

I have activated in dconf-editor the parameter "“disable-extension-version-validation” - but the result is the same.

It still shows "Extension initialising ...".

— Reply to this email directly, view it on GitHub https://github.com/kgshank/gse-sound-output-device-chooser/issues/229#issuecomment-1081806236, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVHKCLYACJPPUPXDTLLMLVCLZBDANCNFSM5RB4VDXQ . You are receiving this because you were mentioned.Message ID: @.***>

palWorx commented 2 years ago

@justinkb @minax007 My system is going crazy right now, I have undone the setting "disable-extension-version-validation" and am currently adjusting the metadata.json outdated extension by extension until I find the one that makes my system unusable. The moment I start Firefox it's game over.

minax007 commented 2 years ago

@palWorx

I can confirm that I have no problems with Debian Sid.

So I think that it is not related to this gnome shell extension.

Potentially you have another extension which caused the problem when disabling the extenion version validation.

palWorx commented 2 years ago

@minax007 It's definitlely not "gse-sound-output-device-chooser" which runs again like a charm. It's about to not follow my advice to activate "disable-extension-version-validation" till this "change-from gnome-41-to-42"-Horror has ended. At least for me, in all these years, no change has had such a negative impact as the switch from gnome 41 to 42.

plumlis commented 2 years ago

I just following the Installation Instructions and everything works like a charm.

minax007 commented 2 years ago

@palWorx

I can confirm the same. In all previous gnome shell updates it was sufficient to adopt the metadata.json file and all worked fine. Now with gnome shell 42 it all became a mess. I have lost one of my most liked gnome shell extensions - and see that there is noone actively developing it any further. But at least this one works now again.

carlwgeorge commented 2 years ago

I've updated the Fedora package to include the necessary patches. If any Fedora 36 early adopters would like to test it will be available as gnome-shell-extension-sound-output-device-chooser-40^2.4a6f0f2-2.fc36, which is on it's way to the updates-testing repository.

bellini666 commented 2 years ago

New version works great! @kgshank can you upload the new version to extensions.gnome.org? I can see that the version there is even older than previous fixes in this repo

vquemener commented 2 years ago

@carlwgeorge I can confirm that the RPM gnome-shell-extension-sound-output-device-chooser-40^2.4a6f0f2-2.fc36.noarch from updates-testing works great on Fedora 36 👍

kgshank commented 2 years ago

The new version is uploaded into extensions.gnome.org and should be available after review

pabs3 commented 2 years ago

You might want to make a GitHub release for GNOME shell 42, so that downstream distros like Fedora or Debian can package it.

https://github.com/kgshank/gse-sound-output-device-chooser/releases

FYI gnome-shell 42 has reached Debian bookworm and gnome-shell-extension-sound-device-chooser has been removed.

https://bugs.debian.org/1008556

francoism90 commented 2 years ago

@kgshank Asking the same for Arch Linux (AUR). :)

kgshank commented 2 years ago

@pabs3 & @francoism90 I missed to make a release this time. New releases are available now.

kgshank commented 2 years ago

Hi Everyone, the latest git version has some changes for Gnome V3.32. Since it affects the changes made for v42, is it possible for some of you to test the git version in V40/V42 and let me know whether all works good.

thesmallcreeper commented 2 years ago

@kgshank Did you test at Gnome 3.32?

kgshank commented 2 years ago

@thesmallcreeper Yes I tested basic functionality to switch devices in Rocky Linux and @SonGokussj4 confirmed in #234 I haven't tried all the extension options rigorously though.

SonGokussj4 commented 2 years ago

It works well from the last update. After PC restart, I've noticed a warning in /var/log/messages

sudo cat /var/log/messages | grep sound-output-device-chooser
Apr 13 17:29:47 tacticus journal[3205]: JS WARNING: [/home/jverner/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js 230]: reference to undefined property "_ornamentLabel"
Apr 13 17:29:47 tacticus journal[3205]: Extension "sound-output-device-chooser@kgshank.net" had error: TypeError: sliderItem._ornamentLabel is undefined
Apr 13 17:29:49 tacticus journal[3205]: JS WARNING: [/home/jverner/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/convenience.js 72]: reference to undefined property "id"

But, once again, it does appear to work without a problem for now :-)

carlwgeorge commented 2 years ago

Hi Everyone, the latest git version has some changes for Gnome V3.32. Since it affects the changes made for v42, is it possible for some of you to test the git version in V40/V42 and let me know whether all works good.

I tested f92fcbfe64774ff597c64cdc9844fccb86f72265 on Fedora 36 Beta with GNOME Shell 42.0. As far as I can tell it works.

kgshank commented 2 years ago

@SonGokussj4 There are updates for the message you got,please check

sa-bre commented 2 years ago

In case anyone has the same problem: After updating to Fedora 36 for whatever reason gnome extensions were disabled all together. Opening the Extensions application and switching the toggle in the top bar did the trick.