Can't change audio output until restart of hagent
idk how to reproduce yet. I'm on the latest available beta.
II have one audio sensor that I use to get e.g my headphones speakrs whatever else I have connected
I use a dropdown select with data from that sensor. This works, I get the exact names, perfect so far!
Now, I have an automation that on change of the dropdown changes the audio output via mqtt command on homeassistant/button/MainPC/setaudiooutput/action
This also works!
But sometimes it doesn't until a restart idk why yet though. It almost always happens when I turn off my monitors and go to sleep. I use smart switches to actually turn them off, not sure if related.
34 Replies
...how did I get to the logs again lol
oh boi
uuuuuuuuuuuuuuuuuuuuuuuuuuuuh It's adding 2kb every second to the log
@ChrisRosenkreuz23
Going to add you in here instead of a new one
Ok
@Amadeo , @ChrisRosenkreuz23 is having a similar looking trace to me when changing volume
That's not good ๐ญ
One thing I would try if you want @ChrisRosenkreuz23 is downgrading to beta1, that would fix this new issue afaik, but it shouldn't be that hard to fix if Ur happy to wait a couple of days
I'm good, I can wait
I've also passed the usb device to virtualbox at one epoint then passed it back
usb device=audio device
Hm, so the trace only occurs while trying to change volume?
And just to confirm, changing volume by command or by media player
There was an issue with audio devices getting invalidated but I though we fixed it while investigating the audio memory leak
Command, however @barrelltitor appears to have the issue for changing audio output. Reading the stack trace it seems anything Todo with audio is failing sometimes, doesn't matter if it's volume or not.
If it matter I reproduced with volumd
Now question what causes it to fail, the first suspect is sleep but...
Mine didn't do it immediately but i don't think it was sleep, my laptop is extremely messed up and it will turn back on 3s after sleeping. Meaning I have no easy way of knowing if it was sleep, sorry ๐
My computer never sleeps ๐
I have a rotary thingy from ikea I use to turn volume up down and pause, and a 2 button switch I use to change between audio devices
I use the mute command too, I turn off my speakers via actual power off but I use an audio interface so it shouldn't matter at all as the interface is still on
that's all the sensors & commands I have, can givee config if needed
I woke up about an hour or two ago, and I did the exact same things as the day before, but this time it's still working
any news on this?
the faulty setvolume command, I mean
still trying to properly reproduce this
audio stuff is starting to give me nightmares xd
oh I think I know what it is
damnnit
so, issue is with COM threading compartments
I hate it
I have a POC of fix however it comes with a downside
a small reduction in audio stuff performance
I'll try to get is as "perfrormant" as possible, do some tests with monitors with speakers being turned on/off and then do a test build for you
now to figure out if it doesn't leak memory
I swear
each time I dabble in audio stuff part of my soul dies
@barrelltitor @ChrisRosenkreuz23 (+@sreknob & @rafo as you were involved in the previous thread)
https://github.com/amadeo-alex/HASS.Agent/releases/tag/2.1.0-beta3-audio-comthread
please try when you'll have some spare time - I tried to test various scenarios including just yanking the power cable to one of my monitors (quipped with speakers ofc) and it appears to be working
GitHub
Release 2.1.0-beta3-audio-comthread ยท amadeo-alex/HASS.Agent
Please do not download files from this "release"
It's only purpose if to provide testing bed for the insiders/issue reporters.
Unless explicitly instructed by the developers, please d...
of course, as always please backup your config
Will give it a shot tomorrow. Anything in particular we should test/keep an eye out for?
two main objectives with this one:
- no errors in logs (excluding the "first time" ones)
- no mem leak (still)
and ofc all commands/sensors working ๐
Testing now. Only thing of note in the logs on startup so far is:
those are fortunately first chance exceptions ๐
hi yes hello i am alive am testing
i dont use the satellite service so i didnt install it
hmmmm local api was disabled after the update
did you select the migrate option by any chance?
Not sure, everything else is ok though, oinly issue is I still can't change my audio a day later
Will debug zigbee first
so it sent the correct name
My logs show no errors, it only shows when I switch to the speakers
When I restarted it I did get this
Not sure if its normal for restarts
However, after a restart of the agent, it worked fine! So I'm thinking it could have been a stuck command not letting others pass thru properly or something?
When I head to sleep I turn off power to the monitors from smart sockets, same for speakers, just headphones remain
I also mute sound
When I wake up, they all turn on
The computer itself doesn't sleep, it just idles
I haven't figured out exactly how to reproduce this yet
those first chance exceptions are related to mqtt connection
not something that we need to be worrited atm
hm
unless you couldn't change the device because hass.agent didn't had connection to mqtt anymore?
It's from when I restarted, so I thought it might just be it closing the connection.
But since it worked right after and had no error logs idk
Had a vet emergency, will give full log when I'm back
hope it works out ok
Idiots ate 3d printing filament
XD
Or I think they did they were playing with it for 20mins and i found a piece onone of their tongues
cats?