Hacking the VSP Box (Noise Maker)

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

FalconFour

Well-known member
Joined
Sep 19, 2012
Messages
326
Location
San Jose, CA
I hate that dang thing. :lol:

It sucks that the 2013+ LEAFs don't have the VSP Off button. Regulations, whatever. People have eyes - pedestrians and drivers should both be responsible for avoiding one another. Not the job of the vehicle manufacturer. That petite dandelion "ding, ding, ding" backup sound is awful, as is the cutesy "whoosh" it makes, and the Japanese Utopia set of sounds embedded as "effects" in the control panel. That's my position on it.

So, in setting out to add "VSP Off" back to my 2013 LEAF, I found - spoiler alert - you just ground pin #5 of the VSP plug, which is where the button used to reside on 2011-2012 LEAFs. Just a momentary ground, and you'll get the "VSP Off" light on the center console (where the "passenger airbag" indicator is). One more momentary ground, and VSP is back on. It's a toggle button. So, just wire that up, and you've got a VSP Off button again. You're welcome. :)

But that's never enough for a hacker. :cool:

I took the VSP box apart, and found a MX25L8006E 8mbit (1MByte) SPI flash ROM chip on there. "That's an awful big chip for runtime parameters or code...", I thought.

So I dug into it with a Raspberry Pi and the "flashrom" program. I wired everything up, but found I had to pull the "HOLD#" pin high as well. Sure enough, Flashrom extracted the full contents of the ROM chip and placed it into a flat binary ROM file.


That file is here. Go at it!
https://onedrive.live.com/redir?resid=4C8184259C5488!4352&authkey=!AGOSs8h_iXQjdK8&ithint=file%2crom

I've been playing with methods to get the audio data out of the ROM. Best way to go about modifying something is to recreate it first. So, I fired up Audacity and took a stab at some RAW import parameters.

Seems like VOX ADPCM, 22050hz, but even that coding comes out a bit warbled. That also only seems to be the encoding for the interior sounds (startup sounds). The others - the beeps and the "whoosh" sounds - seem to be encoded differently, which makes sense, since the whooshing sound varies a LOT based on the speed of the car.

So far, I've found this structure:
(Lots of silence - 0xFF)
Default power-button chime
(silence)
Default startup sound -- update: these may be Yamaha ADPCM format, since the chip is a Yamaha YMF827B
(silence)
Effect 2(?) power-button chime
Whooshing effect base (encoded differently)
(silence)
Effect 2(?) startup sound
(silence)
Effect 3(?) power-button chime
(silence)
Effect 3(?) startup sound
(silence)
Series of beep/ding tones (encoded differently) -- update: these are also Yamaha ADPCM, 10 tones total

I think the whooshing effects and the beep/ding tones are used programmatically, hence they're stored with a different encoding.

With Flashrom, since the chip is one of their many supported chips, I can also write back this raw data directly onto the chip, so once we establish how the sounds are encoded, they can be modified, patched into the ROM (likely in place of the original sounds, exactly the same duration is required), and then flashed back onto the board. If all else fails, I still have the ROM backup that I can flash back, and it's like nothing ever changed. :geek:

Anyone want to try their hand at tearing that ROM apart? :mrgreen:
 
Already made some great progress here! It appears that the effects are encoded as - naturally - Yamaha ADPCM format. By extracting a section and giving it the extension ".YADPCM", a little piece of software called Awave Studio (shareware) was able to open it up and play it 100% perfectly.



For your listening pleasure, here it is in WAV format:
https://onedrive.live.com/redir?resid=4C8184259C5488!4354&authkey=!AABubliEbsoyo6w&ithint=file%2cwav

Now that we know what the format is supposed to be, we can replace sounds! :mrgreen:

update: Also, looking at the ROM file, it looks like the effect sounds line up quite clean with the boundaries of 0x10000 segments - which means that a replacement sound may not necessarily need to be the same size! It may be perfectly fine with a shorter sound being padded with 0xFF at the end, or a longer sound extending into the existing 0xFF padding. I think it just cares about the start address...
 
Very cool. Nice work! Is one of the wires into the VSP a speed indicator or does CANbus go there and it just snoops? Was the ROM socketed or did you have to unsolder it? Be interesting to try programming a new ROM with a minor tweak to see if there is a checksum protection. Don't know why they would bother for the sound bytes (bites?) except, perhaps, out of habit.
 
This is the diagram for 2011-2012 - which is basically identical to 2013+ (except that 2013 has the VSP OFF switch just removed from the diagram, pin position and all - though it still works!).



