omriharel / deej

Set app volumes with real sliders! deej is an Arduino & Go project to let you build your own hardware mixer for Windows and Linux

Home Page:https://deej.rocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serial connection frequently stops in Windows

ThreepE0 opened this issue · comments

I've found that almost more often than not, when I reach for my Deej mixer, it simply doesn't work until I restart the Deej app. I've worked around the issue by adding a Windows task scheduler item to restart the app every five minutes, but there has to be a better way.

I do know it happens after sleep/resume, but I'm certain it happens at other times as well, and I'm not sure why.

Wondering if it'd be possible to at least raise a flag, make a log entry, or something else in the event that the app can't read from the serial connection. This way I can watch that log for entries and kick off a restart, assuming the app can't recover from whatever is wrong itself.

as a quick update: I noticed that restarting the app on a schedule in the background was interrupting fullscreen applications, so I had to ditch that approach. Something else that I found works, and I wanted to mention here because it may help troubleshoot, is that editing the yaml config file's COM port setting, then waiting a second or two and changing it back, prompts the software to reload the serial connection, and the app starts working again.

I'm doing this in powershell and windows scheduler currently, and it keeps the app running pretty reliably, even after sleep which I think is the main cause, but not the only cause, of the serial connection breaking. It'd be great if this got fixed in the app itself at some point, but this appears to be a workable solution. The only downside currently are the annoying notifications that the config has been reloaded when my script runs. Again, not a permanent solution, and not a clean one, but one that works for me at the moment.

I noticed in the code (I don't speak golang, sorry) that the serial connection is supposed to reload both on config file change, as well as if the app can't read lines from the serial connection. It appears that it's not reloading when it can't read a line, but it IS reloading when there is a config change to the COM port.

Hi there @ThreepE0, thank you for writing!

This is a known issue - currently the only workaround I can suggest is to restart deej when the connection is interrupted. As mentioned in #38 and #23, I intend to fix this in the next release as part of an overall connection stability pass. I'll close this issue as it somewhat duplicates #38.

I will mention that these disconnections aren't expected to be a frequent occurrence, and if that's the case for you I would suggest to look into power-saving settings and other similar things that may be causing your board to disconnect even when the computer doesn't go into sleep mode.

If you have more questions please feel free to leave a comment (or contact me via the project's Discord). Thanks!

@omriharel "restart deej when the connection is interrupted." I have to say I'm a bit let down by this reply, as it doesn't appear that you read or put any thought into either of my replies. I was hoping that my comment would help you in coming up with a fix, or at least provide a data point. I've found a workaround myself, so that base is covered. After taking a quick look I found that, I think anyways, the serial communication failure detection that is already built into the app doesn't appear to work correctly. Do you have any thoughts on that?

Hi there @ThreepE0. I did read your comments, but I don't have a better solution to offer until this is fixed properly so I was affirming your current workaround as the option I'm recommending until the next deej release.

I'm familiar with the connection mechanism in deej (having written it 😅), and I do have a concrete plan for a fix that will address all of the current issues in this area (including the one affecting your setup). Coming up with the specifics of that fix isn't an issue (the details have already been discussed - and finalized - in the project's Discord server). However, I work on deej during my free time and when my motivation allows it, so I don't have a timeline for this other than "soon". I hope that in the meantime you'll continue enjoying deej in its current state, and please do stay tuned for future updates.