SlideShare a Scribd company logo
1 of 19
A Science Project:
Building a sound card based on the Covox Speech Thing
Hackware v2.6 (4 Jan 2016)
By: Yeo Kheng Meng (yeokm1@gmail.com)
https://github.com/yeokm1/pcb-covox
https://github.com/yeokm1/pcb-covox-amp
https://github.com/yeokm1/pcb-covox-amp-v2
https://github.com/yeokm1/covox-music-player
http://yeokhengmeng.com/2017/01/a-science-project-bringing-the-covox-speech-thing-to-2017/
1
Demo
2
Background: Hackware v2.2 (7 Sept 2016)
3
What is the Covox Speech Thing?
• Sound card released in 1986 by Covox, Inc
• 8-bit Mono
• Parallel Port interface
4Image source: https://en.wikipedia.org/wiki/Covox_Speech_Thing
What is a parallel port?
• External Computer interface
• Introduced by Centronics in 1970
• Standardised as IEEE 1284 in 1994
• 8 data lines
• Notable uses:
• Printers
• ZIP drives
• CNC machines
• Obsolete by 2000s 5
DB-25 Connector
Image source: https://en.wikipedia.org/wiki/Parallel_port
How does the Covox Speech Thing work?
• R-2R resistor ladder
• 8-bit Digital-Analog Converter
• Each output adds a voltage step to
the output
• MSB – Data7
• LSB – Data0
• Requires ≤ 1% tolerance resistors
6
LM386 Amplifier
• Amplifies the R-2R signal
• Volume: Voltage divider on original signal
• Gain: Resistor-Capacitor (RC) circuit between Gain pins
• Bass: RC Circuit between Pin1 and output
7
Reference: http://www.circuitbasics.com/build-a-great-sounding-audio-amplifier-with-bass-boost-from-the-lm386/
How do typical sound cards get data?
• Direct Memory Access (DMA)
• PCI/PCI-E devices can access RAM
• DMA Engine in every peripheral
1. CPU -> RAM: Sound Data
2. CPU -> Peripheral DMA Engine: Memory addresses of data to transfer
3. CPU -> Peripheral: Start transfer. CPU can do other things
4. RAM -> Peripheral: Data at memory addresses
5. Peripheral -> CPU: Transfer complete interrupt
• Covox Speech Thing
• Bunch of resistors do not a DMA Engine make
• Entirely CPU-driven
8
CPU
PCI-E Root Complex RAM
PCI-E Device
(Audio)
PCI-E Device
(Network)
DMA Engine DMA Engine
Reference: https://geidav.wordpress.com/2014/04/27/an-overview-of-direct-memory-access/
My implementation
• Covox Speech Thing clone
• LM386 amplifier
• Adjustable via potentiometers
• Volume
• Gain
• Bass
• Raw and Amplified Output
9
Sending data to the Covox Speech Thing
• Native parallel port adapters required
• USB-Parallel adapters
• Abstracts pin handling
10
StarTech Expresscard to Parallel Port StarTech PCI-E x1 to serial-parallel combo
Consistent data send rate
• CD quality
• Bit rate = 16 bits per sample
• Channels = 2 x sample (Stereo)
• Sampling rate = 44100 Hz
• Play time per frame = 1 second / 44100 = 22.68 microseconds
11
A DOS media player
• Written by Martin Rehak in 2007
• Default DOS Interrupt Service Routine(ISR) has 55 millisecond resolution
• Install new timer ISR
• DOS is single-tasking, applications can take control of the entire system
• https://www.youtube.com/watch?v=iOxOxpSg3WE 12
My media player
• Tested on Linux Mint 18 (Ubuntu 16.04)
• Requires address to parallel port
• lspci –v
• cat /proc/ioports | grep parport
• Written in C for maximum performance and ease of API calls
• Prints out frames skipped number
• Frame contains all the samples of channels per unit time 13
Program workflow
1. If the file is not a WAV, call FFMpeg to convert it to WAV
2. Use the libsndfile C library to parse the WAV file
• http://www.mega-nerd.com/libsndfile/
3. Convert each frame to mono uint8_t (1-byte)
4. Write the uint8_t value to the parallel port
5. Go back to Step 3 until the file ends
14
16-bit -> uint8_t
uint8_t
Ensuring a consistent playback
• Calculate the time required to play each frame
• long long nanosecondsPerFrame = 1E9 / sampleRate;
• Run a tight while loop
• Loop until X nanoseconds passes before playing
15
Potential Work
• USB version with FTDI FT245R chip
• USB to 8-channel output
16
What is a “Science Project”?
• By Raymond Chen
• Principal Software Engineer, Microsoft
• Joined 1992
• Runs a blog “Old New Thing”
• Mar 2013 post: https://blogs.msdn.microsoft.com/oldnewthing/20130319-00/?p=4913
17
Raymond Chen image from: http://www.dailytech.com/Microsoft+Exec+Reveals+Steve+Ballmer+Created+Original+Blue+Screen+of+Death+Message/article36512.htm
A Science Project by Raymond Chen
1. A feature that is really cool and challenging from a technological
standpoint but is overkill for the user-scenario.
2. Requires hardware few people have.
3. Trying to solve a problem that nobody really considers to be a
problem. You're doing it just for the Gee Whiz factor.
18Taken from: https://blogs.msdn.microsoft.com/oldnewthing/20130319-00/?p=4913
The End
19
http://yeokhengmeng.com/2017/01/a-science-project-bringing-the-covox-speech-thing-to-2017/

