Is it possible to get a PDM audio output on Windows? - Page 1
Forum section: electronics / projects

author: Windows9Professional
author_rank: Contributor
timestamp: April 13, 2019, 03:23:22 pm
content: I'm currently trying to build an IR audio transmitter and reciever. I startet with the reciever, wich I now want to try out. Since I haven't even startet building my transmitter, I want to ''convert'' my computer into a crude transmitter.Is there a way to get PDM (Pulse-density modulation) output on a Windows or Ubuntu PC?Sorry for bad english, if something is pronounced wrong

author: magic
author_rank: Super Contributor
timestamp: April 13, 2019, 03:39:40 pm
content: Automatically for normal audio playback? Not really, all you have on soundcards is analog outputs and SPDIF.But it you have some pulse pattern precomputed in software, it's possible to use interfaces like analog audio jacks or LPT to output it.

author: Windows9Professional
author_rank: Contributor
timestamp: April 13, 2019, 04:00:09 pm
content: I already tried to modulate a track with Audacity, but it seems like, there is no option for that. (There might be one. I'm not very familiar with Audacity). But it would be very relaxing to have some software which converts my normal audio into a PDM signal and then outputs it to the audio jack, so I wouldn't have to build a full transmitter, but just an amplifier.By the way, thank you for your reply!

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 13, 2019, 04:06:23 pm
content: Frankly, given the average 'clock' frequency for a PDM signal for audio frequencies, don't expect to generate the PDM signal directly from a standard PC without a specific interface.Of course, that could be a simple job on a microcontroller if you can do that.IMO, the simplest option is to build a very simple PD modulator like the one attached (first-order modulator). With a reasonably fast comparator, it will give pretty decent performance. Then you can feed it with any audio signal. Just a couple parts. This is a free-running ("clockless") modulator, so you have to figure out whether your demodulator will be OK with that. From simulation, with the given comparator, the average PDM frequency will be around 10MHz or so. You can use a slower comparator for a "slower" PDM output.I've built this kind of modulators quite a few times in the past and they are very simple and work very well for transmitting audio with a decent quality with just one digital line.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 13, 2019, 04:45:16 pm
content: About 30 years ago there was DOS software for using the simple PC speaker with PDM and get pretty usable audio out of it.The PC speaker in that day and age was a single bit connected to a timer chip.Some of the modern PC's still have that hardware, the PC speaker may be an un-occupied jumper on the motherboard somewhere.Modern PC's are also so goddamn fast that they can easily keep up with it even while simultaneously multitasking and doing lots of other things.Writing software for it is a diffent beast though.You may find some usable software somewhere on the 'net, or write it yourself, but unless you have an particular fetish for such things it is much more logical to use a uC for such things.But why bother with PDM at all?USD 1.5 uC's come with I2S and example source code to use it and can have excellent audio qualtiy with little effort.Anecdote:Some years ago I wanted to write some .net progam in C# (Silly me) and I wanted it to make some noise. I thought the simples would be to use that 40 year old speaker to beep at me, and got distracted by some web sites that tried to explain that it was not supported by .net and they had declared that old speaker obsolete. which seemed fair enough.And then a few years ago that same old PC started beeping at me after installing some Linux distribution. It turned out that somewhere on the Mobo a little buzzer was installed which still worked with that same ancient hardware interface.

author: Zero999
author_rank: Super Contributor
timestamp: April 13, 2019, 06:43:54 pm
content: Yes, I remember Windows 3.1 had a PC speaker driver. Unfortunately it would normally freeze the system, whilst playing, so was no good for computer games. I believe some modern motherboards connect the PC speaker's output to the sound card.You could try connecting the LED to the output of the sound card, but I think you need some external hardware to do this properly. A simple microcontroller with USB interface, but I don't have any experience with this so can't help.

author: magic
author_rank: Super Contributor
timestamp: April 13, 2019, 07:00:35 pm
content: Actually, Linux has a driver to use the PC speaker for general purpose (low-fi) audio playback. It doesn't even freeze the systemBut I have no idea how it works and whether it is available in distribution kernels out of the box. It's called snd_pcsp.

author: Zero999
author_rank: Super Contributor
timestamp: April 13, 2019, 09:49:19 pm
content: Quote from: magic on April 13, 2019, 07:00:35 pmThe Windows 3.1 driver freezing the system, whilst playing audio through the PC speaker, was only because the hardware wasn't powerful back then to do anything else at the same time, nothing to do with the shittyness of the operating system.