Add ability to add custom PulseAudio startup commands#197
Add ability to add custom PulseAudio startup commands#197ntninja wants to merge 2 commits intohome-assistant:masterfrom
Conversation
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
Thank you for your PR. How would the user create those configuration files? Do you have a specific use case? Maybe we could support that with an updated default configuration file. |
|
I had just assumed they are available through advanced terminal, but turns out I’m wrong. Is there any reason why My use-case is to logically split the streams of a single audio device, since the actual speakers wired to it are physically located in different rooms: While having this available as a native option in Home Assistant would be great, it would require changes to supervisor (for API) and a corresponding integration in Core, I believe. So significant changes. |
|
Also changed the approach a bit regarding the |
|
(Given Home Assistants limitations regarding local audio, the whole setup is quite weird anyways: Create 2 mapped subsinks in PulseAudio, Run 2 instances of SqueezeLite add-on with each targeting on of the subsinks, then have Music Assistant connect to both SqueezeLite instances to actually manage their audio… Yeah, layers…! – Really hope Music Assistant gets local audio capabilities at some point, but who know if and when… 🤷♀️) |
agners
left a comment
There was a problem hiding this comment.
I am still a bit uncertain if we really want to add this capability. It opens a lot of flexibility, but it also feels a very not user friendly way 🤔 .
We could copy the customization file from another location on audio plug-in startup, e.g. /share.
In your current use case you don't use the override.pa, correct? Maybe we could just start with the customization file 🤔 .
| # | ||
| # Using nofail has two effects here: | ||
| # 1) Causes PulseAudio to log a message at startup if the user configuration | ||
| # is not present to increase visible of the corresponding configuration |
There was a problem hiding this comment.
By that you mean so users learn about the possibility?
Seems weird to me to do that through an error 😅 . I'd rather go with ifexists here, and document the capabilities somewhere.
There was a problem hiding this comment.
Well, its just a warning. When I started digging into: How do I get this to work? One of the first things I did was look through the commands exposed by ha audio, including the ha audio logs sub-command. I’ve intentionally included an example of the message logged there, so that it’d eventually end up in online searches.
Obviously we want to document this, but the idea would be that the documentation includes that messages as an “this means no config was loaded” example that would then also show up in searches.
In that way, I think its quite useful, also to give you feedback on whether your custom configuration has been picked up or not.
Yeah, I don’t need the Is there some save location that is accessible through Advanced Terminal but not regular Terminal / SAMBA perhaps? That’d feel like the right place to me. |
|
What’s the status on this? Hand-patching the PulseAudio container after HAOS updates is kinda annoying honestly… |
|
One concern is that it is a rather implementation specific way of configuring things. This especially comes problematic if we want to move away from PulseAudio, e.g. moving to PipeWire. I'd definitely prefer if we'd keep this minimal, so simply support |
Loads two extra “user-configurable” configuration files: /mnt/data/supervisor/audio/override.pa … replaces the default configuration, if present. /mnt/data/supervisor/audio/custom.pa … is appended to the default configuration, if present.
|
Alright, I dropped the override. I don’t think its a problem to have it, but its fine not to have it too. Hope this version is acceptable, until PipeWire happens at least! |
Loads two extra “user-configurable” configuration files:
/mnt/data/supervisor/audio/override.pa
… replaces the default configuration, if present.
/mnt/data/supervisor/audio/custom.pa
… is appended to the default configuration, if present.
Tested and working… but kinda requires at least Advanced Terminal & SSH (if not host access) to be useful given how complicated it is to access these files.
Minimally addresses #178.