More Related Content

What's hot

BeagleBone Black Using Python
BeagleBone Black Using PythonBeagleBone Black Using Python
BeagleBone Black Using PythonSai Viswanath
 
Internet of things - with routers
Internet of things - with routersInternet of things - with routers
Internet of things - with routersTavish Naruka
 
Espresso Lite v2 - ESP8266 Overview
Espresso Lite v2 - ESP8266 OverviewEspresso Lite v2 - ESP8266 Overview
Espresso Lite v2 - ESP8266 OverviewThe World Bank
 
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans VerkuilKernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans VerkuilAnne Nicolas
 
Product Roadmap iEi 2017
Product Roadmap iEi 2017Product Roadmap iEi 2017
Product Roadmap iEi 2017Andrei Teleanu
 
OSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install EnvironmentOSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install EnvironmentNETWAYS
 
ルータHackで楽しもう! (シプキャン2014 東京大会)
ルータHackで楽しもう! (シプキャン2014 東京大会)ルータHackで楽しもう! (シプキャン2014 東京大会)
ルータHackで楽しもう! (シプキャン2014 東京大会)Takumi Sueda
 
Firmware hacking, slash the pineapple for fun
Firmware hacking, slash the pineapple for funFirmware hacking, slash the pineapple for fun
Firmware hacking, slash the pineapple for funidsecconf
 
Asus 4ta generacion
Asus 4ta generacionAsus 4ta generacion
Asus 4ta generacionjkrm
 
Introduction To The Beagleboard
Introduction To The BeagleboardIntroduction To The Beagleboard
Introduction To The BeagleboardNeHal VeRma
 
nucleus-rm-capture-20x2
nucleus-rm-capture-20x2nucleus-rm-capture-20x2
nucleus-rm-capture-20x2blabadini
 

What's hot (20)

BeagleBone Black Using Python
BeagleBone Black Using PythonBeagleBone Black Using Python
BeagleBone Black Using Python
 
Internet of things - with routers
Internet of things - with routersInternet of things - with routers
Internet of things - with routers
 
Linux kernel system call
Linux kernel system callLinux kernel system call
Linux kernel system call
 
Espresso Lite v2 - ESP8266 Overview
Espresso Lite v2 - ESP8266 OverviewEspresso Lite v2 - ESP8266 Overview
Espresso Lite v2 - ESP8266 Overview
 
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans VerkuilKernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
 
Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
 
Product Roadmap iEi 2017
Product Roadmap iEi 2017Product Roadmap iEi 2017
Product Roadmap iEi 2017
 
OSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install EnvironmentOSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install Environment
 
BeagleBone Workshop
BeagleBone WorkshopBeagleBone Workshop
BeagleBone Workshop
 
ルータHackで楽しもう! (シプキャン2014 東京大会)
ルータHackで楽しもう! (シプキャン2014 東京大会)ルータHackで楽しもう! (シプキャン2014 東京大会)
ルータHackで楽しもう! (シプキャン2014 東京大会)
 
Firmware hacking, slash the pineapple for fun
Firmware hacking, slash the pineapple for funFirmware hacking, slash the pineapple for fun
Firmware hacking, slash the pineapple for fun
 
Asus 4ta generacion
Asus 4ta generacionAsus 4ta generacion
Asus 4ta generacion
 
QNAP Portafolio 2015
QNAP Portafolio 2015QNAP Portafolio 2015
QNAP Portafolio 2015
 
Introduction To The Beagleboard
Introduction To The BeagleboardIntroduction To The Beagleboard
Introduction To The Beagleboard
 
What & How to Customize Android?
What & How to Customize Android?What & How to Customize Android?
What & How to Customize Android?
 
Linux kernel booting
Linux kernel bootingLinux kernel booting
Linux kernel booting
 
Make own you kernel os
Make own you kernel osMake own you kernel os
Make own you kernel os
 
M61 pmv
M61 pmvM61 pmv
M61 pmv
 
nucleus-rm-capture-20x2
nucleus-rm-capture-20x2nucleus-rm-capture-20x2
nucleus-rm-capture-20x2
 
QNAP Selection Guide 2015
QNAP Selection Guide 2015QNAP Selection Guide 2015
QNAP Selection Guide 2015
 

Similar to A Science Project: Building a sound card based on the Covox Speech Thing

A Science Project: Swift Serial Chat
A Science Project: Swift Serial ChatA Science Project: Swift Serial Chat
A Science Project: Swift Serial Chatyeokm1
 
Tracking the International Space Station with Commodore Computers
Tracking the International Space Station with Commodore ComputersTracking the International Space Station with Commodore Computers
Tracking the International Space Station with Commodore ComputersLeif Bloomquist
 
Gears of Perforce: AAA Game Development Challenges
Gears of Perforce: AAA Game Development ChallengesGears of Perforce: AAA Game Development Challenges
Gears of Perforce: AAA Game Development ChallengesPerforce
 
Using IT Equipment in Live Broadcast
Using IT Equipment in Live BroadcastUsing IT Equipment in Live Broadcast
Using IT Equipment in Live BroadcastKieran Kunhya
 
VChat | Audio based public chat terminal with automated login
VChat | Audio based public chat terminal with automated loginVChat | Audio based public chat terminal with automated login
VChat | Audio based public chat terminal with automated loginShambavi Krishnamurthi
 
Building the ZoomFloppy (ECCC 2010)
Building the ZoomFloppy (ECCC 2010)Building the ZoomFloppy (ECCC 2010)
Building the ZoomFloppy (ECCC 2010)Nate Lawson
 
WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022Lorenzo Miniero
 
IPv4 IPv6 Multi Protocol Media Player
IPv4 IPv6 Multi  Protocol Media PlayerIPv4 IPv6 Multi  Protocol Media Player
IPv4 IPv6 Multi Protocol Media PlayerMasaaki Nabeshima
 
London Video Tech - Adventures in cutting every last millisecond from glass-t...
London Video Tech - Adventures in cutting every last millisecond from glass-t...London Video Tech - Adventures in cutting every last millisecond from glass-t...
London Video Tech - Adventures in cutting every last millisecond from glass-t...Kieran Kunhya
 
Computer architecture
Computer architectureComputer architecture
Computer architectureRishabha Garg
 
Janus + Audio @ Open Source World
Janus + Audio @ Open Source WorldJanus + Audio @ Open Source World
Janus + Audio @ Open Source WorldLorenzo Miniero
 
