Dahua Intercom Customization? Any ideas?

mgomespt

Young grasshopper
Joined
Nov 2, 2016
Messages
32
Reaction score
2
Location
Lisbon, Portugal
Hello everyone,

I've been trying for a few weeks to find an answer online to my customization craves without success so I might give this forum a try:

I've got an VTO2000A outdoor unit and a VTH1560BW indoor unit paired up and working happily together, however:

- The 2 stock ringtones that come with the indoor unit (phone_ring1.pcm and phone_ring2.pcm) are rather "meh" and I'd like to get the station to play my own. I haven't found any such upload feature the config tool and it seems one way would be to use the "Dahua Firmware Mod Kit". I've tried using this tool (it was a bit of a pain to setup the environment on my AWS Redhat VM) but I haven't managed to get the VTH1560BW to accept/acknowledge the resulting firmware binary file (the config tool finishes uploading the firmware, the unit reboots into the old firmware).

I've tried uploading my own AAC-encoded .pcm file (via FTPget, using the telnet console) and putting it under /mnt/data/Sounds/Phonerings (a read only mountpoint, so a bit of sleigh of hand was needed...I've replaced the Phonerings folder with a symlink to the sdcard, where my pcm file was uploaded)....but the main VTH application didn't show the new ringtone on the UI so I must assume that these are read once and loaded into the unit's RAM during the application start...a reboot messes up my symlink and I still haven't tried restarting the main process without a reboot (it's named "diana" if I recall correctly...it definitely had a common "western" female name)...However this path will be a pain since the symlink will be fudged on any power loss event or spontaneous reboot so I'd rather stay away from this. Any other ideas?

- My other "customization desire" would be to turn off the outdoot unit's LED light (the one that illuminates the name tag under the camera lens)...as it is on at all times, even during daytime!! it's not only plainly wasteful as it is just asking for premature LED burnout. Ideally this name tag would only light up when someone approached the camera or at worst when the ambient light level crossed a minimum treshold...

Any help would be appreciated.

Miguel
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,338
Reaction score
3,519
Don't have any of those so I can't say for sure, but here are a few thoughts:
Pull phone_ring1.pcm and phone_ring2.pcm off the VTH compare the file sizes and durations.
Modify your ring to more closely match the stock ring size and duration
Hake sure other thigns like sampling frequency and stereo / mono match.
When you transfer your ring rename it to match one of the stock sounds or try phone_ring3.pcm

Experiment with things that will be purged on power loss first, maybe just power it from a UPS.
 

mgomespt

Young grasshopper
Joined
Nov 2, 2016
Messages
32
Reaction score
2
Location
Lisbon, Portugal
Thanks I'll give it a shot.
I'd rather stay away from this hack (unless there's no other option of course) as the unit seems to have a hard-coded once-a-week reboot (visible on the web UI, you get to choose the week day it reboots)...
since this is controllable via telnet I can get my raspberry pi to login to it and issue the commands via a script after each reboot...but it's just an inelegant/brutish way to work around the problem. I'd rather be looking into something which wouldn't require my constant attention...
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
you can proabibly dump just that MD partition using DD to a ramdisk, then copy it to a NFS drive where you can mount it and add the files you want back in externally.. then use mtdflash tool to put it back

I would try to symlink over one of the existing files first to make sure your custom ringtone is valid
 

mgomespt

Young grasshopper
Joined
Nov 2, 2016
Messages
32
Reaction score
2
Location
Lisbon, Portugal
Interesting, I've used ffmpeg to analyse the original phone_ring1.pcm audio file and it read the file as being AAC encoded.

I've uploaded this file here: phone_ring1.pcm (122.45KB) - SendSpace.com

I've then used ffmpeg to convert my raw PCM "dingong" audio file into AAC and renamed the output into "dingdong.pcm"...but I can see that VLC doesn't play the original file so I guess the encoding is different (will have to look more carefully at the original file encoding attributes on ffmpeg later on)
 

mgomespt

