Fixing the PS3 Guitar Issue

lynx44lynx44 Opening Act
edited April 2010 in Rock Band
I'm posting in hopes of finding some other people that might want to help out with a solution in getting 3rd party guitars to work on Rock Band. Ever since we found that the patch would not be released I've been looking into other options. These are the only options I can think of at the moment:

1.) Create a custom hardware based solution, a dongle that sits between the guitar controller and the PS3.

Advantages:
-This solution could easily accomodate all different peripherals, so that they could even make guitars and other instruments interchangeable across platforms.

Disadvantages:
-It would have to be hardware based, so it costs money (both development and for the consumer).
-Its somewhat tricky to develop these things without some possibly expensive tools.

2.) Figure out if its possible to interface with the PS3 bluetooth interface as a guitar, then write an app for a PC to sit as the middle man between the guitar and the game, so that the button presses can be translated.

Advantages:
-Nearly free solution, as long as the consumer has a computer equipped with a bluetooth device, or they can buy a USB dongle for a small amount.

Disadvantages:
-This may or may not be possible, there is no known documentation on how or if this can be done.

3.) THIS WON'T WORK: But I'm going to throw it out there because people are going to suggest it. Use a PC as a translator using USB, rather than the above bluetooth example. Unfortunately this can't work because USB is host based. All PC's come with USB host ports standard, but never with client ports. In order for this to work, you would need a computer with both a host and a client port, and pretty much nobody but maybe USB developers have that. However, if a cheap parrallel/serial/pci usb client adapter can be found, this could probably work.

4.) Rewire guitars so they work correctly. This may be possible, depending on how the guitar was designed. When sniffing the USB signals, it looks like the only obvious difference in the byte array is that one of the bytes reads 0x0f on the guitar hero guitar rather than 0x08 as the Rock Band guitar does, as if its emulating that a button or combination of buttons on the directional pad are being pressed (the directional pad/strummer change the value of this byte). However, its also possible that the RB guitar has some other method of detecting if its a compatible guitar or not (possibly by the USB device ID, but hopefully not since they claim the support an open standard, and I don't think this would be the right way to do that).

Advantages:
-Free/Cheap solution, possibly simple

Disadvantages:
-May not be possible
-People will probably need some slight modding skills
-Guitar would need a switch in order to play either RB or GH3 (but who thats played RB has even touched GH3).

5.) Hack the PS3 and write the patch ourselves

Advantages:
-Free software based solution

Disadvantages:
-Isn't going to happen, at least not in response to this project.

-----------------------------------------------------------------------------------------

Of course, this project would be a lot simpler if we could see the specifications to what makes a guitar compatible. Unfortunately, I have asked for this information and have been denied because it may hurt the likelyhood of the patch being released, which is understandable. I however would ask Harmonix to stop calling it an "Open Standard" because it is not:

http://en.wikipedia.org/wiki/Open_standard

I understand the decision however, and I still think that their decision to allow their guitars and other guitars to be compatible between games is much better than other companies.

So back to the point of the post, any other ideas or input?

-Matt