Criteo Labs Infrastructure Tech Talk Meetup Nov. 7
Criteo Labs Infrastructure Tech Talk Meetup Nov. 7Criteo Labs Infrastructure Tech Talk Meetup Nov. 7
Criteo Labs Infrastructure Tech Talk Meetup Nov. 7Shuo LI
 
Sonifex netlog-dscribe-products
Sonifex netlog-dscribe-productsSonifex netlog-dscribe-products
Sonifex netlog-dscribe-productsRadikal Ltd.
 
Challenges and experiences with IPTV from a network point of view
Challenges and experiences with IPTV from a network point of viewChallenges and experiences with IPTV from a network point of view
Challenges and experiences with IPTV from a network point of viewbrouer
 
GamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming SystemGamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming SystemAcademia Sinica
 
Mp So C 18 Apr
Mp So C 18 AprMp So C 18 Apr
Mp So C 18 AprFNian
 
Presentation for architecture
Presentation for architecturePresentation for architecture
Presentation for architectureShamim Hossain
 
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)Chris Adamson
 
KazooCon 2014 - WebRTC
KazooCon 2014 - WebRTCKazooCon 2014 - WebRTC
KazooCon 2014 - WebRTC2600Hz
 

Similar to A Science Project: Building a sound card based on the Covox Speech Thing (20)

A Science Project: Swift Serial Chat
A Science Project: Swift Serial ChatA Science Project: Swift Serial Chat
A Science Project: Swift Serial Chat
 
Tracking the International Space Station with Commodore Computers
Tracking the International Space Station with Commodore ComputersTracking the International Space Station with Commodore Computers
Tracking the International Space Station with Commodore Computers
 
Gears of Perforce: AAA Game Development Challenges
Gears of Perforce: AAA Game Development ChallengesGears of Perforce: AAA Game Development Challenges
Gears of Perforce: AAA Game Development Challenges
 
838511959.pptx
838511959.pptx838511959.pptx
838511959.pptx
 
Using IT Equipment in Live Broadcast
Using IT Equipment in Live BroadcastUsing IT Equipment in Live Broadcast
Using IT Equipment in Live Broadcast
 
VChat | Audio based public chat terminal with automated login
VChat | Audio based public chat terminal with automated loginVChat | Audio based public chat terminal with automated login
VChat | Audio based public chat terminal with automated login
 
Building the ZoomFloppy (ECCC 2010)
Building the ZoomFloppy (ECCC 2010)Building the ZoomFloppy (ECCC 2010)
Building the ZoomFloppy (ECCC 2010)
 
WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022
 
IPv4 IPv6 Multi Protocol Media Player
IPv4 IPv6 Multi  Protocol Media PlayerIPv4 IPv6 Multi  Protocol Media Player
IPv4 IPv6 Multi Protocol Media Player
 
London Video Tech - Adventures in cutting every last millisecond from glass-t...
London Video Tech - Adventures in cutting every last millisecond from glass-t...London Video Tech - Adventures in cutting every last millisecond from glass-t...
London Video Tech - Adventures in cutting every last millisecond from glass-t...
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Janus + Audio @ Open Source World
Janus + Audio @ Open Source WorldJanus + Audio @ Open Source World
Janus + Audio @ Open Source World
 
Criteo Labs Infrastructure Tech Talk Meetup Nov. 7
Criteo Labs Infrastructure Tech Talk Meetup Nov. 7Criteo Labs Infrastructure Tech Talk Meetup Nov. 7
Criteo Labs Infrastructure Tech Talk Meetup Nov. 7
 
Sonifex netlog-dscribe-products
Sonifex netlog-dscribe-productsSonifex netlog-dscribe-products
Sonifex netlog-dscribe-products
 
Challenges and experiences with IPTV from a network point of view
Challenges and experiences with IPTV from a network point of viewChallenges and experiences with IPTV from a network point of view
Challenges and experiences with IPTV from a network point of view
 
GamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming SystemGamingAnywhere: An Open Cloud Gaming System
GamingAnywhere: An Open Cloud Gaming System
 
