detected HID devices shown in preference with random characters in Mixxx 1.12

Bug #1514335 reported by Chloé AVRILLON on 2015-11-09
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Critical
RJ Skerry-Ryan

Bug Description

this is true in WIndows (64bits) and Ubuntu (64bits),

It's very ugly !

This is a memory leak by the way, I think

Daniel Schürmann (daschuer) wrote :

Are all devices effected or only one?

Is the ugly name also part of the log file? If yes, please post the part.
If not a screenshot would be helpful.

Thank you.

Sébastien BLAISOT (sblaisot) wrote :

confirmed for me too, see screenshot

Changed in mixxx:
status: New → Confirmed
Sébastien BLAISOT (sblaisot) wrote :
Download full text (3.6 KiB)

logfile seems not affected at first, but please notice that the double quotes " are not closed, so this is maybe my text editor that strips the garbage at the end :

Debug [Controller]: ControllerManager: Setting up devices
Debug [Controller]: Scanning PortMIDI devices:
Debug [Controller]: Found output device # 0 Microsoft MIDI Mapper
Debug [Controller]: Found output device # 1 Microsoft GS Wavetable Synth
Debug [Controller]: Scanning HSS1394 devices:
Debug [Main]: Starting LibraryScanner thread.
Debug [Controller]: Nodes detected: 0
Debug [Main]: SoundManager::setupDevices()
Debug [Controller]: Scanning HID devices:
Debug [Main]: SoundDevicePortAudio::open() "7, Haut-parleurs (Conexant 20585 SmartAudio HD)"
Debug [Main]: framesPerBuffer: 1024
Debug [Main]: Requested sample rate: 44100 Hz, latency: 23.22 ms
Debug [Main]: Output channels: 2 | Input channels: 0
Debug [Main]: Opening stream with id 7
Debug [LibraryScanner 1]: LibraryHashDAO::initialize LibraryScanner(0xb960af6200, name = "LibraryScanner 1") "LIBRARY_SCANNER"
Debug [LibraryScanner 1]: CueDAO::initialize LibraryScanner(0xb960af6200, name = "LibraryScanner 1") "LIBRARY_SCANNER"
Debug [LibraryScanner 1]: TrackDAO::initialize LibraryScanner(0xb960af6200, name = "LibraryScanner 1") "LIBRARY_SCANNER"
Debug [LibraryScanner 1]: DirectoryDAO::initialize LibraryScanner(0xb960af6200, name = "LibraryScanner 1") "LIBRARY_SCANNER"
Debug [LibraryScanner 1]: LibraryScanner event loop starting.
Debug [LibraryScanner 1]: LibraryScanner::slotStartScan
Debug [Main]: Opened PortAudio stream successfully... starting
Debug [Controller]: Found 0xb960d1c530 0xb94d60ea20 "r304" S/N 0x0 "Interface 1"
Debug [Controller]: Found 0xb960d1d800 0xb94d60e8c0 "r304" S/N 0x0 "Interface 1"
Debug [Controller]: Found 0xb94d60e960 0xb95b6d58c0 "r17152" S/N 0x0 "Usage Page 1 Usage 2"
Debug [Controller]: Found 0xb960d1d690 0xb94d60e880 "r304" S/N 0x0 "Interface 1"
Debug [Controller]: Found 0xb960d1d700 0xb95b6d5340 "r304" S/N 0x0 "Interface 0"
Debug [Controller]: ControllerManager::getControllerList
Debug [Controller]: Loading resources from "C:/Program Files/Mixxx/"
Debug [Controller]: Searching for controller preset "04192005
Debug [LibraryScanner 1]: upgrade filename is "C:/Users/sblaisot/Local Settings/Application Data/Mixxx/DBUPGRADED"
Debug [Controller]: Loading controller preset from "C:/Users/sblaisot/AppData/Local/Mixxx/controllers/04192005
Debug [LibraryScanner 1]: Committing transaction on "LIBRARY_SCANNER" result: true
Debug [LibraryScanner 1]: Legacy importer took 0 ms
Debug [Controller]: Loading resources from "C:/Program Files/Mixxx/"
Debug [Controller]: Searching for controller preset "04192005
Debug [Controller]: Loading controller preset from "C:/Users/sblaisot/AppData/Local/Mixxx/controllers/04192005
Debug [Controller]: Loading resources from "C:/Program Files/Mixxx/"
Debug [Controller]: Searching for controller preset "Logitech_USB_Optical_Mouse
Debug [Controller]: Loading controller preset from "C:/Users/sblaisot/AppData/Local/Mixxx/controllers/Logitech_USB_Optical_Mouse
Debug [Controller]: Loading resources from "C:/Program Files/Mixxx/"
Debug [Controller...

Read more...

I have the same behaviour in my log files :

Debug [Controller]: Searching for controller preset "USB_Optical_Mouse
Debug [Controller]: Could not find "USB_Optical_Mouse

no double quote at the end

All HI devices are affected (it's ok for the Midi controller)

Sébastien BLAISOT (sblaisot) wrote :

something strange also and maybe related:

- on my laptop under win10 64bits (but it was the same when it was under win7 64bits), all USB HID devices show up in the controller tree (mouse, keyboard, and so on)
- on my desktop PC under win7 64bits, I have no devices shown under controller except my MIDI controller. No HID (mouse, keyboard) and no bulk. My controller is even not shown as bulk despite it's also bulk compatible

Sébastien BLAISOT (sblaisot) wrote :

maybe related to my last comment: https://github.com/signal11/hidapi/issues/221

Daniel Schürmann (daschuer) wrote :

It looks like the string lenght / termainator issue was fixed here:
https://github.com/signal11/hidapi/commit/b20777fc0c6552bec63ce4197410a55ea563c4ee

IMHO we should update to "hidapi-0.8.0-rc1" which includes the patch
Any objections?

RJ / Owen?

Changed in mixxx:
milestone: none → 1.12.0
importance: Undecided → Critical
assignee: nobody → Daniel Schürmann (daschuer)
Daniel Schürmann (daschuer) wrote :

A similar issue was reported here: Bug #1502448

Daniel Schürmann (daschuer) wrote :

Bug #1500659 is an other string reason for an update

Daniel Schürmann (daschuer) wrote :

Since hidapi-0.8.0-rc1 is part of Ubuntu from Trusty, we should remove it from the repo Mixxx.
For precise, we should provide it from our ppa.

Mac OS: it is available at Homebrew

Windows: as usual.

Sébastien BLAISOT (sblaisot) wrote :

I'll try to compile 1.12 against hidapi-0.8.0-rc1 tonight and let you know if it's better.

(I'm a bit concerned that hidapi has not had a release since that RC1 in October two years ago.)

Sébastien BLAISOT (sblaisot) wrote :

This bug maybe can also explain some crashes I had at startup with no significant/relevant lines in the log (I had no possibility to reproduce it 100% and to catch it via gdb)

Sébastien BLAISOT (sblaisot) wrote :

So, I compiled a new version against latest master of hidapi, But I can not test tonight because this bug is really really strange.

On my desktop PC, I don't have anything in "controller" preferences except my MIDI controller if plugged in.
On my laptop as a standalone computer, I don't see any controller either (except my MIDI controller if plugged)
On my laptop plugged in to the dock, I see all USB devices conected to the dock (mouse, keyboard, etc...). maybe only HID ones, I don't know.

When I have an external mouse plugged in on my computer outside of the dock, It's not seen in the "controller" preferences window.

So, I will be able to try my build tomorrow at work, when my laptop will be plugged on the dock.

Sébastien BLAISOT (sblaisot) wrote :

@Chloé, can you test this release, please ?
https://owncloud.blaisot.org/index.php/s/ADmPNxpxBtCBzv3

It's build against latest master of hidapi.
Is it better for you ?

Daniel Schürmann (daschuer) wrote :

@Sébastien: Sorry, Your build does not change anything.

Sébastien BLAISOT (sblaisot) wrote :

@daniel: thanks for testing this. So upgrading hidapi to latest source doesn't correct the problem :(

RJ Skerry-Ryan (rryan) wrote :

Could folks try reverting this commit:
https://github.com/mixxxdj/mixxx/commit/344ae07a8ab8ed2058de6bb9be910286212f2170

I don't think we should remove /Zc:wchar_t-. Qt is built with /Zc:wchar_t- on Windows and we want to build Mixxx with the same options that Qt uses. Daniel, could you explain why this was needed?

On mobile, but I'm pretty sure fromUcs4/fromUtf16 don't do null checks if
you provide a length. (Ie they decode exactly that many wide or single
width characters -- even if they are garbage memory.

wcsncpy has different semantics -- copy up to the null but no more than the
safety length then we insert a null at the end in case of faulty devices
that didn't null terminate their strings.

On Tue, Nov 17, 2015, 6:15 PM RJ Ryan <email address hidden> wrote:

> Could folks try reverting this commit:
>
> https://github.com/mixxxdj/mixxx/commit/344ae07a8ab8ed2058de6bb9be910286212f2170
>
> I don't think we should remove /Zc:wchar_t-. Qt is built with
> /Zc:wchar_t- on Windows and we want to build Mixxx with the same options
> that Qt uses. Daniel, could you explain why this was needed?
>
> --
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
> https://bugs.launchpad.net/bugs/1514335
>
> Title:
> detected HID devices shown in preference with random characters in
> Mixxx 1.12
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/1514335/+subscriptions
>

RJ Skerry-Ryan (rryan) wrote :
Changed in mixxx:
assignee: Daniel Schürmann (daschuer) → RJ Ryan (rryan)
status: Confirmed → Fix Committed

I'll test it today
Le 17 nov. 2015 23:25, "Sébastien BLAISOT" <email address hidden> a écrit :

> @Chloé, can you test this release, please ?
> https://owncloud.blaisot.org/index.php/s/ADmPNxpxBtCBzv3
>
> It's build against latest master of hidapi.
> Is it better for you ?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1514335
>
> Title:
> detected HID devices shown in preference with random characters in
> Mixxx 1.12
>
> Status in Mixxx:
> Confirmed
>
> Bug description:
> this is true in WIndows (64bits) and Ubuntu (64bits),
>
> It's very ugly !
>
> This is a memory leak by the way, I think
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/1514335/+subscriptions
>

Unwanted characters ?
There are few things to think about like :
- ASCII vs Unicode (caractères are doubled and the zéro terminal too)
Le 18 nov. 2015 03:55, "RJ Ryan" <email address hidden> a écrit :

> On mobile, but I'm pretty sure fromUcs4/fromUtf16 don't do null checks if
> you provide a length. (Ie they decode exactly that many wide or single
> width characters -- even if they are garbage memory.
>
> wcsncpy has different semantics -- copy up to the null but no more than the
> safety length then we insert a null at the end in case of faulty devices
> that didn't null terminate their strings.
>
> On Tue, Nov 17, 2015, 6:15 PM RJ Ryan <email address hidden>
> wrote:
>
> > Could folks try reverting this commit:
> >
> >
> https://github.com/mixxxdj/mixxx/commit/344ae07a8ab8ed2058de6bb9be910286212f2170
> >
> > I don't think we should remove /Zc:wchar_t-. Qt is built with
> > /Zc:wchar_t- on Windows and we want to build Mixxx with the same options
> > that Qt uses. Daniel, could you explain why this was needed?
> >
> > --
> > You received this bug notification because you are a member of Mixxx
> > Development Team, which is subscribed to Mixxx.
> > https://bugs.launchpad.net/bugs/1514335
> >
> > Title:
> > detected HID devices shown in preference with random characters in
> > Mixxx 1.12
> >
> > To manage notifications about this bug go to:
> > https://bugs.launchpad.net/mixxx/+bug/1514335/+subscriptions
> >
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1514335
>
> Title:
> detected HID devices shown in preference with random characters in
> Mixxx 1.12
>
> Status in Mixxx:
> Confirmed
>
> Bug description:
> this is true in WIndows (64bits) and Ubuntu (64bits),
>
> It's very ugly !
>
> This is a memory leak by the way, I think
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/1514335/+subscriptions
>

Sébastien BLAISOT (sblaisot) wrote :

I can confirm that r5623 corrects the problem.

Thank you.

JosepMa (josepma) wrote :

Installed r5623 (x64) and doesn't seem to be fully fixed.

The log still reports the address instead of the text (this is probably a different problem, but worth fixing it too):

Debug [Controller]: Found 0x1fe2df2d340 0x1fe2df2d670 "r272" S/N 0x1fe2df2d330 "Usage Page 65468 Usage 137"
Debug [Controller]: Found 0x1fe2df2d510 0x1fe2df2d5f0 "r272" S/N 0x1fe2df2d5e0 "Usage Page 12 Usage 1"
Debug [Controller]: Found 0x1fe2df2d860 0x1fe2df2d690 "r272" S/N 0x1fe2df2d800 "Usage Page 65468 Usage 136"
...

The names are now null terminated, so at least there isn't lots of garbage like before, but still doesn't seem to show the name:
(this can also be seen in the log):

Debug [Controller]: Could not find "??_??.hid.xml" in any preset path.
Debug [Controller]: Could not find "??_??--2.hid.xml" in any preset path.
...

Daniel Schürmann (daschuer) wrote :

This looks like desired:

Debug [Controller]: Found 0x1fe2df2d340 0x1fe2df2d670 "r272" S/N 0x1fe2df2d330 "Usage Page 65468 Usage 137"

see: https://github.com/mixxxdj/mixxx/blob/master/src/controllers/hid/hidenumerator.cpp#L91

This not:
Debug [Controller]: Could not find "??_??.hid.xml

On which OS are you?
Are you able to build Mixxx from source?

Daniel Schürmann (daschuer) wrote :

Ah sorry, infos are already at Bug #1502448, lets close this and continue there.

RJ Skerry-Ryan (rryan) on 2015-12-30
Changed in mixxx:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers