Unoffical empeg BBS

Quick Links: Empeg FAQ | Software | RioCar.Org | Hijack | jEmplode | emphatic
Repairs: Repairs | Addons: Eutronix | Cases

Topic Options
#367442 - 26/08/2016 09:28 I made a Bluetooth interface.
FieroSTi
member

Registered: 07/05/2007
Posts: 104


Check it out here. Is this something people are interested in? Do people even use their empegs any more?

If I were so inclined, how would I go about writing to the screen every so often to display current track data? Maybe be able to intercept button presses and send rewind/skip commands to the bluetooth source? This would all take place in AUX mode, and with the sled serial connector.

On a somewhat related note; can anyone tell me more about the tuner serial port? I'd like to be able to control the empeg from there like a wired remote as I'm using the other for the Bluetooth interface. I feel like I remember getting a bunch of garbage from the tuner serial port when I was trying to connect to it one day, though. Is it RS232 or TTL? Basically, I'm trying to bypass the tuner so I can have a wired remote.

Top
#367450 - 26/08/2016 19:40 Re: I made a Bluetooth interface. [Re: FieroSTi]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 30639
Loc: Seattle, WA
Interested!

Right now I have a cheap third party A2DP interface plugged into the AUX port on my empeg. The idea is for when my girlfriend wants to play stuff from her phone in the car. It works, but it doesn't allow for the buttons on the face of the player to send play/pause/skip commands to the phone.

An integrated solution (with onscreen track data and rewind/skip controls on the player) would be amazing, if you can get that working. I would buy one if it worked. I'd be willing to help you test the software, though I can't help you write it.

Would there be a way so that your device could have an AUX passthrough, to mix the actual AUX plug audio with your bluetooth audio, so that I could have my free AUX jack back? The idea would be that you'd resistance-mix the two sources, i.e., it wouldn't matter whether audio is coming in from the passthrough aux jack or from the bluetooth interface, either one or both will play sound. (I like being able to have my AUX jack available for a portable CD player for those super-rare situations when I buy a CD and want to hear it right away before I rip it.)

Regarding how to get the programming done: You'd need to interface with the kernel somehow. If you were already planning on having a connection to the serial port, you could submit a change to the hijack kernel which outputted some "coded" information on the serial port when buttons on the face of the player were pressed. Then your interface could read the serial port. Commands could be like simple ASCII text output on the serial port:
#E2DP:AUXMODE_SELECTED
#E2DP:LEFTPRESS_DOWN
#E2DP:LEFTPRESS_UP
#E2DP:AUXMODE_DESELECTED
You'd also want to do the same thing for commands from the Rio remote control.

Unless... Does hijack already have a secret setting for outputting button press information on the serial console? If so then no hacking needed for that part, you'd just activate that feature.

The Hijack kernel could also be hacked to interpret incoming coded data from your interface, containing track information, and put that up on the screen. That *would* need to be a hijack hack. But I'll bet it's doable.

Oh by the way, did you like how I already suggested a name for your product in my message samples up there above? "E2DP"? Cute, huh?
_________________________
Tony Fabris

Top
#367453 - 26/08/2016 22:41 Re: I made a Bluetooth interface. [Re: FieroSTi]
FieroSTi
member

Registered: 07/05/2007
Posts: 104
I'm pretty sure I've read posts from Mark about the wonderful things Hijack can help me do with this little fellow, I'm just not exactly sure how to use them.

I don't really want to do anything complicated. I want to use the AUX-in for audio and the sled serial port for basic two way control. Only need skip/rewind and pause/play, really. The 8-pin Molex on this interface will receive a custom extension harness with the required RCA jacks, DB9 serial port and tuner connecter on the empeg end for power and tuner Rx/Tx. Current Track information is on the wish list and is fully possible. Just need to connect the dots. It's all done by sending ASCII commands to the RN52 to which it will respond with either a HEX value or an ASCII string, depending on what you asked of it. I would just need to write a little userland 'thingie' to parse that information and write it to the screen, hence the difficulty for me as a non-programmer. I'll be working on that this winter, I suspect. I ordered 6 of those boards to test with, but I have a feeling that I'll be revising it once or twice before I've got a 'final' product. For what it's worth, I had a working prototype on the breadboard. The RN52 is a pretty amazing little chip. It's $25, but it's pretty much fully self contained. All I added was an i2s DAC for better sound and a level shifter for comms.



I'm also working on a microcontroller as an ADC for the 'steering wheel control' buttons. It's supposed to emulate the controller used in the original tuner to add a steering wheel interface as well. That might be somewhat challenging. I'm working with an Arduino Nano as I'm somewhat familiar with the architecture. Anyway, the 4-pin Molex connecter carries 12V/GND and the tuner Rx/Tx wires for running to the remote panel. The remote panel is basically the empeg face without the screen. Basically, I want to mount an empeg face in my center console, but leave the screen on the dash. I have two sets of display extender boards, but I don't think they're applicable here.

Name's decent. Hah. I like it.

Top
#367454 - 26/08/2016 22:49 Re: I made a Bluetooth interface. [Re: FieroSTi]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 30639
Loc: Seattle, WA
Quote:
I would just need to write a little userland 'thingie' to parse that information and write it to the screen, hence the difficulty for me as a non-programmer.


I don't know if it'll be easier to write a userland program or to make changes to hijack. Certainly hijack already has a lot of the plumbing for what you need to do. Those who have written code in both areas would probably be able to answer that more definitively.
_________________________
Tony Fabris

Top
#367459 - 29/08/2016 01:57 Re: I made a Bluetooth interface. [Re: FieroSTi]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 1917
Loc: Brisbane, Australia
Unfortunately my empeg is not used in a car any more - this would have interested me back when I did.. This should work quite well. It shouldn't be too hard to get some button presses one way to it and track data from it on to the screen.

Have you tried it in a running car? Whilst experimenting with other interfaces I found they were a bit susceptible to ground loops etc and so alternator whine and other interference might be a problem.

Nice one.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#367460 - 29/08/2016 17:17 Re: I made a Bluetooth interface. [Re: Shonky]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 30639
Loc: Seattle, WA
Yeah that's a big deal. Takes a lot of work to get the whine out when you add stuff to Aux.

Hm. I wonder if you could make this "E2DP" unit an internal thing? Inline insert into the connector where the dock wires plug into the mainboard. Mount it in the slot where a second disk drive would go....
_________________________
Tony Fabris

Top
#367465 - 29/08/2016 19:12 Re: I made a Bluetooth interface. [Re: FieroSTi]
FieroSTi
member

Registered: 07/05/2007
Posts: 104
I'm not terrifically worried about ground loops as I'm using one of Stu's S/PDIF cards with digital coax running back through the car to my amps. Absolutely nothing I did when I installed the unit into this car would get rid of the terribly loud alternator whine that I had. Nothing. Except's the Eutronix card, that is. I suppose I could still induct noise on the analog AUX signal before going back to digital, but that's not likely to happen. Also, in this board I used a completely isolated i2s DAC chip [PCM5102A] external to the RN52 with it's own highly regulated 3v3 power supply, as I found that the internal audio processing is very poor and highly susceptible to noise, even from UART activity.

I absolutely could make this an internal thing, basically replacing the second hard drive. I suppose that I had never really considered that. The smaller analog/digital Molex connectors at the logic board for the docking connector are still available from Mouser/DigiKey, so I could fairly easily make this a plug and play sort of thing as all of the required connections are in those two harnesses.


Edited by FieroSTi (29/08/2016 19:16)

Top
#367466 - 29/08/2016 20:32 Re: I made a Bluetooth interface. [Re: FieroSTi]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 30639
Loc: Seattle, WA
I know that if it were an internal add-on to the Empeg, it'd end up installed quicker than if it were external. For me, it's easier to sit down at my desk and open up the player than it is to dig into the rat's nest in my car's dashboard.

Though that might not be the case for all folks.

