Jays2Kings / DS4Windows

Like those other ds4tools, but sexier
3k stars 1.45k forks source link

Feature request: Audio through DS4 headphone jack #17

Open H3mul opened 9 years ago

H3mul commented 9 years ago

Please considering working in this direction at some point, if it is at all possible. Would be incredibly useful, especially over Bluetooth.

PTF-PeterFlynn commented 9 years ago

Seconded. This would be an excellent feature.

DerekTurtleRoe commented 9 years ago

I hate to tell you, but I'm not sure it's possible since the DS4 audio is handled by the PS4 mostly (from what reverse-engineered data we have found so far). Either that, or it is handled through Bluetooth, and that would be very difficult since Bluetooth sucks for bandwidth.

It would be kind of silly too, since all computers have a 3.5mm headphone jack on them. Even if you wanted to use the controller from far away, there are wireless headsets too.

I don't know, I'd have to do more research and capture more packets from the DS4...

H3mul commented 9 years ago

Well, the PS4 clearly doesn't have bandwidth issues with using the DS4 bluetooth for both audio input/output streaming and controller events, according to user reviews (I dont own a PS4 myself).

As for reverse engineering, I found this: http://eleccelerator.com/wiki/index.php?title=DualShock_4 In the Bluetooth section, its mentioned that the controller advertises two devices, and uses one for audio. Hope this helps.

Jays2Kings commented 9 years ago

As vgturtle said, audio data is handled completely differently, and I don't have the tools to reverse engineer how it works. I can't say by myself that this feature will ever be added.

H3mul commented 9 years ago

Thanks for considering it anyway

DerekTurtleRoe commented 9 years ago

@hemu1 When I was talking about bandwidth, I was talking about the PC handling all of it, and that Windows Bluetooth stack doesn't really like that. The PS4 Bluetooth may be custom made, and be able to handle that while a PC might not.

Emulating two devices is tricky, especially with audio in the mix. You would have to dynamically analyze, convert, send, and receive audio data if it were to work just like the PS4.

With all that said, I have been looking at the controller dumps that people have made and I am currently trying to see if I can find out where audio is data is sent/kept/received/whatever.

This is all done in my free time though, which at this point in my life is very limited. But I am working on it.

buzzcut2k15 commented 9 years ago

+1

This feature would be awesome and add to those reasons for using a PS4 controller with a PC - and supporting software :)

I would certainly pay for this feature if it meant that I had one less wire to worry about..

Here's to hoping that this feature gains traction..

DerekTurtleRoe commented 9 years ago

I can't seem to access the audio at all through my PC, it seems like the PS4 OS and drivers probably handle all that work. The Bluetooth seems standard, but the audio doesn't show up at all. I have tried everything I can think of.

Does anybody have any Bluetooth sniffers or anything?

OscBacon commented 9 years ago

Hi vgturtle127, I know that Wireshark allows you to sniff many different Bluetooth profiles : https://www.wireshark.org/docs/dfref/#section_b I would really enjoy it if there was a way to use the speaker on the DS4 and the earphone jack. I don't know much about sniffing and what exactly would be needed to do this and help you, but if this could help further advance the development of these features and you are willing to; please tell us exactly what is needed.

DerekTurtleRoe commented 9 years ago

Wireshark allows you to sniff compatible wireless adapters. I would need to get a compatible device, something like this:

https://www.cacetech.com/products/catalog/product_info.php?products_id=69

I have controllers, so all I would need is a Bluetooth sniffer and some time and patience. I have confidence I could figure something out, or at least get some idea of what is happening. I could probably at least dump some stuff that would help people figure it out.

Some information has been gathered, but most of it was through USB or reverse-engineering, I believe.

http://eleccelerator.com/wiki/index.php?title=DualShock_4

Here is some good info, but nothing that helps us at the moment...

OscBacon commented 9 years ago

What about using a rooted android device instead? On Nov 12, 2015 04:20, "vgturtle127" notifications@github.com wrote:

Wireshark allows you to sniff compatible wireless adapters. I would need to get a compatible device, something like this:

https://www.cacetech.com/products/catalog/product_info.php?products_id=69

I have controllers, so all I would need is a Bluetooth sniffer and some time and patience. I have confidence I could figure something out, or at least get some idea of what is happening. I could probably at least dump some stuff that would help people figure it out.

Some information has been gathered, but most of it was through USB or reverse-engineering, I believe.

— Reply to this email directly or view it on GitHub https://github.com/Jays2Kings/DS4Windows/issues/17#issuecomment-155985312 .

DerekTurtleRoe commented 9 years ago

I'm not sure if that would work or not, but unfortunately I don't have an Android device to test. :disappointed:

