Comments (11)
I will look into this, perhaps using a "default"
option or something that automatically handles changes to the default sink. It might be a bit awkward if the two devices don't sample at the same rate though.
from glava.
@aaahh Thanks for the hint!
I ended up with a script to do that:
pactl move-source-output $(pactl list source-outputs short | grep $(pactl list short clients | grep glava | cut -f 1) | cut -f 1) @DEFAULT_MONITOR@
I think it's still nice to have this implemented in GLava, so I'm going to leave this issue open for now.
from glava.
I think subscribing pulseaudio events might also be a good way to implement it. This script captures the idea:
LANG=C pactl subscribe | grep "Event 'change' on server" --line-buffered | while read p; do
GLAVA=$(pactl list short clients | grep glava | cut -f 1);
FROM=$(pactl list source-outputs short | grep $GLAVA | cut -f 1);
pactl move-source-output $FROM @DEFAULT_MONITOR@;
done
I guess one possible way to do this in GLava is creating a separate pulseaudio mainloop thread to subscribe/handle server events, instead of rewriting whole pulse.c to use async api (not quite sure which would performance better).
from glava.
Just curious. What will happen if sample rate changed? Don't Pulse Audio have only one primary and one alternative sample rates?
from glava.
Just curious. What will happen if sample rate changed?
Nothing will break, but its ideal to sample at multiples of the sampling rate of the audio source, otherwise input has to be interpolated or segmented, which can produce unfavourable output in GLava.
from glava.
pavucontrol lets you change it under the "recording" tab, if there isn't an option to change the input but you see glava, check out your configuration profile
from glava.
Looking at this again, I'm not particularily sure how to implement this. I can do a few things here:
-
Frequently call
pa_context_get_server_info
, destroying & re-creating the audio monitor as the default sink changes (somewhat messy) -
Change the audio handling code such that multiple audio sinks can be used for a single GLava instance (much cleaner, doesn't require spamming the PA server for info). This method, however, would not allow you to use audio sinks that have yet to be instantiated under PA (ie. plugging in a new device).
Ideally, there would be some code to notify GLava of any changes to the default device, but I'm not sure if it's possible through PA or even something I should be doing within GLava. Perhaps a udev rule in combination with @op8867555's script is an acceptable solution for now -- in which case I would gladly add a complete solution to the README.md
file.
from glava.
Following up on this, not sure if I missed something on docs.
I use a separate speaker (Google Nest audio) for output and Glava doesn't work with that.
Some context: I have a Lenovo Legion 7i but it doesn't have audio support on linux, hence ended up with an external speaker. If I change Spotify's output from Nest to this device (7i) it starts working fine.
Is there some way I can have Glava working for this specific device output?
Edit: It works when I connect it with Bluetooth, not when I'm casting from Spotify to Nest Audio. Guess I'm sticking with bluetooth unless someone has a solution for that
from glava.
I have found that I suffer from this issue when my bluetooth headphones (a) power off then on or (b) switch to another connected device then back, as happens often throughout a workday.
I have been killing the GLava process then starting it again each time. The discussion here gives me enough to at least workaround the issue. Thanks.
from glava.
Following up on this, not sure if I missed something on docs.
I use a separate speaker (Google Nest audio) for output and Glava doesn't work with that.
Some context: I have a Lenovo Legion 7i but it doesn't have audio support on linux, hence ended up with an external speaker. If I change Spotify's output from Nest to this device (7i) it starts working fine.Is there some way I can have Glava working for this specific device output?
Edit: It works when I connect it with Bluetooth, not when I'm casting from Spotify to Nest Audio. Guess I'm sticking with bluetooth unless someone has a solution for that
Yeah, if you are casting, then you device isn't actually outputting the audio. Your Nest Audio will be streaming the music directly from Spotify, so I doubt there will ever be a solution for that.
from glava.
the script from #21 (comment) works perfectly for me! gonna add it to my session startup scripts! maybe this should be added to the docs
from glava.
Related Issues (20)
- Manjaro KDE setup no longer works after unplugging and replugging the monitors
- Glava stops running after some time
- Idea: add ALT-F4 ignore flag or config option
- cant figure out how to change the color of glava or resize glava when it is embedded to my desktop
- Transparency not working in Arch Linux with KDE Plasma (KWin) HOT 1
- How to uninstall Glava from Ubuntu HOT 1
- ninjac -C build throwing error while installing. HOT 1
- [Request] desktop mode support for qtile.
- Glava starts on wrong screen
- Would you please clarify in the readme if this works on xwayland, i.e., on Ubuntu 22+ HOT 1
- Problems with audio input
- Is this project dead? HOT 6
- AUR package fails to install with yay on artix HOT 1
- Wayland support. HOT 14
- error when executed "ninja -C build" command as given in readme.md, what is it, how to resolve? HOT 3
- can't build glava on Freebsd due to missing dependency error HOT 1
- Glava is showing on top of all windows
- --define similarly to --request
- Failing to build libglava.so: libglava.so.p/glava_glsl_ext.c.o:(.bss+0x0): first defined here
- Clickthrough with Wayland (Plasma 6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glava.