Closed rharish101 closed 6 years ago
It works fine, I see transparency in those screenshots (although they are subtle).
Firstly it's hacky code. There is no "legit" way of doing this in Xlib. I think you'll have much more luck with OpenGL.
The code basically does this:
foreground_color = (opacity*255)<<24 + foreground % 0x1000000;
Non-techy: I'm touching variables that I shouldn't do normally in my code.
It's results are unpredictable, but it created an interesting effect so I decided to leave it in as an option.
Actually, I intended to have no transparency, and thus I opened up this issue since the transparency's not changing at all. I also have enabled OpenGL support. I also tried out this one: https://github.com/HaCk3Dq/spectrumyzer . Opacity control works well with this app, though it's missing some features from CAVA, and it's only GUI. You could look into this if you're interested.
@rharish101 This is actually an issue. Will commit patch soon.
Source of issue: OpenGL context doesn't have transparency by default.
Patch applied, recompile and test again. Thanks for finding out this (makes shadows look better TBH). I didn't know it was broken.
It sorta works; I can change transparency, but I still can't get full opacity. Here are 2 images: At value 0.5: At value 1.0: 100% opacity is still missing though.
@rharish101 Have you recompiled? I didn't notice this issue in my testing.
Yeah, I reinstalled it from the AUR, which should recompile it. Also, it there was no difference between values 0.5 and 1 before your patch.
@rharish101 Sorry but I couldn't reproduce the issue. IDK, what's wrong. Have you tried commenting the line and see if that works.
Yeah, I tried that; it has the same effect as opacity value 1.0. Also, if I disable transparency, I get this error:
TERMINATED
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 155 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 44
Current serial number in output stream: 45
Maybe it's related? Meanwhile, here's my config in txt format: config.txt
@rharish101 You can't disable transparency and have opacity. I forgot to put a error check, I guess.
TODO: ^
@rharish101 Just vertified it on my Arch rig. Even with your configuration it works fine. Are you using a non-standard system fxp. running in Wayland or using a heavy compozitor as compiz? Are you running propriatery drivers such as nvidia ones (those cause a ton of problems)? Sorry for asking, but may you share system specs? It will be really helpful if you do.
Yeah sure:
@rharish101 The issue is at driver level, nVidia drivers by default don't support transparent GLX windows. To fix this:
1) Backup /etc/X11/xorg.conf 2) Run " sudo nvidia-xconfig -d 24 --add-argb-glx-visuals --allow-glx-with-composite --randr-rotation" 3) Reboot/restart X properly 4) Run cava again
The command nvidia-xconfig did not accept --randr-rotation. Also, after doing it without the last flag, GDM started at a lower resolution, and logging in showed a black screen. Is there some other way?
@rharish101 But still the issue is not on my end, nVidia have "non-feature complete" drivers. There are workarounds however, 1) Use i915 drivers for openGL instead 2) Switch to nouveau completely 3) Try that command patch if none of these worked.
The issue remains open, sorry but I can't help much since the whole thing is built upon GLX. And nVidia drivers don't like the GLX alpha channel.
Well, I can't switch to nouveau since I need the Nvidia drivers for Tensorflow. I'll look into the 1st one and try it out. Anyway, thanks for the support. I'll close the issue.
@rharish101 i figured it out finally.... turns out that nvidia drivers need Xrender in order to have a proper color profile
first test on an dedicated nvidia gpu seems to work, i'll push this update once it doesn't break half of the code
screenshot: https://i.imgur.com/p90Rz8c.png
the issue was that the transparency was calculated as a subtraction from the pure white color in RGB space and as such caused that bug, still curious about why it only happens on the nvidia driver (its not hardware because nouveau fixes this)
edit: the nvidia driver ignores the alpha channel completely without this
@rharish101 https://i.imgur.com/wLOCIhZ.png we got the same gpu now lol
Awesome! Could you now update the AUR PKGBUILD soon? It's the only thing left.
@rharish101 updated, however things have changed:
1) foreground_opacity doens't work (as you can tell) it does, I was just using it wrong
2) it's not cava-gui it's xava now
Thanks for updating the AUR package! I have two issues now:
@rharish101 Sorry if i sound rude a bit here, but I don't think bumblebee should be or was EVEN INTENDED used for any type of compositing application since it emulates an invisible X server and just copies the image into a new window (that includes the background too, so no transparency is just the result of that). Just to remind you that the last commit was from 2013 so don't expect any good support/results.
You can try running a another transparent app through bumblebee and see if it creates a desired result, I could be totally wrong on this, idk.
But yeah, I should sort out the config thing.
I know that the comments in the config mention that it's buggy, but it's not working at all!
With a light background:
With a dark background (this screenshot was before the overshooting fix):