Mp So C 18 Apr
Mp So C 18 AprMp So C 18 Apr
Mp So C 18 Apr
 
Presentation for architecture
Presentation for architecturePresentation for architecture
Presentation for architecture
 
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
 
KazooCon 2014 - WebRTC
KazooCon 2014 - WebRTCKazooCon 2014 - WebRTC
KazooCon 2014 - WebRTC
 

More from yeokm1

I became a Private Pilot and this is my story
I became a Private Pilot and this is my storyI became a Private Pilot and this is my story
I became a Private Pilot and this is my storyyeokm1
 
What's inside a Cessna 172 and flying a light plane
What's inside a Cessna 172 and flying a light planeWhat's inside a Cessna 172 and flying a light plane
What's inside a Cessna 172 and flying a light planeyeokm1
 
Speaking at Tech meetups/conferences for Junior Devs
Speaking at Tech meetups/conferences for Junior DevsSpeaking at Tech meetups/conferences for Junior Devs
Speaking at Tech meetups/conferences for Junior Devsyeokm1
 
Reflections on Trusting Trust for Go
Reflections on Trusting Trust for GoReflections on Trusting Trust for Go
Reflections on Trusting Trust for Goyeokm1
 
Meltdown and Spectre
Meltdown and SpectreMeltdown and Spectre
Meltdown and Spectreyeokm1
 
BLE Localiser (Full) for iOS Dev Scout
BLE Localiser (Full) for iOS Dev ScoutBLE Localiser (Full) for iOS Dev Scout
BLE Localiser (Full) for iOS Dev Scoutyeokm1
 
BLE Localiser for iOS Conf SG 2017
BLE Localiser for iOS Conf SG 2017BLE Localiser for iOS Conf SG 2017
BLE Localiser for iOS Conf SG 2017yeokm1
 
Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
 Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiteryeokm1
 
PCB Business Card (Singapore Power)
PCB Business Card (Singapore Power)PCB Business Card (Singapore Power)
PCB Business Card (Singapore Power)yeokm1
 
SP Auto Door Unlocker
SP Auto Door UnlockerSP Auto Door Unlocker
SP Auto Door Unlockeryeokm1
 
SP IoT Doorbell
SP IoT DoorbellSP IoT Doorbell
SP IoT Doorbellyeokm1
 
Distance Machine Locker
Distance Machine LockerDistance Machine Locker
Distance Machine Lockeryeokm1
 
The slide rule
The slide ruleThe slide rule
The slide ruleyeokm1
 
Repair Kopitiam Circuit Breaker Training
Repair Kopitiam Circuit Breaker TrainingRepair Kopitiam Circuit Breaker Training
Repair Kopitiam Circuit Breaker Trainingyeokm1
 
A2: Analog Malicious Hardware
A2: Analog Malicious HardwareA2: Analog Malicious Hardware
A2: Analog Malicious Hardwareyeokm1
 
Getting Started with Raspberry Pi
Getting Started with Raspberry PiGetting Started with Raspberry Pi
Getting Started with Raspberry Piyeokm1
 
My Life as a Maker
My Life as a MakerMy Life as a Maker
My Life as a Makeryeokm1
 
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huang
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' HuangTalk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huang
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huangyeokm1
 
Repair Kopitiam Specialty Electrical Equipment
Repair Kopitiam Specialty Electrical EquipmentRepair Kopitiam Specialty Electrical Equipment
Repair Kopitiam Specialty Electrical Equipmentyeokm1
 
Intel Edison: Beyond the Breadboard
Intel Edison: Beyond the BreadboardIntel Edison: Beyond the Breadboard
Intel Edison: Beyond the Breadboardyeokm1
 

More from yeokm1 (20)

I became a Private Pilot and this is my story
I became a Private Pilot and this is my storyI became a Private Pilot and this is my story
I became a Private Pilot and this is my story
 
What's inside a Cessna 172 and flying a light plane
What's inside a Cessna 172 and flying a light planeWhat's inside a Cessna 172 and flying a light plane
What's inside a Cessna 172 and flying a light plane
 