Young grasshopper
Joined
Nov 2, 2016
Messages
32
Reaction score
2
Location
Lisbon, Portugal
Hey Nayr, I recognize your avatar from the "Dahua black face at night" thread, great work there :) thank you for your pointers, I didn't know about about mtdflash (will have to google it up to get details) I supose it allows you to write into the read-only flash mountpoints?
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
actually its mtd-utils/flashcp.c at master · vamanea/mtd-utils · GitHub had a brain fart, but yeah it'll let you write to the mtd.. gotta be carefull to make sure the file dont change size with your modifications.. @cor35vet can probably chime in here too, he's alot more familiar with the filesystem on these than I am.. he gave me a pre-compiled version of that on IRC that I been using to make modifications by hand with.
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,338
Reaction score
3,519
Interesting, I've used ffmpeg to analyse the original phone_ring1.pcm audio file and it read the file as being AAC encoded.

I've uploaded this file here: phone_ring1.pcm (122.45KB) - SendSpace.com

I've then used ffmpeg to convert my raw PCM "dingong" audio file into AAC and renamed the output into "dingdong.pcm"...but I can see that VLC doesn't play the original file so I guess the encoding is different (will have to look more carefully at the original file encoding attributes on ffmpeg later on)
Based on that file, you need to convert your sound file to a raw headerless format, signed 16bit PCM, 16KHz sampling frequency.

You can do this in Audacity by selecting export audio and choosing other uncompressed files then RAW. If you import the raw data at the wrong sampling frequency you get all static or the wrong playback speed.
 
Last edited:

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,338
Reaction score
3,519
here you go... rename file to give it a .pcm extension
the background noise probably doesn't matter, it's most noticeable through headphones.

doorbell-short is 2 bytes shy of the size of phone_ring1
 

Attachments

Last edited:

mgomespt

Young grasshopper
Joined
Nov 2, 2016
Messages
32
Reaction score
2
Location
Lisbon, Portugal
Any idea about how to turn off the LED on the outdoor unit? hopefully one can get away with something like setting a GPIO pin to low (as in the raspberry pi)
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,338
Reaction score
3,519
Any idea about how to turn off the LED on the outdoor unit? hopefully one can get away with something like setting a GPIO pin to low (as in the raspberry pi)
It's probably not worth the effort and if you start randomly flipping pins you could seriously damage things. It may not even be controlled by gpio.

We're talking something on the order of 0.03W (just a ball park estimate), which would cost me $0.028 USD per year to operate 24-7. Disassembly is the only way to make the light go away in my opinion.
 

cor35vet

IPCT Contributor
Joined
Jun 23, 2016
Messages
337
Reaction score
246
As nayr has mentioned before: Set up an NFS server on your development box, share the folder that Dahua-Firmware-Mod-Kit set up for you.
Stop "sonia" using "killall sonia" (I think it's called sonia as on the IPC)
Check the mountpoints on the camera using the "mount" command.
Unmount the partition which has the sound you want to replace (if it complains about in use: umount -l)
Mount the extracted partition from your NFS server to the mountpoint you just unmounted.
Example:
Code:
mount -o rw,relatime,vers=3,rsize=262144,wsize=262144,namlen=255,soft,nolock,proto=tcp,port=2049,timeo=3,retrans=3 192.168.1.4:/home/david/Dahua/DH_IPC-HX4XXX-Eos/web-x.squashfs.img.extracted /mnt/web
If you have IRC you can also message me on freenode, my nick is BotoX.

As for the LED: Does it turn on right when the device gets power or later on, does it ever turn off? If yes then you can very likely control it in SW.
 

matt0123

n3wb
Joined
May 4, 2018
Messages
1
Reaction score
0
@cov35vet I'm trying to do something similar however the intercoms I have VTH5221D and VTH5241D they have a USB port though is that of any help?
 

CCTVTommy

n3wb
Joined
Nov 13, 2018
Messages
1
Reaction score
0
Location
United Kingdom
i know this post is now old bt i am still interested in this. the above problem with the light being off now seems to be a issue for me, i want it to stay on all the time and not turn it off !

also the live monitoring i want the timeout turned off so i want the live feed on a constant view. any ideas
 

Defender666

Getting the hang of it
Joined
Dec 19, 2015
Messages
193
Reaction score
25
I want the sound to only ring one time. It is anoying if the visitor ring and then the device ring for all the time even though I already opened the door by hand.

Any possibility to just play it for 2 seconds but keep the video. Do I need to replace the sound file with a short file an 30 sec mute?
 
Top