{"id":1941,"date":"2016-09-08T07:40:34","date_gmt":"2016-09-08T06:40:34","guid":{"rendered":"http:\/\/blog.fh-kaernten.at\/ingmarsretro\/?p=1941"},"modified":"2021-01-28T10:03:35","modified_gmt":"2021-01-28T09:03:35","slug":"guter-ton-mit-raspberry-pi","status":"publish","type":"post","link":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/2016\/09\/08\/guter-ton-mit-raspberry-pi\/","title":{"rendered":"Guter Ton mit Raspberry PI"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_1941\" class=\"pvc_stats all  \" data-element-id=\"1941\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p style=\"text-align: justify\">Nach schon einigen Projekten und Versuchen mit dem Raspberry PI, bin ich immer wieder einmal auf die Problematik mit der schlechten, verrauschten Tonqualit\u00e4t des Raspi-Audioausgangs gesto\u00dfen. Der analoge Ton besteht ja nur aus einem einfachen PWM (PulseWidthModulation) Signal, das \u00fcber ein paar Filtercaps direkt an die Klinkenbuchse des Raspberry geschaltet ist. F\u00fcr viele Anwendungen reicht das sicherlich, wenn man nur eben einmal ein paar T\u00f6ne ausgeben will. Soll\u00b4s aber Musik sein, oder wie in meinem Fall ein vern\u00fcnftiger Ton bei der Retro-Gamestation, die mit &#8222;retropie und der EmulationStation&#8220; l\u00e4uft, so reicht die Qualit\u00e4t einfach nicht aus.<\/p>\n<p style=\"text-align: justify\"><a href=\"http:\/\/blog.fh-kaernten.at\/ingmarsretro\/files\/2016\/09\/DSC_2748.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-1946 size-medium alignleft\" src=\"http:\/\/blog.fh-kaernten.at\/ingmarsretro\/files\/2016\/09\/DSC_2748-300x169.jpg\" alt=\"DSC_2748\" width=\"300\" height=\"169\" srcset=\"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/files\/2016\/09\/DSC_2748-300x169.jpg 300w, https:\/\/blog.fh-kaernten.at\/ingmarsretro\/files\/2016\/09\/DSC_2748-768x432.jpg 768w, https:\/\/blog.fh-kaernten.at\/ingmarsretro\/files\/2016\/09\/DSC_2748-1024x576.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>Hier sollte man dem Raspberry PI einen richtigen Soundchip, also Soundkarte verpassen. Im Internet wird man schnell f\u00fcndig und so habe ich mir bei einem Onlineshop um gerade einmal 2,90 Euro eine USB &#8211; Soundkarte bestellt. Die Karte, oder besser, der USB Dongle besitzt zwei 3,5mm Klinkenbuchsen. (einen Audio-Ausgang und einen Mikrofon-Eingang)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Die Installation ist schnell durchgef\u00fchrt. Will man ein bestehendes System umr\u00fcsten, so ist einfach der Klinkenstecker der Lautsprecherzuleitung vom Raspberry abzuziehen und in den Audioausgang des Raspberry einzust\u00f6pseln. Der USB Stecker kommt in einen freien Port des Raspberry.<\/p>\n<p><a href=\"http:\/\/blog.fh-kaernten.at\/ingmarsretro\/files\/2016\/09\/DSC_2751.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-1944 size-medium\" src=\"http:\/\/blog.fh-kaernten.at\/ingmarsretro\/files\/2016\/09\/DSC_2751-300x169.jpg\" alt=\"DSC_2751\" width=\"300\" height=\"169\" srcset=\"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/files\/2016\/09\/DSC_2751-300x169.jpg 300w, https:\/\/blog.fh-kaernten.at\/ingmarsretro\/files\/2016\/09\/DSC_2751-768x432.jpg 768w, https:\/\/blog.fh-kaernten.at\/ingmarsretro\/files\/2016\/09\/DSC_2751-1024x576.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: justify\">Der Hardwareteil ist somit erledigt und es kann mit dem Anpassen der Software begonnen werden. Nach dem Booten der&nbsp;Retropi-Maschine und dem Einloggen in die Konsole kann man \u00fcberpr\u00fcfen, welche Ger\u00e4te am USB-Bus erkannt wurden. Nach der Eingabe von:<\/p>\n<p><b>pi@retropie<\/b>:<b>~ $<\/b> lsusb<\/p>\n<p>werden alle am USB-Bus angeschlossenen Ger\u00e4te gelistet:<\/p>\n<p>Bus 001 Device 007: ID 1516:1603 CompUSA Flash Drive<br \/>\nBus 001 Device 006: ID 03f0:034a Hewlett-Packard<br \/>\nBus 001 Device 005: ID 16c0:05e1 Van Ooijen Technische Informatica Free shared USB VID\/PID pair for CDC devices<br \/>\nBus 001 Device 004: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller<br \/>\nBus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512\/9514 Fast Ethernet Adapter<br \/>\nBus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.<br \/>\nBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<\/p>\n<p style=\"text-align: justify\">In diesem Fall ist der C-Media Electronics, Inc. CM108 Audio Controller unsere USB &#8211; Soundkarte. Als n\u00e4chsten Schritt \u00fcberpr\u00fcft man die Reihenfolge (Priorit\u00e4t) der geladenen Soundmodule.<\/p>\n<p><b>pi@retropie<\/b>:<b>~ $<\/b> cat \/proc\/asound\/modules<\/p>\n<p>Als Ergebnis kommt:<\/p>\n<p>0 snd_bcm2835<br \/>\n1 snd_usb_audio<\/p>\n<p style=\"text-align: justify\">Das bedeutet die Soundausgabe des BCM2835 ist als erstes gelistet. Wir wollen jedoch alle Tonausgaben \u00fcber den USB-Ausgang h\u00f6ren. Dazu muss die Datei &#8222;alsa-base.conf&#8220; wie folgt angelegt werden. (auf einigen Systemen ist sie bereits vorhanden &#8211; hier sind dann nur die Priorit\u00e4ten anzupassen)<\/p>\n<p><b>pi@retropie<\/b>:<b>~ $<\/b> sudo nano \/etc\/modprobe.d\/alsa-base.conf<\/p>\n<p style=\"text-align: justify\">Falls jetzt ein leeres Script \u00f6ffnet, hat die .conf-Datei noch nicht existiert und man muss die folgenden Zeilen eingeben:<\/p>\n<p>options snd_usb_audio index=0<br \/>\noptions snd_bcm2835 index=1<br \/>\noptions snd slots=snd-usb-audio,snd-bcm2835<\/p>\n<p style=\"text-align: justify\">Mit &#8222;control+O&#8220; wird gespeichert und mit &#8222;control+X&#8220; kann der Editor beendet werden. Jetzt ist das System zu rebooten. Nach dem Neustart kann in der Konsole nochmals mit:<\/p>\n<p><b>pi@retropie<\/b>:<b>~ $<\/b>&nbsp;cat \/proc\/asound\/modules<\/p>\n<p>die Reihenfolge der Module \u00fcberpr\u00fcft werden. Die sollte jetzt so aussehen:<\/p>\n<p>0 snd_usb_audio<br \/>\n1 snd_bcm2835<\/p>\n<p style=\"text-align: justify\">Jetzt sollten in der Emulationstation wieder T\u00f6ne zu h\u00f6ren sein. Diesmal aber ohne Rauschen und kristallklar \ud83d\ude00<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_1941\" class=\"pvc_stats all  \" data-element-id=\"1941\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>Nach schon einigen Projekten und Versuchen mit dem Raspberry PI, bin ich immer wieder einmal auf die Problematik mit der schlechten, verrauschten Tonqualit\u00e4t des Raspi-Audioausgangs gesto\u00dfen. Der analoge Ton besteht ja nur aus einem einfachen PWM (PulseWidthModulation) Signal, das \u00fcber ein paar Filtercaps direkt an die Klinkenbuchse des Raspberry geschaltet ist. F\u00fcr viele Anwendungen reicht&hellip; <br \/> <a class=\"read-more\" href=\"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/2016\/09\/08\/guter-ton-mit-raspberry-pi\/\">Weiterlesen<\/a><\/p>\n","protected":false},"author":86,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[57,1186],"tags":[568,565,564,292,567,566],"class_list":["post-1941","post","type-post","status-publish","format-standard","hentry","category-elektronikbastler","category-raspberrypi","tag-emulationstation-sound","tag-raspberry-pi-soundchip","tag-raspberry-pi-usb-soundkarte","tag-retropie","tag-retropie-sound","tag-usb-soundkarte"],"a3_pvc":{"activated":true,"total_views":269,"today_views":0},"_links":{"self":[{"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/posts\/1941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/users\/86"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/comments?post=1941"}],"version-history":[{"count":0,"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/posts\/1941\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/media?parent=1941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/categories?post=1941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/tags?post=1941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}