Speaking at Tech meetups/conferences for Junior Devs
Speaking at Tech meetups/conferences for Junior DevsSpeaking at Tech meetups/conferences for Junior Devs
Speaking at Tech meetups/conferences for Junior Devs
 
Reflections on Trusting Trust for Go
Reflections on Trusting Trust for GoReflections on Trusting Trust for Go
Reflections on Trusting Trust for Go
 
Meltdown and Spectre
Meltdown and SpectreMeltdown and Spectre
Meltdown and Spectre
 
BLE Localiser (Full) for iOS Dev Scout
BLE Localiser (Full) for iOS Dev ScoutBLE Localiser (Full) for iOS Dev Scout
BLE Localiser (Full) for iOS Dev Scout
 
BLE Localiser for iOS Conf SG 2017
BLE Localiser for iOS Conf SG 2017BLE Localiser for iOS Conf SG 2017
BLE Localiser for iOS Conf SG 2017
 
Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
 Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
 
PCB Business Card (Singapore Power)
PCB Business Card (Singapore Power)PCB Business Card (Singapore Power)
PCB Business Card (Singapore Power)
 
SP Auto Door Unlocker
SP Auto Door UnlockerSP Auto Door Unlocker
SP Auto Door Unlocker
 
SP IoT Doorbell
SP IoT DoorbellSP IoT Doorbell
SP IoT Doorbell
 
Distance Machine Locker
Distance Machine LockerDistance Machine Locker
Distance Machine Locker
 
The slide rule
The slide ruleThe slide rule
The slide rule
 
Repair Kopitiam Circuit Breaker Training
Repair Kopitiam Circuit Breaker TrainingRepair Kopitiam Circuit Breaker Training
Repair Kopitiam Circuit Breaker Training
 
A2: Analog Malicious Hardware
A2: Analog Malicious HardwareA2: Analog Malicious Hardware
A2: Analog Malicious Hardware
 
Getting Started with Raspberry Pi
Getting Started with Raspberry PiGetting Started with Raspberry Pi
Getting Started with Raspberry Pi
 
My Life as a Maker
My Life as a MakerMy Life as a Maker
My Life as a Maker
 
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huang
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' HuangTalk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huang
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huang
 
Repair Kopitiam Specialty Electrical Equipment
Repair Kopitiam Specialty Electrical EquipmentRepair Kopitiam Specialty Electrical Equipment
Repair Kopitiam Specialty Electrical Equipment
 
Intel Edison: Beyond the Breadboard
Intel Edison: Beyond the BreadboardIntel Edison: Beyond the Breadboard
Intel Edison: Beyond the Breadboard
 

Recently uploaded

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

