{"id":1163,"date":"2013-02-18T20:57:26","date_gmt":"2013-02-18T12:57:26","guid":{"rendered":"http:\/\/www.freemindworld.com\/blog\/?p=1163"},"modified":"2013-02-18T20:57:26","modified_gmt":"2013-02-18T12:57:26","slug":"130218_douban_fm_with_raspberry_pi","status":"publish","type":"post","link":"https:\/\/www.freemindworld.com\/blog\/2013\/130218_douban_fm_with_raspberry_pi.shtml","title":{"rendered":"\u7528Raspberry Pi\u6253\u9020\u771f\u6b63\u7684\u201c\u8c46\u74e3FM\u201d"},"content":{"rendered":"<p>\u60f3\u7528\u5e8a\u5934\u7684\u6536\u97f3\u673a\u6536\u542c<a title=\"\u8c46\u74e3FM\" href=\"http:\/\/douban.fm\" target=\"_blank\">\u8c46\u74e3FM<\/a>\u5417\uff1f\u5982\u679c\u4f60\u6709\u4e00\u53f0<a title=\"Raspberry Pi\" href=\"http:\/\/www.raspberrypi.org\" target=\"_blank\">Raspberry Pi<\/a>\uff0c\u8fd9\u4e2a\u613f\u671b\u5c31\u53ef\u4ee5\u6ee1\u8db3\u3002<\/p>\n<p>Raspberry Pi\uff0c\u4e2d\u6587\u540d\u6811\u8393\u6d3e\uff0c\u662f\u4e00\u53f0\u5ec9\u4ef7\u7684\u5355\u677f\u673a\uff0cARM\u67b6\u6784\uff0c\u53ef\u4ee5\u8fd0\u884cLinux\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b83\u7531\u82f1\u56fd\u7684\u6811\u8393\u6d3e\u57fa\u91d1\u4f1a\u5f00\u53d1\uff0c\u76ee\u7684\u662f\u4ee5\u4f4e\u4ef7\u786c\u4ef6\u53ca\u81ea\u7531\u8f6f\u4ef6\u4fc3\u8fdb\u6821\u56ed\u4e2d\u7684\u8ba1\u7b97\u673a\u79d1\u5b66\u6559\u80b2\u3002\u662f\u7684\uff0c\u5b83\u8bbe\u8ba1\u521d\u8877\u5176\u5b9e\u662f\u7ed9\u5c0f\u670b\u53cb\u4eec\u5b66\u7535\u8111\u7528\u7684\uff0c\u4e0d\u662f\u7ed9\u4f60\u4eec\u8fd9\u4e9bGeek\u6765\u6298\u817e\u73a9\u7684\u3002<\/p>\n<p>\u7528Raspberry Pi\u642d\u5efa\u4e00\u4e2a\u8c46\u74e3FM\u7684\u8c03\u9891\u5e7f\u64ad\u53f0\u5176\u5b9e\u5e76\u4e0d\u662f\u4e00\u4ef6\u5f88\u56f0\u96be\u7684\u4e8b\u60c5\uff0c\u4e3a\u5b9e\u73b0\u8fd9\u4e2a\u76ee\u6807\uff0c\u8981\u89e3\u51b3\u7684\u4e24\u4e2a\u95ee\u9898\u662f\uff1a<\/p>\n<ul>\n<li>\u4ece\u8c46\u74e3FM\u7f51\u7ad9\u4e0a\u4e0b\u8f7dMP3\u97f3\u4e50\u7801\u6d41\u5e76\u89e3\u7801<\/li>\n<li>\u628a\u97f3\u9891\u4fe1\u53f7\u8c03\u5236\u6210\u8c03\u9891\u4fe1\u53f7\u53d1\u5c04\u51fa\u53bb<\/li>\n<\/ul>\n<p>\u9020\u8f6e\u5b50\u7684\u4e8b\u60c5\u4e0d\u8981\u81ea\u5df1\u505a\uff0c\u8fd9\u4e24\u4e2a\u95ee\u9898\u5176\u5b9e\u5df2\u7ecf\u90fd\u89e3\u51b3\u4e86\uff1aGithub\u4e0a\u7684<a title=\"FMD (Douban FM Daemon)\" href=\"https:\/\/github.com\/hzqtc\/fmd\" target=\"_blank\">fmd<\/a>\u9879\u76ee\u5b9e\u73b0\u4e86\u4e00\u4e2a\u901a\u8fc7\u672c\u5730\u58f0\u5361\u64ad\u653e\u8c46\u74e3FM\u7684\u670d\u52a1\u5668\uff1b<a title=\"Turning the Raspberry Pi Into an FM Transmitter\" href=\"http:\/\/www.icrobotics.co.uk\/wiki\/index.php\/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter\" target=\"_blank\">\u8fd9\u7bc7\u6587\u7ae0<\/a>\u5219\u4ecb\u7ecd\u4e86\u5982\u4f55\u5199\u7a0b\u5e8f\u5bf9\u97f3\u9891\u4fe1\u53f7\u8fdb\u884c\u8c03\u5236\u5e76\u63a7\u5236Raspberry Pi\u7684<a title=\"Raspberry Pi Low-level Peripherals\" href=\"http:\/\/elinux.org\/RPi_Low-level_peripherals\" target=\"_blank\">GPIO\u7aef\u53e3<\/a>\u628a\u4fe1\u53f7\u53d1\u9001\u51fa\u53bb\u3002\u6240\u4ee5\u5269\u4e0b\u7684\u4e8b\u5c31\u662f\u628a\u5b83\u4eec\u7ec4\u5408\u8d77\u6765\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u7ec4\u5408\u4ee3\u7801\u8fd9\u79cd\u810f\u6d3b\u7d2f\u6d3b\u6211\u4e5f\u7ed9\u5927\u5bb6\u505a\u597d\u4e86\uff0c\u53ef\u4ee5\u4eceGithub\u4e0a\u83b7\u53d6\u3002\u55ef\uff0c\u8fd9\u4efd\u4ee3\u7801\u76ee\u524d\u7684\u8d28\u91cf\u662fIt just works\uff0c\u5404\u4f4dmake\u4e00\u4e0b\u5c31\u597d\uff0c\u6ca1\u4e8b\u5c31\u4e0d\u8981vim\u5b83\u4e86\u2026\u2026<\/p>\n<p><code>git clone git:\/\/github.com\/lifanxi\/fmd.git<\/code><\/p>\n<p>\u4ee3\u7801\u4e0b\u8f7d\u540e\u5728Raspberry Pi\u4e0a\u53ef\u4ee5\u76f4\u63a5make\u7f16\u8bd1\uff0c\u5982\u679c\u7f3a\u5c11\u4f9d\u8d56\uff0c\u53ef\u80fd\u9700\u8981\u5b89\u88c5libcurl4-openssl-dev,\u00a0libjson0-dev, libmpg123-dev, libao-dev\u8fd9\u4e9b\u4f9d\u8d56\u5305\uff08\u6211\u7528\u7684\u662f<a title=\"Raspbian\" href=\"http:\/\/www.raspbian.org\/\" target=\"_blank\">Raspbian<\/a>\u53d1\u884c\u7248\uff09\u3002<\/p>\n<p>fmd\u7684\u4f7f\u7528\u65b9\u6cd5\u53ef\u4ee5\u53c2\u8003<a title=\"Git Hub - fmd for Raspberry Pi\" href=\"https:\/\/github.com\/lifanxi\/fmd\" target=\"_blank\">Github\u4e0a\u7684\u8bf4\u660e<\/a>\uff0c\u6211\u6240\u5b9e\u73b0\u7684\u6269\u5c55\u5c31\u662f\u5728fmd.conf\u914d\u7f6e\u6587\u4ef6\u4e2d\u53ef\u4ee5\u628adriver\u914d\u6210&#8221;pifm&#8221;\uff0c\u7136\u540e\u628adevice\u914d\u621088MHz~108MHz\u4e4b\u95f4\u7684\u67d0\u4e2a\u6307\u5b9a\u7684\u8c03\u9891\u53d1\u5c04\u9891\u7387\u503c\uff08\u8fd9\u662f\u5927\u591a\u6570\u56fd\u5bb6\u8c03\u9891\u6536\u97f3\u673a\u6240\u652f\u6301\u7684\u9891\u7387\u8303\u56f4\uff0c\u5982\u679c\u4f60\u6709\u522b\u7684\u65e0\u7ebf\u7535\u63a5\u6536\u8bbe\u5907\uff0c\u8fd9\u4e2a\u503c\u4e5f\u53ef\u4ee5\u8bbe\u6210\u662f&lt;250\u7684\u4efb\u610f\u503c\uff09\u6765\u5b9e\u73b0FM\u5e7f\u64ad\u7684\u53d1\u5c04\u3002\u5f53driver\u914d\u6210pifm\u800c\u4e0d\u662f\u9ed8\u8ba4\u7684alsa\u65f6\uff0cfmd\u5c31\u4f1a\u5de5\u4f5c\u5728FM\u5e7f\u64ad\u6a21\u5f0f\u3002<\/p>\n<p>\u6ce8\u610f\uff0c\u7531\u4e8eFM\u53d1\u5c04\u7684\u4ee3\u7801\u9700\u8981\u76f4\u63a5mmap \/dev\/mem\u8bbe\u5907\uff0c\u6240\u4ee5\u628adriver\u914d\u6210pifm\u8ba9fmd\u5de5\u4f5c\u5728FM\u5e7f\u64ad\u6a21\u5f0f\u65f6\uff0c\u9700\u8981\u4ee5root\u6743\u9650\u6765\u6267\u884cfmd\u3002\u4ee5root\u6743\u9650\u8fd0\u884cfmd\u65f6\uff0c\u6ce8\u610fHOME\u76ee\u5f55\u53ef\u80fd\u4f1a\u53d8\u6210\/root\uff0c\u6240\u4ee5\u76f8\u5173\u914d\u7f6e\u6587\u4ef6\u4e5f\u5f97\u6539\u653e\u5230\/root\/.fmd\u4e2d\u3002<\/p>\n<p>fmd\u8fd0\u884c\u8d77\u6765\u540e\uff0c\u6309\u7167\u6587\u6863\u7684\u8bf4\u660e\uff0c\u53ef\u4ee5telnet\u5230127.0.0.1:10098\u4e0a\u6216\u7528<a title=\"FMC\" href=\"https:\/\/github.com\/hzqtc\/fmc\" target=\"_blank\">fmc<\/a>\u6267\u884cplay\u547d\u4ee4\u5f00\u59cb\u5e7f\u64ad\uff0c\u628a\u6536\u97f3\u673a\uff08\u5e26\u6536\u97f3\u529f\u80fd\u7684\u624b\u673a\u5f53\u7136\u4e5f\u53ef\u4ee5\uff09\u8c03\u5230device\u53c2\u6570\u6240\u6307\u5b9a\u7684\u9891\u7387\u4e0a\u5c31\u53ef\u4ee5\u6536\u542c\u4e86\u3002<\/p>\n<p>\u5982\u679c\u4f60\u7684\u6536\u97f3\u673a\u79bb\u4f60\u7684Raspberry Pi\u592a\u8fdc\uff0c\u6536\u97f3\u6548\u679c\u4e0d\u597d\uff0c\u53ef\u4ee5\u5728Raspberry Pi\u4e3b\u677f\u4e0a\u7684GPIO 4\u53e3\u4e0a\u63d2\u4e00\u683920cm\u5de6\u53f3\u957f\u7684<a title=\"\u675c\u90a6\u7ebf\u56fe\u7247\" href=\"https:\/\/www.google.com\/search?q=%E6%9D%9C%E9%82%A6%E7%BA%BF&amp;hl=en&amp;newwindow=1&amp;client=firefox-a&amp;hs=cTI&amp;tbo=u&amp;rls=org.mozilla:en-US:official&amp;tbm=isch&amp;source=univ&amp;sa=X&amp;ei=NZshUf2VEsLimAW054DgAw&amp;ved=0CEUQsAQ&amp;biw=1104&amp;bih=523\" target=\"_blank\">\u675c\u90a6\u7ebf<\/a>\u505a\u5929\u7ebf\uff0c\u5e7f\u64ad\u8303\u56f4\u548c\u4fe1\u53f7\u5f3a\u5ea6\u5c31\u4f1a\u5927\u5927\u63d0\u9ad8\u4e86\u3002<\/p>\n<div id=\"attachment_1172\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.freemindworld.com\/blog\/wp-content\/uploads\/2013\/02\/130218a.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1172\" class=\" wp-image-1172\" title=\"Raspberry Pi\u6b63\u5728102.4 MHz\u4e0a\u64ad\u653e\u8c46\u74e3FM\u7684\u97f3\u4e50\" alt=\"Raspberry Pi\u6b63\u5728102.4 MHz\u4e0a\u64ad\u653e\u8c46\u74e3FM\u7684\u97f3\u4e50\" src=\"\/\/www.freemindworld.com\/blog\/wp-content\/uploads\/2013\/02\/130218a.jpg\" width=\"800\" height=\"561\" srcset=\"https:\/\/www.freemindworld.com\/blog\/wp-content\/uploads\/2013\/02\/130218a.jpg 800w, https:\/\/www.freemindworld.com\/blog\/wp-content\/uploads\/2013\/02\/130218a-300x210.jpg 300w, https:\/\/www.freemindworld.com\/blog\/wp-content\/uploads\/2013\/02\/130218a-427x300.jpg 427w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><p id=\"caption-attachment-1172\" class=\"wp-caption-text\">Raspberry Pi\u6b63\u5728102.4 MHz\u4e0a\u64ad\u653e\u8c46\u74e3FM\u7684\u97f3\u4e50<\/p><\/div>\n<p>\u76ee\u524d\u8fd9\u4e2a\u8c46\u74e3FM\u5e7f\u64ad\u53f0\u8fd8\u6709\u4e24\u4e2a\u5927\u95ee\u9898\u9700\u8981\u89e3\u51b3\uff1a<\/p>\n<ul>\n<li>\u7acb\u4f53\u58f0\u8c03\u9891\u5e7f\u64ad\uff1a\u73b0\u5728\u5b9e\u73b0\u7684\u7248\u672c\u662f\u5355\u58f0\u9053\u7684\uff0c\u7406\u8bba\u4e0a\u5e94\u8be5\u4e5f\u53ef\u4ee5\u628a\u97f3\u9891\u8c03\u5236\u6210\u7acb\u4f53\u58f0\u7684\u3002\u8fd9\u9700\u8981\u4e00\u4e9b\u6211\u6240\u4e0d\u5177\u5907\u7684\u8c03\u9891\u5e7f\u64ad\u7684\u77e5\u8bc6\uff0c\u5f85\u6211\u6709\u7a7a\u518d\u94bb\u7814\u94bb\u7814\u3002<\/li>\n<li>CPU\u5360\u7528\u7387\uff1a\u73b0\u5728\u7684\u7248\u672c\u5728\u505a\u8c03\u5236\u548c\u53d1\u5c04\u65f6\uff0c\u5bf9CPU\u7684\u5360\u7528\u7387\u6bd4\u8f83\u9ad8\u3002\u5982\u679cRaspberry Pi\u6b63\u5728\u5fd9\u4e8e\u505a\u522b\u7684\u4e8b\u60c5\u7684\u8bdd\uff0c\u4f60\u53ef\u80fd\u4f1a\u542c\u5230\u4e00\u4e9b\u6742\u97f3\u6216\u8005\u662f\u5531\u673a\/\u78c1\u5e26\u673a\u6ca1\u7535\u4e86\u7684\u65f6\u5019\u7684\u97f3\u54cd\u6548\u679c\u3002<\/li>\n<\/ul>\n<p>\u5176\u5b9e\u5427\uff0c\u8fd9\u6837\u6536\u542c\u8c46\u74e3FM\u53ef\u771f\u662f\u591a\u6b64\u4e00\u4e3e\u3002\u76f4\u63a5\u628a\u8033\u673a\u63d2\u5728Raspberry\u7684\u8033\u673a\u63d2\u5b54\u7528fmd\u64ad\u653e\u4e0d\u5c31\u5b8c\u4e8b\u4e86\u4e48\u2026\u2026\u5929\u884c\u5065\uff0c\u541b\u5b50\u4ee5\u6298\u817e\u4e0d\u606f\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u60f3\u7528\u5e8a\u5934\u7684\u6536\u97f3\u673a\u6536\u542c\u8c46\u74e3FM\u5417\uff1f\u5982\u679c\u4f60\u6709\u4e00\u53f0Raspberry Pi\uff0c\u8fd9\u4e2a\u613f\u671b\u5c31 &hellip; <a href=\"https:\/\/www.freemindworld.com\/blog\/2013\/130218_douban_fm_with_raspberry_pi.shtml\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[44,42,41,40,43,45],"class_list":["post-1163","post","type-post","status-publish","format-standard","hentry","category-9","tag-linux","tag-pi","tag-raspberry","tag-40","tag-43","tag-45"],"_links":{"self":[{"href":"https:\/\/www.freemindworld.com\/blog\/wp-json\/wp\/v2\/posts\/1163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freemindworld.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freemindworld.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freemindworld.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freemindworld.com\/blog\/wp-json\/wp\/v2\/comments?post=1163"}],"version-history":[{"count":11,"href":"https:\/\/www.freemindworld.com\/blog\/wp-json\/wp\/v2\/posts\/1163\/revisions"}],"predecessor-version":[{"id":1175,"href":"https:\/\/www.freemindworld.com\/blog\/wp-json\/wp\/v2\/posts\/1163\/revisions\/1175"}],"wp:attachment":[{"href":"https:\/\/www.freemindworld.com\/blog\/wp-json\/wp\/v2\/media?parent=1163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freemindworld.com\/blog\/wp-json\/wp\/v2\/categories?post=1163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freemindworld.com\/blog\/wp-json\/wp\/v2\/tags?post=1163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}