{"action":"created","issue":{"url":"https://api.github.com/repos/merbanan/rtl_433/issues/47","labels_url":"https://api.github.com/repos/merbanan/rtl_433/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/merbanan/rtl_433/issues/47/comments","events_url":"https://api.github.com/repos/merbanan/rtl_433/issues/47/events","html_url":"https://github.com/merbanan/rtl_433/issues/47","id":40372078,"number":47,"title":"Any caveats with using decimation rate in rtl_433","user":{"login":"magellannh","id":7563388,"avatar_url":"https://avatars.githubusercontent.com/u/7563388?v=3","gravatar_id":"","url":"https://api.github.com/users/magellannh","html_url":"https://github.com/magellannh","followers_url":"https://api.github.com/users/magellannh/followers","following_url":"https://api.github.com/users/magellannh/following{/other_user}","gists_url":"https://api.github.com/users/magellannh/gists{/gist_id}","starred_url":"https://api.github.com/users/magellannh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magellannh/subscriptions","organizations_url":"https://api.github.com/users/magellannh/orgs","repos_url":"https://api.github.com/users/magellannh/repos","events_url":"https://api.github.com/users/magellannh/events{/privacy}","received_events_url":"https://api.github.com/users/magellannh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-08-15T18:29:53Z","updated_at":"2015-10-26T20:15:19Z","closed_at":"2015-10-26T20:15:19Z","body":"Hello,\r\n\r\nI've been using rtl_433 in an application that gathers and reports Oregon Scientific weather sensor data.  The app runs on a Raspberry Pi and on a Netgear R7000 router running dd-wrt.  So far so good.\r\n\r\nNow I'd like to add support for an Efergy current sensor to my app.  I have the decoding for the new sensor working, but it uses FSK encoding and requires rtl_fm instead of rtl_433.  \r\n\r\nMy plan is to merge the code for rtl_433 and rtl_fm and send raw rtl-sdr samples to both decoders for processing.  Separately, the rtl_fm code uses about 20% cpu on the Rasperry Pi, and the rtl_433 code uses about 12%.\r\n\r\nMy problem is that the rtl_fm decoder runs at 1,200,000 samples per second and I can't get it working at rates much below that.  I've been running rtl_433 at 250,000 samples per second.  \r\n\r\nTo have a shot at merging the code, I need to get both decoders running at the same frequency and sample rate and consuming a reasonable amount of cpu. rtl_433 does fine decoding messages from my OS sensors at 1,200,000 samples per second, but the problem is it uses 60% of the Raspberry pi's cpu to do it.\r\n\r\nSo I thought maybe I could sample at 1,200,000 s/sec and set decimation using -c 2 so rtl_433 didn't have to work so hard.  If I understand how it works, this would get the effective sample rate that rtl_433 has to process to about 300,000, which is close to the default of 250000.  Sure enough, when I use \"rtl_433 -s 1.2e6 -c 2\", the cpu load drops to 20% or less as I had hoped.\r\n\r\nThe problem is that decoding doesn't work with decimation set to anything other than the default 0.  I manually adjusted the short, long, and reset limits in rtl_433 to account for the effective sample rate difference from using -c 2 by dividing the values by 4.  I also tried -c 1 with dividing the values by 2.  (I also tried these settings with the original values just in case there was some magic adjustment in the code that I didn't see).\r\n\r\nDo I understand how this works or am I missing something big?  I would have guessed that using decimation would have been fine, since the new sample rate was so much higher than the old one.  Are there any other caveats to using the decimation feature to reduce processing load?\r\n\r\nAny thoughts on this would be greatly appreciated!\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/merbanan/rtl_433/issues/comments/151271156","html_url":"https://github.com/merbanan/rtl_433/issues/47#issuecomment-151271156","issue_url":"https://api.github.com/repos/merbanan/rtl_433/issues/47","id":151271156,"user":{"login":"merbanan","id":124883,"avatar_url":"https://avatars.githubusercontent.com/u/124883?v=3","gravatar_id":"","url":"https://api.github.com/users/merbanan","html_url":"https://github.com/merbanan","followers_url":"https://api.github.com/users/merbanan/followers","following_url":"https://api.github.com/users/merbanan/following{/other_user}","gists_url":"https://api.github.com/users/merbanan/gists{/gist_id}","starred_url":"https://api.github.com/users/merbanan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merbanan/subscriptions","organizations_url":"https://api.github.com/users/merbanan/orgs","repos_url":"https://api.github.com/users/merbanan/repos","events_url":"https://api.github.com/users/merbanan/events{/privacy}","received_events_url":"https://api.github.com/users/merbanan/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T20:15:19Z","updated_at":"2015-10-26T20:15:19Z","body":"Sure."}}