I think it listens to the CAN bus. It almost seems like the module just listens for specific commands, and has a fair bit of its own (non-persistent) memory. Example - it forgot that I set the Effect to "off" after unplugging the module, so when I plugged it back in, it went back to the default sound-set. I tried changing the effect while it was unplugged, and the dash was happy to navigate, but to no effect (it defaulted back to the normal sounds when plugged back in). Finally, if I plug the VSP module back in *just* after pressing the power button, but before it'd typically play the startup sound, it'll actually play only the startup sound, right on time. I think it's based on a CAN command set.

As for the ROM, I just hacked it in-place, no soldering needed. I used one of these (exact items, actually), and a Raspberry Pi using this guide for installing & configuring flashrom on the Pi with a clean Raspbian base. The circuit was totally cool with being given 3.3V, it seems. The board still works perfect in the car after various attempts at getting the ROM out of it. Holding "HOLD#" high (actually just shorting it to VCC pin) was the key to getting it working in the end.
 
Only the 2011's have the VSP off button, btw. US 2012's didn't have it either. All other markets have it regardless of year I think.
 
JeremyW said:
All other markets have it regardless of year I think.
Interesting, if that's the case.

Personally, (now that I have an owned Leaf) I'd only really only want a clean switch/button to toggle the VSP off. The only time I'd want to turn it off when backing out of my driveway @ home, after no sound or a just a few reverse chimes. I'd otherwise want all the noises whenever they normally sound. I don't want to disconnect the module and lose all those sounds.

I just don't want to alert bad guys that I'm leaving home. And yes, my house was burglarized for the 1st time ever in January 2015. I'll never know if the Leaf noises helped w/them determining my coming/going patterns, but they broke in on a weeknight while I wasn't on vacation (but wasn't home either). This house (built in 1979) has never been burglarized nor has any place I've lived, until now.

It really irks me Nissan removed the toggle on the '12+ Leafs. I've been meaning to officially contact Nissan (no, not via a dealer) to have them bring it back in future models and also sell a supported mod w/a disable switch for ones w/o it. I'm 99% sure the latter won't happen but the former could happen, if enough people complain.
 
jhm614 said:
Great work! I'm looking forward to the Jetson's Car Sound mod!
That was my first thought! ;-)

JeremyW said:
The only time I'd want to turn it off when backing out of my driveway @ home,
I would think, with people/kids in neighborhoods, that's a time I'd want it on more than some others..
As for the crime aspect, I would think any criminal so close that they can hear a backup beep can also see your car driving away.
But that's just me.. ;-)

desiv
 
jhm614 said:
Great work! I'm looking forward to the Jetson's Car Sound mod!

If you can change my VSP sound to the Jetson's sound, I'll buy this right NOW,

take%20my%20money.jpg
 
There's some merit to it... if said burglar lived in a home nearby, they'd be tipped off at any time that your specific car is leaving, since audio goes in all directions and the sound is totally unique to the Leaf, more than they'd be by visuals - having to directly watch 24/7.

Surprised to learn that 2012 was also missing the switch - I thought 2011 and 2012 had no differences at all (except seat heaters)! That's pretty shocking, and kinda sad. Well, now they can all get the VSP button back -- I did a little more research in the "VSP default off" thread here -- http://www.mynissanleaf.com/viewtopic.php?f=37&t=3296&p=432856#p432856 -- and for about $40 to buy the Nissan OEM button, you can add a second VDC (traction control) Off button and wire it up to the VSP pin #5 for an on/off button just like the 2011's. :)

So, as for the progress on the hacking, I've mapped out the ROM space and extracted all the samples. They all appear to be 22050hz Yamaha ADPCM format. Sadly, there's no "base sound" that I was expecting to find - all the actual sounds I can find in the ROM are the dash "effect" sounds - power button and "ready" sounds. There's also a series of 10 very short sine-wave tones of various frequencies, and I'm not sure what their purpose is yet. I may be able to replace these base "beeps" to make the Jetsons sound though! -- if, of course, that is the purpose of their existence!