A Science Project: Building a sound card based on the Covox Speech Thing

  • 1. A Science Project: Building a sound card based on the Covox Speech Thing Hackware v2.6 (4 Jan 2016) By: Yeo Kheng Meng (yeokm1@gmail.com) https://github.com/yeokm1/pcb-covox https://github.com/yeokm1/pcb-covox-amp https://github.com/yeokm1/pcb-covox-amp-v2 https://github.com/yeokm1/covox-music-player http://yeokhengmeng.com/2017/01/a-science-project-bringing-the-covox-speech-thing-to-2017/ 1
  • 3. Background: Hackware v2.2 (7 Sept 2016) 3
  • 4. What is the Covox Speech Thing? • Sound card released in 1986 by Covox, Inc • 8-bit Mono • Parallel Port interface 4Image source: https://en.wikipedia.org/wiki/Covox_Speech_Thing
  • 5. What is a parallel port? • External Computer interface • Introduced by Centronics in 1970 • Standardised as IEEE 1284 in 1994 • 8 data lines • Notable uses: • Printers • ZIP drives • CNC machines • Obsolete by 2000s 5 DB-25 Connector Image source: https://en.wikipedia.org/wiki/Parallel_port
  • 6. How does the Covox Speech Thing work? • R-2R resistor ladder • 8-bit Digital-Analog Converter • Each output adds a voltage step to the output • MSB – Data7 • LSB – Data0 • Requires ≤ 1% tolerance resistors 6
  • 7. LM386 Amplifier • Amplifies the R-2R signal • Volume: Voltage divider on original signal • Gain: Resistor-Capacitor (RC) circuit between Gain pins • Bass: RC Circuit between Pin1 and output 7 Reference: http://www.circuitbasics.com/build-a-great-sounding-audio-amplifier-with-bass-boost-from-the-lm386/
  • 8. How do typical sound cards get data? • Direct Memory Access (DMA) • PCI/PCI-E devices can access RAM • DMA Engine in every peripheral 1. CPU -> RAM: Sound Data 2. CPU -> Peripheral DMA Engine: Memory addresses of data to transfer 3. CPU -> Peripheral: Start transfer. CPU can do other things 4. RAM -> Peripheral: Data at memory addresses 5. Peripheral -> CPU: Transfer complete interrupt • Covox Speech Thing • Bunch of resistors do not a DMA Engine make • Entirely CPU-driven 8 CPU PCI-E Root Complex RAM PCI-E Device (Audio) PCI-E Device (Network) DMA Engine DMA Engine Reference: https://geidav.wordpress.com/2014/04/27/an-overview-of-direct-memory-access/
  • 9. My implementation • Covox Speech Thing clone • LM386 amplifier • Adjustable via potentiometers • Volume • Gain • Bass • Raw and Amplified Output 9
  • 10. Sending data to the Covox Speech Thing • Native parallel port adapters required • USB-Parallel adapters • Abstracts pin handling 10 StarTech Expresscard to Parallel Port StarTech PCI-E x1 to serial-parallel combo
  • 11. Consistent data send rate • CD quality • Bit rate = 16 bits per sample • Channels = 2 x sample (Stereo) • Sampling rate = 44100 Hz • Play time per frame = 1 second / 44100 = 22.68 microseconds 11
  • 12. A DOS media player • Written by Martin Rehak in 2007 • Default DOS Interrupt Service Routine(ISR) has 55 millisecond resolution • Install new timer ISR • DOS is single-tasking, applications can take control of the entire system • https://www.youtube.com/watch?v=iOxOxpSg3WE 12
  • 13. My media player • Tested on Linux Mint 18 (Ubuntu 16.04) • Requires address to parallel port • lspci –v • cat /proc/ioports | grep parport • Written in C for maximum performance and ease of API calls • Prints out frames skipped number • Frame contains all the samples of channels per unit time 13
  • 14. Program workflow 1. If the file is not a WAV, call FFMpeg to convert it to WAV 2. Use the libsndfile C library to parse the WAV file • http://www.mega-nerd.com/libsndfile/ 3. Convert each frame to mono uint8_t (1-byte) 4. Write the uint8_t value to the parallel port 5. Go back to Step 3 until the file ends 14 16-bit -> uint8_t uint8_t
  • 15. Ensuring a consistent playback • Calculate the time required to play each frame • long long nanosecondsPerFrame = 1E9 / sampleRate; • Run a tight while loop • Loop until X nanoseconds passes before playing 15
  • 16. Potential Work • USB version with FTDI FT245R chip • USB to 8-channel output 16
  • 17. What is a “Science Project”? • By Raymond Chen • Principal Software Engineer, Microsoft • Joined 1992 • Runs a blog “Old New Thing” • Mar 2013 post: https://blogs.msdn.microsoft.com/oldnewthing/20130319-00/?p=4913 17 Raymond Chen image from: http://www.dailytech.com/Microsoft+Exec+Reveals+Steve+Ballmer+Created+Original+Blue+Screen+of+Death+Message/article36512.htm
  • 18. A Science Project by Raymond Chen 1. A feature that is really cool and challenging from a technological standpoint but is overkill for the user-scenario. 2. Requires hardware few people have. 3. Trying to solve a problem that nobody really considers to be a problem. You're doing it just for the Gee Whiz factor. 18Taken from: https://blogs.msdn.microsoft.com/oldnewthing/20130319-00/?p=4913