{"id":14,"date":"2007-10-29T14:02:09","date_gmt":"2007-10-29T12:02:09","guid":{"rendered":"http:\/\/hampelratte.org\/blog\/?p=14"},"modified":"2007-10-29T14:02:09","modified_gmt":"2007-10-29T12:02:09","slug":"alsa-uber-spdif-mit-mikrofon-und-dmix","status":"publish","type":"post","link":"https:\/\/www.hampelratte.org\/blog\/?p=14","title":{"rendered":"Alsa \u00fcber SPDIF mit Mikrofon und dmix"},"content":{"rendered":"<p>Mein neues Mainboard GigaByte P35-DS3L hat zwei SPDIF-Ausg\u00e4nge, welche ALSA nicht standardm\u00e4ssig nutzt. Ich habe mir also mal die M\u00fche gemacht, den digitalen Ausgang an den Start zu bringen. Zus\u00e4tzlich sollte auch Softwaremixing funktionieren, damit mehrere Audiostreams gleichzeitig wiedergegeben werden k\u00f6nnen und auch das Mikro sollte funktionieren.  Auf dem Board sitzt eine Intel HD Audio &#8222;Karte&#8220; mit einem Realtek ALC 888 Chipsatz. Das ergibt folgende Kernelkonfiguration:<br \/>\n<br \/>\n<a title=\"Alsa Kernel Config 1\" href=\"http:\/\/www.hampelratte.org\/blog\/wp-content\/uploads\/2007\/11\/kernel1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.hampelratte.org\/blog\/wp-content\/uploads\/2007\/11\/kernel1-150x150.jpg\" alt=\"Alsa Kernel Config 1\" \/><\/a> <a title=\"Alsa Kernel Config 2\" href=\"http:\/\/www.hampelratte.org\/blog\/wp-content\/uploads\/2007\/11\/kernel2.jpg\"><img decoding=\"async\" src=\"http:\/\/www.hampelratte.org\/blog\/wp-content\/uploads\/2007\/11\/kernel2-150x150.jpg\" alt=\"Alsa Kernel Config 2\" \/><\/a><br \/>\n<br \/>\nWie man sieht, hab ich unter PCI-Devices nur Intel HD Audio als Modul ausgew\u00e4hlt. Um den Sound beim Systemstart hochzufahren m\u00fcssen die Module geladen werden. Meine <em>\/etc\/modules.autoload.d\/kernel-2.6<\/em> sieht folgendermassen aus:<\/p>\n<p><code>snd-hda-intel<br \/>\nsnd-seq-device<br \/>\nsnd-pcm-oss<br \/>\n<\/code><\/p>\n<p>Wenn die Module geladen wurden kann man mal mit <em>aplay -l<\/em> und <em>aplay -L<\/em> schauen, was die Soundkarte so hergibt: <code>henni@henni ~ $ aplay -l<br \/>\n**** List of PLAYBACK Hardware Devices ****<br \/>\ncard 0: Intel [HDA Intel], device 0: ALC883 Analog [ALC883 Analog]<br \/>\n  Subdevices: 1\/1<br \/>\n  Subdevice #0: subdevice #0<br \/>\ncard 0: Intel [HDA Intel], device 1: ALC883 Digital [ALC883 Digital]<br \/>\n  Subdevices: 0\/1<br \/>\n  Subdevice #0: subdevice #0<\/code><\/p>\n<p><code>henni@henni ~ $ aplay -L<br \/>\nfront:CARD=Intel,DEV=0<br \/>\n    HDA Intel, ALC883 Analog<br \/>\n    Front speakers<br \/>\nsurround40:CARD=Intel,DEV=0<br \/>\n    HDA Intel, ALC883 Analog<br \/>\n    4.0 Surround output to Front and Rear speakers<br \/>\nsurround41:CARD=Intel,DEV=0<br \/>\n    HDA Intel, ALC883 Analog<br \/>\n    4.1 Surround output to Front, Rear and Subwoofer speakers<br \/>\nsurround50:CARD=Intel,DEV=0<br \/>\n    HDA Intel, ALC883 Analog<br \/>\n    5.0 Surround output to Front, Center and Rear speakers<br \/>\nsurround51:CARD=Intel,DEV=0<br \/>\n    HDA Intel, ALC883 Analog<br \/>\n    5.1 Surround output to Front, Center, Rear and Subwoofer speakers<br \/>\nsurround71:CARD=Intel,DEV=0<br \/>\n    HDA Intel, ALC883 Analog<br \/>\n    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers<br \/>\niec958:CARD=Intel,DEV=0<br \/>\n    HDA Intel, ALC883 Digital<br \/>\n    IEC958 (S\/PDIF) Digital Audio Output<br \/>\nnull<br \/>\n    Discard all samples (playback) or generate zero samples (capture)<\/code><\/p>\n<p>Man sieht, dass die Karte zwei Ger\u00e4te hat. Ein analoges und ein digitales. Das digitale Ger\u00e4t ist zu finden unter <em>card 0<\/em> \/ <em>device 1<\/em>. Das werden wir jetzt in unsere <em>~\/.asoundrc<\/em> einflechten:<\/p>\n<p><code>henni@henni ~ $ cat .asoundrc<br \/>\npcm.!default {<br \/>\n    type plug<br \/>\n    slave.pcm \"mic\"<br \/>\n}<\/p>\n<p># this is needed for the mic<br \/>\npcm.card0 {<br \/>\n    type hw<br \/>\n    card 0<br \/>\n}<\/p>\n<p># this enables the mic<br \/>\npcm.mic {<br \/>\n    type asym<br \/>\n    playback.pcm \"dmixer\"<br \/>\n    capture.pcm \"card0\"<br \/>\n}<\/p>\n<p># dmix output over spdif<br \/>\npcm.dmixer {<br \/>\n    type dmix<br \/>\n    ipc_key 1024          # must be unique!<br \/>\n    ipc_perm 0660         # sound for everybody (at least in your group)<br \/>\n    slave {<br \/>\n        pcm \"hw:0,1\"<br \/>\n        channels 6<br \/>\n        period_time 0<br \/>\n        period_size 512<br \/>\n        buffer_time 0<br \/>\n        buffer_size 4096<br \/>\n    }<\/p>\n<p>    bindings {<br \/>\n        0 0   # map from 0 to 0<br \/>\n        1 1   # map from 1 to 1<br \/>\n    }<br \/>\n}<\/code><\/p>\n<p>Zum Schluss muss man noch den Mixer einstellen, damit auch tats\u00e4chlich Sound kommt:<br \/>\n<a title=\"Alsamixer Playback\" href=\"http:\/\/www.hampelratte.org\/blog\/wp-content\/uploads\/2007\/10\/playback.jpg\"><img decoding=\"async\" src=\"http:\/\/www.hampelratte.org\/blog\/wp-content\/uploads\/2007\/10\/playback-150x150.jpg\" alt=\"Alsamixer Playback\" \/><\/a> <a title=\"Alsamixer Capture\" href=\"http:\/\/www.hampelratte.org\/blog\/wp-content\/uploads\/2007\/10\/capture.jpg\"><img decoding=\"async\" src=\"http:\/\/www.hampelratte.org\/blog\/wp-content\/uploads\/2007\/10\/capture-150x150.jpg\" alt=\"Alsamixer Capture\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mein neues Mainboard GigaByte P35-DS3L hat zwei SPDIF-Ausg\u00e4nge, welche ALSA nicht standardm\u00e4ssig nutzt. Ich habe mir also mal die M\u00fche gemacht, den digitalen Ausgang an den Start zu bringen. Zus\u00e4tzlich sollte auch Softwaremixing funktionieren, damit mehrere Audiostreams gleichzeitig wiedergegeben werden k\u00f6nnen und auch das Mikro sollte funktionieren. Auf dem Board sitzt eine Intel HD Audio [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-14","post","type-post","status-publish","format-standard","hentry","category-gentoolinux"],"_links":{"self":[{"href":"https:\/\/www.hampelratte.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hampelratte.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hampelratte.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hampelratte.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hampelratte.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14"}],"version-history":[{"count":1,"href":"https:\/\/www.hampelratte.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/14\/revisions"}],"predecessor-version":[{"id":29,"href":"https:\/\/www.hampelratte.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/14\/revisions\/29"}],"wp:attachment":[{"href":"https:\/\/www.hampelratte.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hampelratte.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hampelratte.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}