Add functionality for MiniDSP 2x4HD#737
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)); | ||
| } No newline at end of file |
| return; | ||
| } | ||
|
|
||
| uint8_t SetVolumeCommand[] = {0x42, (uint8_t)(-2*volumeDB)}; |
There was a problem hiding this comment.
| 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.
| 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.
| void | |
| void RequestInputSource() const; |
| /** | ||
| * Send the "Request config" command to the MiniDSP. | ||
| */ | ||
| void |
There was a problem hiding this comment.
| 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.