I also like the idea that the module and a kernel upgrade would basically "make the player bluetooth capable" as if it were integrated. There's some awesomeness associated with that.
_________________________
Tony Fabris

Top
#367467 - 29/08/2016 23:13 Re: I made a Bluetooth interface. [Re: FieroSTi]
FieroSTi
member

Registered: 07/05/2007
Posts: 104
Tell you what. I've got a MendelMax 1.5 3D printer sitting on my desk that I've assembled, but not yet gotten working quite right. I could potentially make cases and boards for either application, should I sort that monster out. A board like I've already designed [or a future revision] with matching enclosure for external tuner-type connection and one for internal HDD tray mounting and direct Molex harness integration. Everything is fully open source and boards are/will be be available directly from OSHPark. All components are SMD save for the Molex connectors to save costs and shrink overall size. All is available from the usual suspects, i.e. Mouser, DigiKey, JameCo, etc. The discretes are all 0805 package, so; easily solderable. The RN52 and PCM5102A are a bit tighter pitch, but I managed to hand solder 5 of the latter for Raspberry Pi DACs back-to-back and didn't muck up a single pin. I have a Weller WESD51 iron with ETS 1/64" conical tips for the dirty work. They're wonderful for tight pitch soldering.

EDIT: I'm not sure if I mentioned this or not, but this RN52 piece is also capable of HFP and HSP profiles as well, so I could potentially add a microphone buffer into the next rev board to handle really bringing this little engineering miracle up to current standards.


Edited by FieroSTi (29/08/2016 23:18)

Top
#367468 - 29/08/2016 23:48 Re: I made a Bluetooth interface. [Re: FieroSTi]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 30639
Loc: Seattle, WA
Yeah, I'd totally buy that kit and source the components myself and do the soldering.

But the software would need to be mostly worked out (ie, to a testable/alpha point) before I went to all that trouble; I'd want to know I'd have something working on the other end of the journey. smile

I'm in the middle of a time-consuming project right now which I expect to take me until ~November 7th to finish, but after that I'll probably be dying for projects like this one to tinker with.
_________________________
Tony Fabris

Top
#367480 - 31/08/2016 09:38 Re: I made a Bluetooth interface. [Re: FieroSTi]
julf
veteran

Registered: 01/10/2001
Posts: 1290
Loc: Amsterdam, The Netherlands
I am interested, but also realize this project is overkill for my needs. Yes, being able to control an external device from the empeg, but most of all I just need audio pass-through/override to accommodate sat-nav audio interrupting music as needed.

Top
#367488 - 31/08/2016 18:30 Re: I made a Bluetooth interface. [Re: julf]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 30639
Loc: Seattle, WA
Originally Posted By: julf
I just need audio pass-through/override to accommodate sat-nav audio interrupting music as needed.


If it just resistance-mixed the existing Aux Input with the bluetooth Aux input, would that solve your needs?
_________________________
Tony Fabris

Top
#367492 - 01/09/2016 09:44 Re: I made a Bluetooth interface. [Re: tfabris]
julf
veteran

Registered: 01/10/2001
Posts: 1290
Loc: Amsterdam, The Netherlands
It would have to include the override functionality (muting/pausing the music when the satnav tries to speak).

Top
#369049 - 07/08/2017 00:12 Re: I made a Bluetooth interface. [Re: FieroSTi]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 30639
Loc: Seattle, WA
I came back to this thread now that I'm working on integrating the empeg into my new car that doesn't have an aux-in. When this thread was started it looked like something I'd totally want, but now, it looks like what I would really need is the opposite. smile

This project is, from what I can tell, about adding a bluetooth input to the empeg, but what I really need now, since my situation has changed, is a bluetooth output from the empeg to a factory car stereo, with controls integration.

I've already bought a bluetooth transmitter which seems like it will work for my needs: Empeg LR RCA output -> BT Transmitter -> Factory stereo. Took me three tries to find a model that would successfully pair with my stereo, but I have a working one now.