All the samples in the ROM seem to have a common 4-byte header, while the effect sounds have a single byte difference from the beep samples (I'm not sure their specific codes at the moment, kind of away from the workbench now). Strangely, each sample seems to be padded by varying numbers of 0x80 after the 4-byte header. The header also doesn't seem to correspond to the length of the sample - it's just the same 4 bytes for each type of sample (effect or beep). When I set up replacement samples, I simply overwrote the data, leaving the 4 bytes intact, and padded any remaining data with 0xFF as like the originals.

When I flashed it, I no longer had any sounds at all. Each sound was just... mute. The charger beep and backup ding still worked, though - both of which are also controlled by the VSP box (of course).

Backing it off a bit, I restored the original data and only changed the Effect 1 sounds. When I tried that, just the Effect 1 sound set was muted, and the rest played normally (quirky and silly as they are).

I'm starting to get a feeling that it may not be 0x80 padding to form a checksum, but perhaps padding as a way to "bitmap" the duration of the sound data itself - and since I overwrote that "bitmap", it figured the length was zero for each sample. I'll be hacking at it again tonight for sure! :D
 
Hope is practically gone for the outside noise generator. :cry: I found that those tones are 22KHz 8-bit PCM sounds, and replaced them with square waves of the same tone. The car seemed to sound different at first - woo! But then I tried reversing them - placing them in reverse slot order, so the tones would be completely scrambled in practice. I ended up with the same sounds from the noisemaker - exactly the same sounds. :x

Seems that those sounds are almost definitely generated by the CPU, which I've pinned down as a Renesas 78K0R/Fx3 16-bit microcontroller with 192KB ROM and 12KB RAM. Those sounds would be easy to generate with a program, I'd think, or have the basic structure embedded in the program.

Lame.

Hope still holds out for hacking the interior sounds, though...
 
desiv said:
I would think, with people/kids in neighborhoods, that's a time I'd want it on more than some others..
As for the crime aspect, I would think any criminal so close that they can hear a backup beep can also see your car driving away.
I totally get that and would agree w/you too except for my burglary and the below.
FalconFour said:
There's some merit to it... if said burglar lived in a home nearby, they'd be tipped off at any time that your specific car is leaving, since audio goes in all directions and the sound is totally unique to the Leaf, more than they'd be by visuals - having to directly watch 24/7.
Exactly! Well, from police stats at a local meeting involving the police and stories we hear about arrests, it seems the burglars do NOT live in my neighborhood but come from other parts of the city and other cities. There were definitely people casing houses, sometimes posing as solicitors, fake Jehovah's witnesses/religious people, etc. They were in my backyard poking around w/flashlights thru the windows before they broke in less than 10 minutes later.

It doesn't help that my city is known to be understaffed by about 300 officers (should have ~1100, IIRC, if properly staffed) and has a policy where they will NOT respond to alarm calls unless there's verification either by witness, visual (e.g. camera) or some audio verification (e.g. remote listening to a mic).

But yes, the distinctive loud reverse noise is a tip for anyone who might be in the area casing to look over and to notice a car leaving...

BTW, in my area, per local newspaper reporting official police stats for my city, between Oct 2014 and Jan 2015 (I was burglarized in Jan 2015), we had 180 burglaries. In the same period a year before, there were only 55.

Within a week or two after my house was broken into, a house 6 houses away, on a street connected to mine was burglarized. That night, another 5-6 houses in a nearby neighborhood were burglarized. Seemed to be the same group, from what I heard on nextdoor.com. A week later, its neighbor (5 houses from me) was broken into. 2 months before my house was broken into, the house on my street 3 houses away from me was broken into. I'm in an area where median home prices are now ~$1.2 million!
 
cwerdna said:
I totally get that and would agree w/you too except for my burglary and the below.
FalconFour said:
There's some merit to it... if said burglar lived in a home nearby, they'd be tipped off at any time that your specific car is leaving, since audio goes in all directions and the sound is totally unique to the Leaf, more than they'd be by visuals - having to directly watch 24/7.
Exactly!
I don't buy that...
If said burglar lived that close and was looking for a time to get into your house, a VSP or lack thereof isn't going to stop him.
Someone going to that much trouble to target you is going to get in, Leaf or not.

There are MANY MANY things that "could" happen.
Do you make sure you never leave the house at the same time to go to work? You know a burglar could use that!
I think they would be MUCH more likely to do that than figuring out which sound goes to which car..
Delivery truck backs up in the neighborhood and they think you're gone when you aren't..

Put up some signs about video surveillance.. Fake camera or 2. (Or real ones) Motion sensing lights.
That will do MUCH more to protect your house, and you won't have to worry about backing into kids riding big wheels.. ;-)

Just my opinion..

desiv
p.s. I grew up in East L.A, so I'm not unfamiliar with high crime neighborhoods.. ;-)
 
desiv said:
I don't buy that...
If said burglar lived that close and was looking for a time to get into your house, a VSP or lack thereof isn't going to stop him.
Someone going to that much trouble to target you is going to get in, Leaf or not.

I dunno... I think it's less of "waiting for the opportunity" and more of "hearing the invitation". :?
 
FalconFour said:
Surprised to learn that 2012 was also missing the switch - I thought 2011 and 2012 had no differences at all (except seat heaters)!
That's actually not entirely true either -- many late '11s had the "cold weather package" that gave them the seat, steering wheel, and battery heaters. So (I believe) the only known differences between an '11-CW and a '12 are the VSP off button, and the lack of a light in the glove box (yes, really, they removed it, there was a thread on that here long ago).
 
Since I drive in a metro with a high percentage of pedestrians and cyclists (Boston-Cambridge-Somerville MA) I want my VSP louder, or to have a sonar ping (or, sure Jetsons).
 
Arlington said:
Since I drive in a metro with a high percentage of pedestrians and cyclists (Boston-Cambridge-Somerville MA) I want my VSP louder, or to have a sonar ping (or, sure Jetsons).

Wow, the ICE drivers need to make their cars a quiet as possible, and the EV drivers are wanting to make their cars as loud as possible. How about driving as if pedestrians have the right of way (as they do!). If they walk out in front of you, you are responsible. If you need noise, use it when needed. That's what the HORN is for.

Troy.
#
 
troyf said:
Arlington said:
Since I drive in a metro with a high percentage of pedestrians and cyclists (Boston-Cambridge-Somerville MA) I want my VSP louder, or to have a sonar ping (or, sure Jetsons).

Wow, the ICE drivers need to make their cars a quiet as possible, and the EV drivers are wanting to make their cars as loud as possible. How about driving as if pedestrians have the right of way (as they do!). If they walk out in front of you, you are responsible. If you need noise, use it when needed. That's what the HORN is for.

Troy.
#

The generally true assumption is that an EV is quieter than most ICE, in low-speed situations such as parking lots. Above 15-20 MPH ALL cars make lots of tire noise. Regardless of how you apportion the responsibility, the reality is that we have all become accustomed to how vehicles sound, and those auditory clues can be important in a situation like a parking lot with a dense combination of moving vehicles and pedestrians, many of whom are experiencing a high task load (looking for a spot, parking, looking for their car, dealing with kids, packages, groceries, etc...

It may be satisfying to think that accidents would not happen if everybody did the right thing at all times. But if the goal is to have fewer accidents, it helps to design them out. I.e., Right-of-way is a great concept and necessary but it's even better if that pedestrian doesn't accidentally walk in front of you in the first place!

There are inherent limitations to human perception, concentration, and multi-tasking ability and these apply even to highly-skilled. detail-oriented and highly-trained people such as airline pilots. Perfection is a myth and relying on myths leads to poor design. Of all of the stuff I learned while flying, the study of "human factors engineering" was one of the most enlightening.

http://www.britannica.com/topic/human-factors-engineering
 
For the same reason I like my bike's bell--as a friendly way of saying "here comes a bike; please behave as expected" (and to deliver the sometimes-required "audible signal while overtaking")--I want my car to have a friendly, audible cue for others that share the road with me. In a crisis, we use "angry" noises: cars honk and cyclists yell. I want a non-angry, non-crisis voice for my EV. that other non-car road users will think about like an ICE's "purr".
troyf said:
How about driving as if pedestrians have the right of way (as they do!).
You seem to proceed from two false assumptions, the first about how I drive and the second about the applicable law.
I do, in fact, drive whenever possible as if pedestrians always had the ROW, and aware, for example, that speed limits of 30 and 35 are often chosen for places with more pedestrians.

But, no, as a matter of (Massachusetts) state law, Pedestrians only have an absolute ROWin marked crosswalks, and not, for example, when they chose to step into traffic from between cars mid block. I cycle more miles than I drive most weeks, too, so I drive as if cyclists are full & equal partners in sharing the road (which actually *is* the law here).

I would like my car to be louder--in a friendly way--so that those I share the street with can make decisions that are better informed by their sense of hearing

" If they walk out in front of you, you are responsible."
Not if they choose to step out from between cars mid block, which, when a downtown's pedestrian flows get heavy enough, they end up doing alarmingly often. I want to help others conform their behavior to expectations. Right now, one universal expectation is that cars make engine noise (even the Mass RMV clerk's head nearly exploded when I told her that my electric car had zero cylinders, and that the previous title had had "E" instead of a number).

Believe me, I drive (and cycle) as if pedestrians have 100% ROW everywhere (which, as a matter of law, they only have in marked crosswalks).

So, I'm trying to deter the types that'd pop out unexpectedly between a row of parallel parked cars. Even "deter" is too strong a word. I want to "inform". I want a hacked, louder-but-still-friendly VSP to "allow pedestrians to make better-informed decisions about how they interact with oncoming EVs" How's that?

If you need noise, use it when needed. That's what the HORN is for
The horn is for emergencies, and has an angry/accusatory connotation. I'm looking for something that communicates a "we're sharing this public space message" and "I'm over here, going X mph" The horn is very hard to honk in a "friendly reminder" way--the best one can do is two short "beep beep", often with insufficient reaction time. I'm trying to better avoid accidents that would be *the pedestrians' fault* should they happen.
 
Back
Top