OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver...
Transcript of OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver...
![Page 1: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/1.jpg)
LAC2007
OLPC Audio Subsystem
Jaya Kumar
![Page 2: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/2.jpg)
Goals Of This Talk
● talk about hardware● talk about ALSA drivers and OLPC● cs5535audio, AD1888 AC97 driver● talk about issues encountered● talk about applications● talk about future
![Page 3: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/3.jpg)
Disclaimer
● I am not employee of OLPC, Redhat, AMD, Quanta or any OLPC associated company
● no financial relationship● volunteering driver support and beta testing● I am author of cs5535audio and misc bits● impartial developer● happy to help with any inexpensive computing project
![Page 4: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/4.jpg)
Generic Geode/CS5536 architecture
![Page 5: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/5.jpg)
OLPC Audio Architecture
![Page 6: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/6.jpg)
OLPC Hardware
● Getting cost down while maintaining quality means innovative design● Mechanical issues affect audio quality● Examine design to understand whole system better
![Page 7: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/7.jpg)
OLPC Hardware
● Mainboard is behind display
● The thick part is where all of audio lives
● Mic, Speakers, ACC, Codec
![Page 8: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/8.jpg)
Where are the speakers, mic?
![Page 9: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/9.jpg)
The Board
![Page 10: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/10.jpg)
The Mic, Speaker connectors
![Page 11: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/11.jpg)
The Speakers
● Standard speakers● Standard Amps
![Page 12: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/12.jpg)
Intro to OLPC sw environment
● Linux 2.6.19 as of build 239, continuously moving target.
● glibc, Xorg, standard embedded X86 stuff● redhat/olpc build team uses Pilgrim to pull selected rpms to build the OS. like fedora.
● Audio driver development done by using boot from usb and then reflash
![Page 13: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/13.jpg)
More OLPC sw environment
● custom BIOS using LinuxBIOS + OpenFirmware
● important because of VSA (will revisit this)● audio server on OLPC is csound● most apps talk to csound and csound talks to ALSA
![Page 14: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/14.jpg)
What apps run on OLPC
● anything that runs on x86 Linux in a tight 128MB environment with ALSA should work just fine
● currently, TamTam, Squeak eToys, mplayer, quake, etc
![Page 15: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/15.jpg)
Review of ALSA OLPC
● standard ALSA snd_seq*, _pcm, soundcore, etc)
● snd_cs5535audio is the ACC (handling DMA, buffering, etc)
● AD1888 is the AC97 codec (handling rates, channels, amps, mix)
![Page 16: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/16.jpg)
OLPC Quirk 1
● actually, quirk on all Geode/CS553x arch● no PCI config read which means it is faked by BIOS (VSA on traditional Insyde BIOS)
● currently OLPC uses OpenFirmware with a faked config read using an internal device tree
● previously uses VSA built into LinuxBIOS which then used SMI mode to support this
![Page 17: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/17.jpg)
OLPC Driver Work
● Step 1: Added Power Management support● Fairly straight forward● Step 2: Test on board● Problem 1: AC97 read errors (solution: ignore)● Problem 2: AD1888 duplicate controls (trivial fix)
![Page 18: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/18.jpg)
OLPC Driver Work
● Problem 3: Suspend/Resume bug● Solution: Touch the magic register on AD1888● Problem 4: Quirk handling● All Geode/CS5536 share common PCI ID because hardcoded in VSA● Can't identify board● OLPC specific solution: CONFIG_OLPC
![Page 19: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/19.jpg)
OLPC Driver Work
● cs5535audio has CONFIG_OLPC specific _olpc.c to handle quirk
● analog input support● used to perform ADC work on analog input● to use as oscilloscope● eg: Walter Bender photodiode on spoon conductor demo
![Page 20: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/20.jpg)
OLPC Driver Work
● cs5535audio uses x86 port IO to talk to embedded controller to switch input source from standard RC trace to raw trace● also uses AC97 to tell AD1888 to disable V_ref and high pass filter● newer OLPC doesn't use EC anymore. Uses CS5536 gpio directly● exposed via mixer control (“analog input”)
![Page 21: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/21.jpg)
OLPC Driver Work
● Right hand speaker is close to microphone● Feedback effects when in duplex (eg: telephony)● Possible solution? default dmix could disable RHS speaker if detect capture and no jack● Transparent to applications
![Page 22: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/22.jpg)
OLPC Driver Work
● Takashi added aggressive power management code● Useful to further drop power consumption while transparent to applications
![Page 23: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/23.jpg)
Driver Future
● ASOC/DAPM driver work in progress● Gotten as far as starting on soc/codecs/ad1888● Working on machine and platform code● ASOC/DAPM should help even more with power and also possibly the RHS speaker situation
![Page 24: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/24.jpg)
Applications
● Not exactly happy. TamTam people mention performance is not ideal
● xruns due to scheduling issues● Managing Xorg needs for TamTam draw, csound needs for audio
● Possible cache size issues● Renicing TamTam seems to help but not a good solution
![Page 25: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/25.jpg)
Applications
● Still early in development. Tickless kernel, preempt may help things
● Will be interesting once video/telephony apps start running using wireless mesh
● May need significant optimization● ALSA can probably help too. Code size reduction
![Page 26: OLPC Audio Subsystemlac.linuxaudio.org/2007/presentations/lac07_slides_kumar.pdf · OLPC Driver Work cs5535audio uses x86 port IO to talk to embedded controller to switch input source](https://reader034.fdocuments.in/reader034/viewer/2022052015/602d36ea735f100fa07a3c06/html5/thumbnails/26.jpg)
Thanks!
● Thanks for listening. Any and all feedback is always welcome.
● Email is [email protected]