That's the audio part taken care of, but then it means that my steering wheel controls, which normally successfully change tracks on my phone when bluetooth-paired, wouldn't change tracks on the empeg. So now I itch for a way to do that via a direct interface module in the empeg. Of course at the moment I don't have the skill or time to do that. smile

Wishes are great aren't they? smile
_________________________
Tony Fabris

Top
#369053 - 07/08/2017 01:28 Re: I made a Bluetooth interface. [Re: FieroSTi]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 13528
Loc: Canada
So.. for integration with other in-car controls, the question is always.. what electrical/wireless interfaces does the car head unit support for such, and is there documentation for the protocols it expects? smile

EDIT:
In this case, there appears to be some kind of bluetooth thingie.. so I guess you're looking for a suitable transceiver for the empeg end, and then some kind of support for whatever protocol it uses. A problem with iFruit stuff, is that it does tend towards the non-standard/proprietary/highly-profitable side of things. wink


Edited by mlord (07/08/2017 01:31)

Top
#369054 - 07/08/2017 10:24 Re: I made a Bluetooth interface. [Re: FieroSTi]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 1917
Loc: Brisbane, Australia
I think you'll find it quite difficult to get your car to receive A2DP (audio) from one device but also be paired with another device so it can send AVRCP commands (play/pause/next etC).

Maybe try looking for a CAN BUS monitor that can pick up button presses. There's no USB host on the empeg though right (it's been so long)?

Either way is a long road I think you'll find.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#369060 - 07/08/2017 18:16 Re: I made a Bluetooth interface. [Re: FieroSTi]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 30639
Loc: Seattle, WA
Agreed, the type of thing that I'm describing would be really complex to make, and I don't see it happening any time soon unless I learn how to do it myself. smile

Though I want to clarify that I'm not talking about two different device pairings. I mean a single A2DP+AVRCP module added to the empeg. That doesn't make it an easy thing to create, but at least I'm not talking about pairing two different devices. smile
_________________________
Tony Fabris

Top
#369061 - 07/08/2017 19:14 Re: I made a Bluetooth interface. [Re: tfabris]
elperepat
enthusiast

Registered: 11/01/2002
Posts: 201
Loc: Qc, Canada
Being in the same boat, I took a look and found the BC127 module which might do both the A2DP and the AVRCP. This, coupled with a simple arduino translating the AVRCP commands to empeg commands for the serial port, we might be on to something.


I'll try to find some time soon to dig into the datasheet and the example programs.
_________________________
Patrick

Top
#369063 - 07/08/2017 19:46 Re: I made a Bluetooth interface. [Re: elperepat]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 30639
Loc: Seattle, WA
Wow, that looks like just the ticket. Connect that chip to an Arduino chip with an RS-232 output, and that might just work. Wow. All it would need is the software to send the serial commands to the empeg for next track (I think it's "n <cr>" for example), previous track, and play/pause (I forget which one is "p <cr>" and which one is something else).

You could either implement it internally to the empeg (soldering to the serial pins and to the aux output pins inside the player), or, if you could condense the whole thing to a single PCB that was small enough, make it a single flat module that plugs into the lower back portion of the player on the outside, connecting to the external serial port and aux plugs, tucking in just beneath the dock connector. If it were just the right size and shape, it could still fit even when docked. I think there's a pretty good amount of space in that area between the player and the dock.

Super interesting idea. This takes it from a realm of "this is out of my league" to "within my grasp if I only had the time". I've created Arduino interface circuits before, including all the PCB design and prototyping, and found the process fascinating and fun.
_________________________
Tony Fabris

Top
#369065 - 08/08/2017 01:49 Re: I made a Bluetooth interface. [Re: FieroSTi]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 1917
Loc: Brisbane, Australia
Why do you need an Arduino? Just connect module serial port to empeg serial port (need level shifter) and run code on empeg.

Admittedly Arduino would probably be easier programming wise to get going.

Be aware noise, ground loops etc might be an issue. Looks like it should do I2S which might be cool to get running keeping it digital all the way through to the car headunit.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top