kevinrodriguez-io commented 9 years ago

What's the thing with the android device? Why is it needed?

DerekTurtleRoe commented 9 years ago

It's not "needed". He was saying I could use an Android device as a Bluetooth sniffer.

Anoneom commented 9 years ago

I dont know if it's like that for everybody but i sometimes get the audiodevice listed as one that i would be able to connect to in my bluetooth settings on Win 10. I havent figured out when the device appears but i can try to reproduce it if someone thinks it would help. I have of course tried pairing with it without success.

DerekTurtleRoe commented 9 years ago

Can you upload a screenshot here? That seems interesting. I would also like to know what Bluetooth stack and chipset you are using.

Anoneom commented 9 years ago

I don't know exactly how i did it but I'm messing around with it trying to get it to happen again :P could you ELI5 how to best give you info on stack and stuff, cause I'm a noob :) I know for sure that the audio device was from the DS4 though because i live far from people and it appeared and disappeared when i turned on and off controller :)

DerekTurtleRoe commented 9 years ago

Well, what bluetooth adapter are you using? Are you using a USB dongle or built-in bluetooth?

jspinella commented 9 years ago

I think Anoneom is talking about this, I was able to see two devices when attempting to pair the Dualshock 4 (and yes, this second audio device only appeared when the DS4 was on):

capture capture2

Like Anoneom, I can't get it to pair. I'm on Windows 10 via Bootcamp on a 2015 15" MacBook Pro.

DerekTurtleRoe commented 9 years ago

Is RECAM4AZJX02485 the device that comes up?

I can't find any information on the MacBook Bluetooth chipset or anything. :disappointed:

If you could check the device manager and give me any information pertaining to the Bluetooth device that would be great.

jspinella commented 9 years ago

Yes, RECA is the device that pops up along with the PS4 controller ("Wireless Controller"). You're not able to see it on your setup? You may have to be on Windows 10, or maybe you need an adapter with Bluetooth 4.0+ (since it offers increased bandwidth that may be necessary for carrying audio AND controller AND light bar data)... In any event, this is with a Broadcom BCM943602CS (AC WiFi, Bluetooth 4.1).

https://wikidevi.com/wiki/Broadcom_BCM943602CS

capture3

Let me know if I can be of further help!

DerekTurtleRoe commented 9 years ago

I am on Windows 10, I just don't have any Bluetooth adapters or anything. I always use USB when I use my PS4 controller. :smile:

Thanks for the information!

We definitely need Bluetooth 4.0, since that is what the PS4 has. The PS4 may use WiFi Direct or something for the light bar and audio data, or some proprietary equivalent. I kind of hope not since that would be much harder to sniff, but if I know Sony that spend a lot of time on security for stuff that doesn't really need it. :smiley:

Now if we could only connect or sniff the traffic that was passed along by the PS4. I really need to get a Bluetooth sniffer, I am getting more interested since it appears we may be able to connect to it from within Windows...

jspinella commented 9 years ago

I doubt the Dualshock 4 uses WiFi, I think it only has a Bluetooth radio, though admittedly good teardown information IDing the ICs is lacking on the Internet, but this might be useful:

http://mygaming.co.za/news/wp-content/uploads/2013/11/DualShock-4-PCB-bottom.png

The audio codec is on the controller's PCB, so audio processing is done on the controller, NOT on the PS4. This is good news (if you didn't have this information already).

A Bluetooth 4.0 USB adapter can be had for ~$15, and the BlueFruit Bluetooth 4.0 sniffer runs about $30, though Wireshark may work with one of those $15 adapters... You probably know more about that than I do. Anyway, is it a question of money? I'm a little surprised you don't have Bluetooth on your computer!

DerekTurtleRoe commented 9 years ago

@jamesspinella Good find about the audio IC! I had no idea based on previous tear downs!

I knew it didn't have WiFi, I just didn't know if it had some weird proprietary wireless communications stuff going on, this seems increasingly likely.

I could get a low cost adapter and try it, and then I would also have the benefit of having Bluetooth on my PC. However, that Bluetooth sniffer is for Bluetooth LE, not regular Bluetooth devices. :disappointed:

Wireshark actually works on most devices, at least as far as I have tested. However, I can never install WinPCap, so I can never run Wireshark. I have been meaning to go report the bug...

It is only sort of a question of money, I was recently laid off and don't have any spending money. Bluetooth adapters aren't expensive, but if I do get one, I want one that supports as many versions of Bluetooth as I can. I'm OK with paying if it means I get quality.

I understand your surprise, I figured most motherboards would have support by now. Mine was a budget board, and so was my wireless adapter. So no Bluetooth for me! :stuck_out_tongue_closed_eyes:

