-
Notifications
You must be signed in to change notification settings - Fork 779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functionality for MiniDSP 2x4HD #737
base: master
Are you sure you want to change the base?
Conversation
Looking good. I've left one comment. Can you address this and then I'll merge it :) |
I added also the functionality to retrieve current config from MiniDSP 2x4HD. |
I can check if I can add these later this week. @Lauszus I don't know if you'd rather merge this change in already, or if you'd like to merge everything together later? |
Better later. After the function for "send" is added!? |
Okay great. Just let me know when it's ready to get merged :) |
I updated the code to also retrieve the current config + I fixed the callback for input source not being called (Might be handy for you, @MarkLido ). Updating volume has not been done yet. However, @Lauszus , I'm having an issue, in
Which send commands, but don't listening for a response, so most of the time the response to the first command (request status), is just lost. What would you suggest here? I guess I'm using the library wrong, should I use |
Thanks @dennisfrett. The callback for input source works now. I added also the config callback in the ino. Works perfectly. |
uint8_t SetMutedommand[] = {0x17, muted ? (uint8_t)0x01 : (uint8_t)0x00}; | ||
|
||
SendCommand(SetMutedommand, sizeof(SetMutedommand)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing new line.
return; | ||
} | ||
|
||
uint8_t SetVolumeCommand[] = {0x42, (uint8_t)(-2*volumeDB)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint8_t SetVolumeCommand[] = {0x42, (uint8_t)(-2*volumeDB)}; | |
uint8_t SetVolumeCommand[] = {0x42, (uint8_t)round(-2.0f * volumeDB)}; |
void MiniDSP::setVolumeDB(float volumeDB) const { | ||
// Only accept values between 0dB and -127.5dB. | ||
// Don't do error handling. | ||
if(volume > 0 || volume < -127.5){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(volume > 0 || volume < -127.5){ | |
if(volume < 0 || volume > -127.5) { |
/** | ||
* Send the "Request input source" command to the MiniDSP. | ||
*/ | ||
void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void | |
void RequestInputSource() const; |
/** | ||
* Send the "Request config" command to the MiniDSP. | ||
*/ | ||
void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void | |
void RequestConfig() const; |
An workaround would be to just add |
@Lauszus Writing this driver without a way too easily debug USB pakets seems quite difficult, and my current implementation has some bugs ( Once I figure out what's going wrong and fix it, I'll update the PR. |
Additional functionality for the MiniDSP driver.