Coder Social home page Coder Social logo

Invalid amp id: 0 about plug HOT 19 CLOSED

Wrzlprnft avatar Wrzlprnft commented on August 18, 2024
Invalid amp id: 0

from plug.

Comments (19)

offa avatar offa commented on August 18, 2024 2

I'm already on a very simple package dump ๐Ÿ˜‰.

Good luck for the exams btw.!

from plug.

Wrzlprnft avatar Wrzlprnft commented on August 18, 2024 1

I just tried https://bitbucket.org/piorekf/plug/ and it starts and connects, and i used it to update the amp's firmware (to now 2.2).
This repo's fork just has a quick flash of a window opening and closing on startup with the amp connected (edit: with the error reported above), or a "failed to open usb device" with the amp not connected.

from plug.

offa avatar offa commented on August 18, 2024 1

Thanks for reporting the issue. What version of Plug (= this fork) are you using?
Does the problem occur always or is it working sometimes?

I experienced such a problem myself a while ago: At startup the application threw an exception because nothing (or garbage) was transmitted from the amp. After some retries I received the correct data. Unfortunately I couldn't figure out the problem yet.

I don't know what to do for further troubleshooting. Is there a way to query the preset values on the amp?

There's no query at the moment, but I can add a simple dump function to check the data from the amp.

from plug.

Wrzlprnft avatar Wrzlprnft commented on August 18, 2024 1

Oh, i am always surprised when it comes to what git can do i either didn't know about, or did forget that that was a thing :D Ill try that.

A Mustang 1 V.2

from plug.

Wrzlprnft avatar Wrzlprnft commented on August 18, 2024 1

Oh, no hurry from my side, if i really need to use the software, i know to what commit i can revert to/what line of code i'd need to comment out (that would make it more unsafe, but be on my head for myself).
Ill just keep an eye out for when/if you make changes in the future and test those. Or perhaps some day inspiration/motivation strikes me to work my way into the code and write something.

from plug.

Wrzlprnft avatar Wrzlprnft commented on August 18, 2024

I cloned the git repo as is, so it's the master branch at the commit a52a583.
Edit2: It also happens with the most recent release 1.4.0

Edit: so far the problem occurs every single time.

Edit3:
cmake version: 3.15.3_1
qt5 version: 5.13.1_1
libusb-1.0.22_1

from plug.

offa avatar offa commented on August 18, 2024

Can you test with an older release (eg. 1.3.0)? But I assume all versions are affected.

from plug.

Wrzlprnft avatar Wrzlprnft commented on August 18, 2024

Release 1.3.0 seems to work every single time (when amp is off, it still starts but in disconnected state).
Any hint to what commit i could start with in hunting the issue down?

Edit: Behaviour persists after reboot: 1.3 works, 1.4 and current HEAD don't.

from plug.

offa avatar offa commented on August 18, 2024

Unfortunately I can't reproduce it on my system. :-(

If there's a good version, it's possible to use git bisect to figure out what version introduced the error:

git bisect start
git bisect good v1.3.0
git bisect bad master

What mustang are you using btw.?

from plug.

offa avatar offa commented on August 18, 2024

Thanks for your help! ๐Ÿ‘

from plug.

Wrzlprnft avatar Wrzlprnft commented on August 18, 2024

57f15eb
ends up to be the first bad commit.
The one before i can start it and connect and load presets and do stuff.

I gladly help.

from plug.

offa avatar offa commented on August 18, 2024

This makes sense somehow: Previously an amp id of 0 was silently accepted, but since that commit it throws an error.

According enums "0" is not a valid amp id. The question is, does 0 represent a valid state or does the initial transmission fail do send anything useful? ๐Ÿ˜•

from plug.

Wrzlprnft avatar Wrzlprnft commented on August 18, 2024

Now, my C and C++ programming is a bit rusty, and i have a couple of exams coming up the next two weeks. I doubt that i can come up with the code for dumping the first transmisson or what's saved on the amp in general. At least not in these two weeks.
if you do, though, ill happily test it next weekend.

Edit: Or if there happens some sort of truncation fail on the transmission. i'd guess it's more the first transmission is nothing useful, though.

from plug.

offa avatar offa commented on August 18, 2024

Edit: Or if there happens some sort of truncation fail on the transmission. i'd guess it's more the first transmission is nothing useful, though.

From what I have experienced earlier, the first transmission sends either correct data (= no problem) or nothing / garbage (= exception).

from plug.

offa avatar offa commented on August 18, 2024

There's a very, very basic dump in the 176-invalid_amp_id branch. It simply writes the bytes of the initial transmission to stdout.

from plug.

Wrzlprnft avatar Wrzlprnft commented on August 18, 2024
ยป ./plug
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-wrzlprnft'
---[Initial]------------------------
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
------------------------------------
terminate called after throwing an instance of 'std::invalid_argument'
  what():  Invalid amp id: 0
[1]    11193 abort      ./plug

Edit: and thanks!

from plug.

offa avatar offa commented on August 18, 2024

I see โ€ฆ

โ€ฆ at least it's not garbage โ€ฆ

from plug.

offa avatar offa commented on August 18, 2024

It's possible that the real data comes in another transmission. This worked in earlier releases (including the initial project) as those didn't check the values range.

The implementation isn't robust enough to handle malformed or invalid packages; the first transmission is evaluated whatever goes over the wire.

This definitely needs an improved communication which correctly reacts to the packages transmitted. In addition it shouldn't block the UI and the error handling needs some improvements too.

Unfortunately I can't come up with a fast fix here, as it's a major change in how things work.

from plug.

offa avatar offa commented on August 18, 2024

I have implemented a first workaround to address this. Instead of crashing, an error message is shown in the UI and log. Still, there are major changes of the whole process necessary to really fix this issue.

The broken reconnect is fixed too now.

In some cases it may also indicate a missing amp support; I'm not sure if all amps of the V2 models are already integrated.

Please let me know if there are further problems.

from plug.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.