jspinella commented 8 years ago

I have a spare Bluetooth USB adapter, but it's Bluetooth 2.1, so I doubt that would work for you... But is there anything else I can do to help with this effort? (FYI I don't actually have a PS4 anymore)

DerekTurtleRoe commented 8 years ago

I will probably get this:

http://www.amazon.com/Plugable-Bluetooth-Adapter-Raspberry-Compatible/dp/B009ZIILLI/ref=sr_1_8?ie=UTF8&qid=1448850789&sr=8-8&keywords=bluetooth+usb+adapter

Either that, or something from Adafruit.

Who makes the spare adapter you have?

jspinella commented 8 years ago

Ah, that sounds like a solid choice. I have a Targus dongle (http://targus.com/us/usb-bluetooth-adapter), but again, it's Bluetooth 2.1 (+EDR!).

DerekTurtleRoe commented 8 years ago

@jamesspinella Actually, I may pick that one up too, since I don't know if I can do EDR on a Bluetooth 4.0 adapter.

jspinella commented 8 years ago

EDR just means enhanced data rate, it allowed for faster link speeds versus 2.0, and so technically is "included" in any Bluetooth 3.0 and 4.0 device. Kind of like MIMO, only some Wireless "G" devices have it, but anything N and newer has it.

DerekTurtleRoe commented 8 years ago

@jamesspinella Oh, OK. Good to know. Thanks, James! Bluetooth isn't my favorite thing in the world, if you couldn't tell. :smile:

jspinella commented 8 years ago

Is there anything I can do to help you out with this effort? I noticed that on my Alienware Alpha, which uses an Intel 3160 Bluetooth 4.0 card, on initial pairing, I see "Wireless Controller" and "Audio Device" as opposed to RECA.... I wasn't able to pair with it, either. This is also on Windows 10.

DerekTurtleRoe commented 8 years ago

Uh, maybe dump the info for that chipset too?

Is there anyway to dump any data from the "Audio device"? Does anything appear in control panel, etc.?

kq01526 commented 8 years ago

@vgturtle127 :

Any update on this one? Did you get yourself a Bluetooth adapter now?

kq01526 commented 8 years ago

Maybe some more people should ask for it on Twitter:

https://twitter.com/GI_FTW/status/686148538959532032

:wink:

DerekTurtleRoe commented 8 years ago

@kq01526 No, I still don't have the funds necessary.

The second I do I will start doing research, though.

I know Sony won't do anything official on PC, that would be very uncharacteristic of them. Microsoft has a history with the PC, so that makes sense.

If somebody were to give me a Bluetooth adapter for a late Christmas present, it would probably be this one: :smile:

http://www.amazon.com/Plugable-Bluetooth-Adapter-Raspberry-Compatible/dp/B009ZIILLI/ref=sr_1_8?ie=UTF8&qid=1448850789&sr=8-8&keywords=bluetooth+usb+adapter

Plugable says it will work with pretty much any Bluetooth device, and it supports all the weird technical specifications. It also works on Linux and Raspberry Pi, which is a bonus for me! :wink:

I am not expecting anybody to do this, but I am posting it here just FYI.

kevinrodriguez-io commented 8 years ago

Where are you from? Im planning to buy some stuff on Amazon on next week, i might buy one of those bluetooth devices for you to continue this feature development.

And which kind of funding do you need for this to happen?

BTW, i know this is off topic but i bought the Bluetooth recommended on the mainpage http://www.amazon.com/gp/product/B004LNXO28/ref=oh_aui_search_detailpage?ie=UTF8&psc=1

And sometimes the Delay is > 52MS and the controller light turns red and then suddenly it becomes disconnected.

michlord commented 8 years ago

@darkndream Regarding the delay. I had the same problem with a similar adapter: http://www.amazon.com/Kinivo-Btd-400-Bluetooth-4-0-USB/dp/B007Q45EF4

So, the trick was to not connect it directly to my usb port but plug it to a USB extender cable (like this: https://en.wikipedia.org/wiki/Extension_cord#/media/File:USB_extender_cable.jpg). It seems that there was some sort of interference with my computer case or maybe the usb 3.0 controller. Now I can use the gamepad from the other side of the room which was not possible before and it is not because the adapter is placed more conveniently or anything like that. Overall everything works perfectly and reliably now.

DerekTurtleRoe commented 8 years ago

@darkndream I'm from the US (you can check my GitHub page), and any kind of "funding" would be good, really. :laughing:

I would only need the amount for the dongle, so even if you wanted to buy a gift card and email me the code or something that would work (for maintaining your privacy and what not).

I would of course give you credit in any commits or anything I create using this adapter. :smile:

Thanks for even considering it, by the way. :smiley:

@michlord I would have thought having an extension would have been the cause of it not working. That or interference with nearby WiFi devices or other Bluetooth devices.

One benefit to having a Bluetooth dongle is I could also reverse-engineer the PS3 controller. :smile:

cooperate commented 8 years ago

Hey if you need a few dollars for support i'd pitch in. I'd like to see this feature!

DerekTurtleRoe commented 8 years ago

@cooperate Sure, I'd take the help. If you want, you can email me and we can work something out. Just make sure to tell me who you are in the email, and make the subject easy to understand.

I'm currently trying to get some money together to upgrade my computer and fix some of my stuff that is broken, but I do want to get this adapter bought so I can not only debug this issue but all the other issues people are having (with Bluetooth-related devices and connecting them easily).

Stardidi commented 8 years ago

I just had something very interesting happen. After some strange bug, my controller became unresponsive, so I reset it by quickly tapping the reset button on the bottom. When trying to reconnect, a wireless headset showed up in my list of bluetooth devices. Connecting with this headset is not possible.

When I started my controller again, I was shown with a Nokia CK-7W in my list of bluetooth devices. This persisted long enough for me to connect (using 0000 as the code) and it even showed up in my list of audio devices.

Unfortunately, it was disabled and the connection seemed to get lost soon afterwards.

It also seems possible to have it connect in a different mode, by connecting the DS4 to the PC with bluetooth, then pressing the reset button and then just the round play button.

image

imge

jspinella commented 8 years ago

That's interesting, the Nokia CK-7W is a hands-free car kit product. Wouldn't surprise me if Sony and Nokia repurposed that same technology/chipset for the DualShock 4.

@vgturtle147, unfortunately I don't have access to a DualShock 4 for the time being, and haven't been able to provide that information you requested. Maybe @Stardidi can?

Laur3nt1u commented 8 years ago

For me in windows 8.1 the headset was showing most of the time but in windows 10 it doesn't show anymore I've tried connecting with it but it didn't work

Stardidi commented 8 years ago

After more experimenting, I've been unable to get the Nokia module to show up again. Something interesting to note though: The Nokia module reported a different Address from the 'Wireless Headset' This might just be packets being read differently, or something else interesting going on.

@jamesspinella @vgturtle127 What information are you talking about?

Btw, I'm running windows 10, with a Sitecom USB bluetooth dongle.

Laur3nt1u commented 8 years ago

BlueSoleil always shows the headset but without a name, it only shows the address

DerekTurtleRoe commented 8 years ago

@Stardidi Very interesting, I am looking at some datasheets and related materials for that Nokia device now to see if I can spot anything interesting.

@jamesspinella It's OK, I really appreciate you trying!

@Laur3nt1u Weird, that could be a change in the Bluetooth stack, driver-related, etc. Unsure, I'd have to know more about the device/OS/Bluetooth stack you are using to connect.

@Stardidi When you say address, do you mean the MAC address? Or do you mean the device ID and that kind of info? The information was what I posted here:

https://github.com/Jays2Kings/DS4Windows/issues/17#issuecomment-164039218

@Laur3nt1u "BlueSoleil"? What is the address you see?

Laur3nt1u commented 8 years ago

@vgturtle127 I have a laptop with intel wireless bluetooth 7260 v4+hs, windows 10 and bluesoleil 10.0.492.1 that I just downloaded to see if I could connect with the headset

the gamepad address: A4:15:66:72:13:37 the headset address: 00:3C:7F:F0:F0:0A

bluesoleil has this thing where you can change how bt devices see your bt (desktop, laptop, headset, printer) maybe audio works only if it detects a ps4

DerekTurtleRoe commented 8 years ago

@Laur3nt1u Thanks for the MAC addresses. Bluesoleil costs money, otherwise I would love to try it when I get my Bluetooth adapter.

There are only a few Bluetooth stacks that I know of:

  1. Broadcom
  2. Toshiba
  3. Microsoft

If anybody is using a different stack, please let me know. If you are using something that identifies as a different stack, keep in mind they can license out stacks or fork them if they are open-source, so it may just be one of the three I mentioned, but they modified it for their use.

Stardidi commented 8 years ago

@vgturtle127 I was talking about MAC addresses, which are visible in the screenshot I posted above.

Unfortunately, I'm unable to connect again, so the device doesn't show up anywhere.

DerekTurtleRoe commented 8 years ago

@Stardidi Oh, OK. Thanks, that will help when I test.

It's weird the device shows up and then disappears from everybody's computer...