Controller list in preferences shows garbage
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Mixxx 1.12 (currently build 5557, but happened with earlier versions too). I can't remember if it happened too with 1.11 (i tried that one briefly before jumping to 1.12)
Windows 10 (Upgraded from 7).
Intel core 2 Duo
Integrated video and audio
I have found a strange bug in Mixxx. It is mostly a visual annoyance than anything serious, but I would like to help in fixing it.
Concretely, in the preferences, under the controllers list, several controllers appear with garbage in their name. (The name is shown as if it was chinese, but the "letters" change from launch to launch so I am quite sure it is garbage or numerical data interpreted as text).
When I select them, some of them show "Generic HID keyboard", others "Unknown HID device", so maybe they should appear, but with a correct name, not with these strange characters.
Here there is a screenshot showing the bug on the left, and the hardware devices of windows on the right: http://
Changed in mixxx: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
milestone: | none → 2.0.0 |
Changed in mixxx: | |
status: | Confirmed → Won't Fix |
Log file reports things like this:
Debug [Controller]: Found 0xaf4678750 0xaf4678670 "r272" S/N 0xaf4678660 "Usage Page 65468 Usage 137"
Debug [Controller]: Found 0xaf4678820 0xaf4678710 "r272" S/N 0xaf4678800 "Usage Page 12 Usage 1"
This output comes from the file src/controllers /hid/hidenumera tor.cpp
qDebug() << "Found" >manufacturer_ string >product_ string "r%1"). arg(cur_ dev->release_ number) >serial_ number >interface_ number == -1 ? QString("Usage Page %1 Usage %2").arg(
QString: :number( cur_dev- >usage_ page),
QString: :number( cur_dev- >usage) ) :
QString( "Interface %1").arg( cur_dev- >interface_ number) );
<< cur_dev-
<< cur_dev-
<< QString(
<< "S/N" << cur_dev-
<< (cur_dev-
manufacturer, product and serial number are not being printed because they are wchar_t* , and probably require using a QString, or formatting like the release_number.
Then, on src/controllers /hid/hidcontrol ler.cpp there is this, that obtains the texts into a QString
hid_serial = safeDecodeWideS tring(deviceInf o.serial_ number, 512); manufacturer = safeDecodeWideS tring(deviceInf o.manufacturer_ string, 512); tring(deviceInf o.product_ string, 512);
hid_
hid_product = safeDecodeWideS
The method safeDecodeWideS tring is this:
QString safeDecodeWideS tring(const wchar_t* pStr, size_t max_length) { :fromUtf16( (const ushort *)pStr, (int)max_length); :fromUcs4( (uint *)pStr, (int)max_length); :fromWCharArray (pStr, (int)max_length);
#ifdef __WINDOWS__
// We cannot use Qts wchar_t functions, since the may work or not
// depending on the '/Zc:wchar_t-' build flag in the Qt configs
if (sizeof(wchar_t) == sizeof(QChar)) {
return QString:
} else {
return QString:
}
#else
return QString:
#endif
}
I wonder if the workaround for Windows is really working or not, and I don't have a way to know due to the log file not printing the text.
(I am not able to compile Mixxx on Windows right now. No QT4 installer)