Comments

  • shayboshaybo Road Warrior
    edited February 2008
    Godspeed, gentlemen. I'm sure lots of us would buy a solution.
  • phopelyphopely Unsigned
    edited February 2008
    For what its worth, here's a low-level usb port snoop utility:

    http://usbsnoop.sourceforge.net

    & more strategies:

    http://www.linuxjournal.com/article/7353

    More on sunday, I'm busy tomorrow.
  • WoodiusWoodius Unsigned
    edited February 2008
    So Sony won't post the patch until Activision and Harmonix strike a deal (i.e., Harmonix pays blood money Activision). I'm no computer genius, but is there a way to put the patch on the Internet and then load it onto the PS3 using a memory card? I know you can load the system updates that way; why not a patch?
  • TenshiTenshi Opening Act
    edited February 2008
    I'm glad that someone tries to deal with this problem, good luck gentlemen!
  • lynx44lynx44 Opening Act
    edited February 2008
    Woodius;310212 said:
    So Sony won't post the patch until Activision and Harmonix strike a deal (i.e., Harmonix pays blood money Activision). I'm no computer genius, but is there a way to put the patch on the Internet and then load it onto the PS3 using a memory card? I know you can load the system updates that way; why not a patch?
    The problem is that, while I don't know for sure, the patches are encrypted, similar to the way the game discs are. Also, theres no free SDK (software development kit) available for the PS3 because it hasn't been hacked yet. If it was hacked, this would probably be a possibility. Otherwise, I'm pretty much sure that this cannot be done. Maybe with an official Sony dev kit (which is expensive) it could be done, but then there would be legality problems.

    If someone leaked the official patch from Harmonix, then I would guess it would probably be possible to find a way to install it, probably just by copying it from a USB stick or something.

    -Matt
  • phopelyphopely Unsigned
    edited February 2008
    Got derailed for a bit, but back for now.

    That usbsnoop software works for winxp. It looks like it hooks in @ 'driver level', kind of like 'iptables' hooks in linux kernel, if you're familiar w/ that model. Though its old, it is open-source so I think it might be of greater use too (particularly the usb driver-level stuff).

    After you get usbsnoop set up (rtfm), just plug in a dongle & it will start logging.


    For the rock band fender guitar, after 'initialization', there is a constant stream of data sent, didn't pay attention to the time but maybe ~100 BULK_OR_INTERRUPT transfers from the dongle per second.

    The 'payload' is 27 bytes in length. The 0th byte of this is a bit vector corresponding to the guitar's button-press state (active high):

    (all low)
    02=green
    04=red
    08=yellow
    01=blue
    10=orange

    Bytes offset + 2 to the +26 seem fixed as
    08 80 80 7f 7f 00 00 00 ... 02 00 02 00 02 00 02

    If somebody wants to map out the bits, that'd be cool - I'll do it eventually.


    Guitar hero similarly returns ~100 similar packages per second.

    But, it appears to require some kind of handshake w/ the guitar?

    After pressing the the gibson's ps button, the 4 leds on that guitar start flashing quickly- but it eventually times out, the dongle never gets a solid light. I guess I should probably boot guitar hero & watch normal behaviour...

    Perhaps this is for some kind of multi-guitar 'dhcp'-esque negotiation?

    Payload looks like this:
    0000: 00 00 0f 80 80 80 80 00 00 00 00 00 00 00 00 00
    0010: 00 00 00 f7 01 00 02 cb 01 00 02

    Looking into the linux gh drivers might be of use here?.. Hmmmm.
  • phopelyphopely Unsigned
    edited February 2008
    Hey matt - think I get your point - wrapping my head around usb lately- usb ports aren't your uncle's serial ports.


    Maybe old (i.e.: there's better out now?), but if I understand it, something like this might be useful? Looks like you 'talk/program' to it (pd11) via lpt:, it(pd11) talks to the 'host' via usb like a normal device:

    http://www.devasys.com/pd11.htm

    Not sure its fast enough - "Limitations" section mentioned 'bulk' tx rate of this is 2kbytes/sec.

    I measured ~100 27-byte packages/sec=~2700 bytes per second of 'variable data'. Qs to consider are: How much of the packet header is 'unfixed' overhead? How many of those 27 bytes are 'real data' (much looked static, but I didn't study deeply yet).


    In the pd11 design, replace the 'i2c parallel port interface' w/ a second (but different) 'real usb' interface, could get good speed? Reads like they used the lpt ports as a small 'latch' (I recall I hooked an atari 810 disc drive up via lpt in the past to pc) that can be twiddled for i2c - I'm sure in part why this board is slow.

    I'll keep digging, could be that I'm looking @ the stone-age?
  • kaiserkrebkaiserkreb Rising Star
    edited February 2008
    sixaxis control does something unexpected to me- you can get analog readings of the binary buttons (reports 28 axis)--
    Correct me if I'm wrong but isn't that because since dualshock 2 every button on the controller, save for start and select, was made to be analog?
  • Phane7Phane7 Road Warrior
    edited February 2008
    kaiserkreb;322615 said:
    Correct me if I'm wrong but isn't that because since dualshock 2 every button on the controller, save for start and select, was made to be analog?
    Yeah, the X, O, Square and Triangle buttons are analog. Most notably used in the Gran Tourismo games on the PS2 where you can use the X button like a gas pedal. You can go full throttle or only accelerate a little bit depending on how hard you push it.
  • lynx44lynx44 Opening Act
    edited February 2008
    Hmm, I didn't have any problems connecting the Les Paul to my computer and getting a connection. I'm pretty sure thats all done in the firmware of the guitar and the dongle. The four lights flash, but then connect almost immediately for me, just like when its plugged into the PS3. From what I sniffed, I didn't see any sort of handshaking, although I thought that I would.

    One more possibility is that there isn't any handshaking required, but that when plugged into the PS3, it queries the guitar to confirm whether its a guitar or controller. So when plugged into the PC it still works, but the software (Rock Band or GH3) itself can still discriminate and decide whether its a compatible controller or not.

    I saw that exact USB development device, and it would be perfect to start out with, but unfortunately they don't manufacture it anymore. The only (relatively) cheap devices I can fine require you to load some firmware on it, as if you are starting from scratch again. I want something just like that, that I can use so that the PC can do all the translation in the middle. Most development devices are made so that you can make your own USB client device, for this project we need something with a host end and a client end. Although it just hit me that maybe it would be possible to use one of these and solder it into a GH3 guitar, connecting all the ports and making it essentially a Rock Band guitar. This is the cheapest thing I can find, and its apparently really good for beginners:

    http://greta.dhs.org/UBW/

    It has 8 input and 8 output ports. I wonder if something like that could be used, to be soldered into the GH3 guitar. Kind of messy, but if we could do it for cheap it might be a good start.

    -Matt
  • oldteenoldteen Unsigned
    edited February 2008
    Hi,

    I have writed this post : http://www.rockband.com/forums/showthread.php?t=31258

    I don't know if someone has already try this possibility.
  • lynx44lynx44 Opening Act
    edited February 2008
    Unfortunately that won't work. The frontman for the PS2 was developed the same as the Guitar Hero guitars on the PS2, because all guitars are compatible. It's the same problem as why the GH guitars don't work on the PS3 with a USB adapter.

    As for an update, I've ordered a USB development device (called the Universal Bit Whacker). The good news is that its only $25, so if I can get it working it will be a cheap way for people to modify their Les Pauls. Also, it should be able to transform any guitar into a PS3 RB guitar, regardless of platform, you could even potentially create your own custom guitar. The bad news is that it will most likely take some hardware modification (soldering, etc) in order to get it to work (at least for the first phase of development, I'm still trying to think of more solutions).
  • lynx44lynx44 Opening Act
    edited March 2008
    Another update. I got the chip programmed, and it works, but only on the PS2 version for some reason. It doesn't seem to work on the PS3 version. I've made some changes that may fix it, but since my PS3 is (mostly) broken for the second time, I'm not able to get it to read the disc to verify if it works or not.

    Its a possibility that the PS3 queries the Guitar and waits for it to send back the correct signal in order to work. If thats the case, I'm not sure how much more I'll be able to do.

    The odd thing is that the guitar has 2 device descriptors. I'm not sure what for. Its possible that one descriptor is to have it recognized as a guitar and the other as a PS3 controller.

    If I can get it to show up, I plan on making 2 different firmwares for the chip. One will be a standalone (like a mod chip), which will be able to be used for a couple of purposes. You could solder it into an existing guitar or you could potentially even make your own guitar.

    The second firmware would interface with your PC's parallel port. Your PC would then act as the middle man and translate the button presses. As long as you have a PC around this would be the way to go, since it could even potentially be used to translate any instrument from 360->PS3, PS2->PS3, etc, without having to open up solder anything.

    -Matt
  • ByteArtsByteArts Opening Act
    edited March 2008
    FYI, I've been able to get a microcontroller with a USB port to act like a guitar on a PS3 (it involved a lot of reverse engineering). Basically, the guitar acts like an HID gamepad controller, but the Rock Band software also seems to look for some specific ID information from the guitar. So much for being an "open" standard. The PS3 will recognize any HID-compatible controller -- kudos to Sony for using an established standard. The Xbox360 seems is another story...

    As an HID controller, the guitar is polled by the host (the PS3) a regular intervals to get the button and axis status information -- button states are sent as a series of bits, each axis position is a byte. One thing I haven't figured out is what (if anything) the X and Y axes are used for.
  • kaiserkrebkaiserkreb Rising Star
    edited March 2008
    I'm sure it's an open standard but it probably has to query the guitar to determine if it's an actual strat for usage of the alternate frets and effects switch. Just a guess of course..
  • Phane7Phane7 Road Warrior
    edited March 2008
    If you could make a Les Paul mod chip, I'd buy it. My guitar is just collecting dust anyway, so I wouldn't mind if I fried it trying to solder a mod chip.
  • oohwhaoohwha Opening Act
    edited March 2008
    http://www.orang3.net/store/welcome/smartjoy.html

    How do these things get buttons on the keyboard and mouse to map to game pad buttons?

    Also, the GH3 guitar maps the 5 colored buttons to controller buttons and the up/down strum bar to up/down on the controller. I've never really thought about it much till right now... but why the HECK don't all these things work with each other?

    Why can't I play a game like Marvel Ultimate Alliance with the Les Paul or RB guitar? Granted I would be missing a few buttons but still...

    And so then, why isn't everything cross compatible?
  • DzhokharDzhokhar Road Warrior
    edited March 2008
    I've heard that the LP is detected by Rock Band as a regular controller (like a vocalist), and that it even works in that capacity. My suspicion would be that Rock Band simply reads the device descriptor on whatever controller you're using in order to determine what kind of instrument it is. Therefore, it seems you should be able to intercept any USB communications and change the device descriptor from "GH Les Paul" to "RB Strat" or whatever the actual signal equivalent is and solve the problem.

    The case where this would not work is if the LP and Strat have different button mappings as well, although that could easily be tested by using them to navigate the XMB.

    edit: By the way, somebody commented that the Strat has two device descriptors, I'd bet that they're either PS3 controller and Strat IDs or they correspond to the guitar and the wireless receiver separately, in either case I would expect you to only have to change one of them. You could probably figure out which just by hooking both the LP and Strat up to a PC and comparing the device descriptors.
  • lynx44lynx44 Opening Act
    edited March 2008
    ByteArts;371621 said:
    FYI, I've been able to get a microcontroller with a USB port to act like a guitar on a PS3 (it involved a lot of reverse engineering). Basically, the guitar acts like an HID gamepad controller, but the Rock Band software also seems to look for some specific ID information from the guitar. So much for being an "open" standard. The PS3 will recognize any HID-compatible controller -- kudos to Sony for using an established standard. The Xbox360 seems is another story...
    Wow, so how did you do it? I'm mimicking one of the descriptors exactly, as far as I can tell, but for whatever reason it isn't working. Are you saying it queries the guitar to ask it if it is a guitar, or that it simply reads part of the descriptor to determine whether its a guitar? Do you have any source code I could take a look at? What microcontroller were you using? Do you need to mimic both descriptors or just one? The one that I have implemented is the one that has VendorID=0x12BA DeviceID=0x0200.
    Dzhokhar;371718 said:
    My suspicion would be that Rock Band simply reads the device descriptor on whatever controller you're using in order to determine what kind of instrument it is.
    Thats what I figured, I thought it would just be in the descriptor, and it may still be. I've only implemented one of the descriptors - its next to identical to the actual Strat guitar (I'll double check and try to make it 100% exact tonight) . It still doesn't register correctly on the PS3, but it does on the PS2, leading me to believe that the information is stored in the descriptor I've implemented.
    Dzhokhar;371718 said:

    edit: By the way, somebody commented that the Strat has two device descriptors, I'd bet that they're either PS3 controller and Strat IDs or they correspond to the guitar and the wireless receiver separately, in either case I would expect you to only have to change one of them. You could probably figure out which just by hooking both the LP and Strat up to a PC and comparing the device descriptors.
    Good idea, I'll take a look at the differences between the two guitars tonight, if I get a chance to work on it.

    -Matt
  • ByteArtsByteArts Opening Act
    edited March 2008
    Here's the HID device descriptor structure that I'm using:

    /* Device Descriptor */
    rom USB_DEV_DSC device_dsc=
    {
    sizeof(USB_DEV_DSC), // Size of this descriptor in bytes
    DSC_DEV, // DEVICE descriptor type
    0x0200, // USB Spec Release Number in BCD format
    0x00, // Class Code
    0x00, // Subclass code
    0x00, // Protocol code
    EP0_BUFF_SIZE, // Max packet size for EP0, see usbcfg.h
    0x12BA, // Vendor ID (Harmonix)
    0x0200, // Product ID: (PS3 Guitar)
    0x0313, // Device release number in BCD format
    0x01, // Manufacturer string index
    0x02, // Product string index
    0x00, // Device serial number string index
    0x01 // Number of possible configurations
    };



    It doesn't seem to matter what the manufacturer string is, but I think the device descriptor has to say "guitar" in it (I'm not 100% sure of that yet).

    The wireless transceiver on the PS3 is "transparent" to the host and behaves like a passive cable and just passes communications from the host (PS3) to the device (guitar).
  • lynx44lynx44 Opening Act
    edited March 2008
    Thanks for the code. I got it working today, everything looks identical to the guitar. The problem I had was that I was identifying it as an HID mouse (I was using the microchip mouse demo as a start), so as soon as I changed it to an HID joystick it showed up. I'm going to try to get it to hit the "green" button every few seconds now. After that it should be pretty easy to map the pins to button presses.

    Do you know what the HID report should be defined as, so that it will look like the guitar? When I read in the bytes from the guitar, the first bit signals which color button was pressed, but when I try to emulate that it thinks I'm holding the up button. I've been trying to find some HID sniffers, but none of them seem to provide this information. This is what my report looks like right now:

    //"joystick", from intel hid tool
    rom struct{byte report[HID_RPT01_SIZE];}hid_rpt01={
    0x05, 0x01, // Usage Page (Generic Desktop)
    0x15, 0x00, // Logical Minimum (0)
    0x09, 0x04, // Usage (Joystick)
    0xA1, 0x01, // Collection (Application)
    0x05, 0x02, // Usage Page (Simulation Controls)
    0x09, 0xBB, // Usage (Throttle)
    0x15, 0x81, // Logical Minimum (-127)
    0x25, 0x7F, // Logical Maximum (127)
    0x75, 0x08, // Report Size (8)
    0x95, 0x01, // Report Count (3)
    0x81, 0x02, // Input (Data, Variable, Absolute)
    0x05, 0x01, // Usage Page (Generic Desktop)
    0x09, 0x01, // Usage (Pointer)
    0xA1, 0x00, // Collection (Physical)
    0x09, 0x30, // Usage (x)
    0x09, 0x31, // Usage (y)
    0x95, 0x02, // Report Count (2)
    0x81, 0x02, // Input (data,var,abs)
    0xC0, // End Collection
    0x09, 0x39, // Usage (Hat switch)
    0x15, 0x00, // Logical Minimum (0)
    0x25, 0x03, // Logical Maximum (3)
    0x35, 0x00, // Physical Minimum (0)
    0x46, 0x0E, 0x01, //Physical Maximum (270)
    0x65, 0x14, // Unit (eng rot:angular pos)
    0x75, 0x04, // Report Size (4)
    0x95, 0x01, // Report Count (1)
    0x81, 0x02, // Input (data,var,abs)
    0x05, 0x09, // Usage Page (button)
    0x19, 0x01, // Usage Minimum (button 1)
    0x29, 0x04, // Usage Maximum (button 4)
    0x15, 0x00, // Logical Minimum (0)
    0x25, 0x01, // Logical Maximum (1)
    0x75, 0x01, // Report Size (1)
    0x95, 0x04, // Report Count (4)
    0x55, 0x00, // Unit Exponent (0)
    0x65, 0x00, // Unit (none)
    0x81, 0x02, // Input (Data, Variable, Abs)
    0xC0};// End Collection,End Collection

    As you can see, I simply got it from the intel HID tool. Otherwise, do you know how to interpret it? I get that the second byte is the size, but I'm not sure what the first byte represents or what the terminology really means.

    -Matt
  • ByteArtsByteArts Opening Act
    edited March 2008
    Matt -

    I've left you a personal message regarding this.

    -Scott
  • lynx44lynx44 Opening Act
    edited March 2008
    For some reason I'm not able to access my private messages, it says "Your administrator has disabled private messaging." I don't know why that is...

    Anyway, I got it working, I used libhid to sniff out the HID report. However, for some reason when I used the full report, it didn't work so I weeded through part of it and got a seemingly working configuration. Now when I plug it in, it acts as if the "x"/green button was pressed. Of course this is right when my PS3 decided it didn't want to recognize games any more, so I'm currently unable to test whether it works with Rock Band still or if I got it to recognize all the different buttons.

    If you want, I can give you my email address through PM (if yours works) or in some other way.

    -Matt
  • ByteArtsByteArts Opening Act
    edited March 2008
    Matt -

    You can send me a message by going to my profile at http://www.rockband.com/rockers/ByteArts
    -- there's a "Send a Message" link in the upper right.

    -Scott
  • MagnetMagnet Moderator
    edited March 2008
    Hey guys. I can see why you're veering off toward PMs/e-mails, but please don't forget to keep this topic updated too for the rest of us who are anxiously looking at the progress you're making. Nice work so far!
  • lynx44lynx44 Opening Act
    edited March 2008
    ByteArts;375102 said:
    Matt -

    You can send me a message by going to my profile at http://www.rockband.com/rockers/ByteArts
    -- there's a "Send a Message" link in the upper right.

    -Scott
    Ah, I see it now. I was checking my PMs on the forum, when I logged in again I saw the "other" inbox. I'll send you an email just for the sake of exchanging email addresses in case something happens to this thread.

    -Matt
  • lynx44lynx44 Opening Act
    edited March 2008
    One quick update before I finally go to bed. I think I have all the buttons working (at least the main ones). I made a small demo loop that hit all the "big" frets, then strummed up and down, then hit the start button. The strum wasn't working, but I made a code change and I believe it works. It now loops hitting the up and down button in the XMB, but again my PS3 decided to stop loading games so I'm unable to verify that it will strum in game, I'm pretty sure it will though. The PS3 will probably boot the game sometime tomorrow (usually it will boot after its been turned off for a while), so I'll test and report back then.

    I'll probably start working on the process of taking data in from the pins on the board and translating them to button presses tomorrow. That should be the final coding stage, and should be pretty easy to do since I've gotten everything else set up to do it (as far as I know). I still have to decide whether I'm going to make the firmware for the modchip style board or the one that will connect to the parallel port on the computer first.

    -Matt
  • lynx44lynx44 Opening Act
    edited March 2008
    I can't believe I ended up working on this thing all day again. Got the board soldered into the Les Paul. I updated the firmware to relay the button presses, but only 3 of them work so far: green, blue and orange. Yellow and red cause my test program to crash, I think its because there is a conflict in the firmware over that pin. Its the same pin that seems to be mapped to determining whether or not the chip is self powered and to detect the USB bus. I don't know why the strummer and all the other buttons don't work though. I think I have an idea of how to fix it. I'll have to look into that tomorrow though, I'm ridiculously tired because of the jump forward for DST (and staying up entirely too late last night).

    So yes, that means the first firmware will be the "mod chip" solder in kind. And yes, it should still allow you to use the guitar for GH3 or Rock Band. For Rock Band, the guitar will be wired though.

    -Matt
  • Psycho77Psycho77 Unsigned
    edited March 2008
    Following your progress with great interest ! Thanks for all the effort :)
  • greeblegreeble Unsigned
    edited March 2008
    Wow, you rock. I wish I was smart enough to contribute to this. (I was never a great programmer) I'm guessing Harmonix isn't truely open because they don't want it to be too easy to cheat at the game. (Only takes a few jerks to ruin the leaderboards)
Sign In or Register to comment.