LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-16-2019, 05:02 PM   #1
bt101
Member
 
Registered: Mar 2008
Posts: 61

Rep: Reputation: 19
PWM Class D Audio Output


Hi - I've been searching the internets for information about linux driving a class-d audio amplifier output stage.

Any information I find about a computer driven class-d audio amp, has the computer generating standard analogue audio and a "complete" class-d amp with analogue inputs. However I am wondering if all of those analogue stages can be eliminated and the computer audio driver simply outputs a digital PWM signal to an FET output stage.

Unless I'm mistaken, it would be simpler to have software go straight from an mp3 to PWM and not have all of those interim analogue stages. Does such an audio driver exist?

I can't seem to find any info, so perhaps I'm using poor search terms.

Thanks
 
Old 10-18-2019, 02:26 AM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,989

Rep: Reputation: 1170Reputation: 1170Reputation: 1170Reputation: 1170Reputation: 1170Reputation: 1170Reputation: 1170Reputation: 1170Reputation: 1170
I don't pretend to know your exact ambitions here, but IMHO you should probably be looking at a hardware design that can take digital output (eg S/PDIF) and build a class D amplifier that can take that digital input stream and do the necessray PWM conversion (which you should understand is essentially an analogue signal). Are you wanting to design/build your own, or purchase some existing digital amplifier?

Last edited by ferrari; 10-18-2019 at 02:29 AM.
 
Old 10-18-2019, 09:49 AM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875
You're going to need a soundcard with your desired output. The AMP is hardware, and not part of the computer. There are interfaces with optical outputs and probably whatever output you're needing.

My setup is a RPi 4B 4GB running a pulseaudio over jackdbus with a calf 30 band EQ plugin. The hardware is a usb soundcard (focusrite 2i2) to analog RCA jacks to a NAD amp to minnie maggie speakers. Having a pulse audio server lets me use the good speakers with any of my computers on the network.
 
Old 10-20-2019, 05:27 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by bt101 View Post
I am wondering if all of those analogue stages can be eliminated and the computer audio driver simply outputs a digital PWM signal to an FET output stage.

Unless I'm mistaken, it would be simpler to have software go straight from an mp3 to PWM and not have all of those interim analogue stages. Does such an audio driver exist?
Simpler maybe - but how would it sound?
 
Old 11-07-2019, 08:00 PM   #5
bt101
Member
 
Registered: Mar 2008
Posts: 61

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by Shadow_7 View Post
You're going to need a soundcard with your desired output. The AMP is hardware, and not part of the computer. There are interfaces with optical outputs and probably whatever output you're needing.

My setup is a RPi 4B 4GB running a pulseaudio over jackdbus with a calf 30 band EQ plugin. The hardware is a usb soundcard (focusrite 2i2) to analog RCA jacks to a NAD amp to minnie maggie speakers. Having a pulse audio server lets me use the good speakers with any of my computers on the network.
Thanks for the replies. Apologies for the delay as I got ill and then forgot about this ;-)
Yes you're right, a typical desktop type computer would need a soundcard to generate the PWM output. The irony is, this type of soundcard would consist of almost nothing compared to a typical soundcard that has analogue stages and/or conversion to optical etc. But yes, I don't expect desktop manufacturers to change any of that soon.

But your example of the RPI is more along the lines of what I was thinking. Just any one of the digital outputs could go straight into a class D amp (no sound card or a bunch of electronics and conversions between). All it needs is a software sound driver.
You mentioned your setup with a USB sound card and analog RCA jacks etc. Yes, I've setup the same thing as you because I found it to be the most cost effective (some of those hifi add-on boards cost more than the pi itself). I know I should write it myself, but I'm just surprised there isn't already a software driver which goes straight to PWM without needing USB, analogue circuits and a bunch of stuff that isn't needed.

BTW - class D amps these days have specs that rival hifi amps and they're cheap :-)
 
Old 11-08-2019, 05:26 AM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875
I grew up with a sanyo mbc-555. On that machine you had to write assembler to toggle the beep speaker/thing to create sound. Basically an ON or OFF setting. Which you did at a certain interval to create any given pitch. No volume control and such. Pissed off brothers and death threats and the likes. Since it was pretty F-ing loud. I was still in Jr. High -ish at the time.

I'm not sure if that's the route you're wanting to take. We have interfaces now. They speak a known language (usb-snd-audio / alsa). With other layers on top of that (jackd / pulseaudio / ...). And various filters (EQ / echo / delay / phasers / and such). My setup basically makes sound an appliance. It's setup on the client machines is as simple as a single file with a one liner. That file is $HOME/.config/pulse/client.conf. It's content is "default-server = 192.168.2.3".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run pwm config nowandnem Linux - Hardware 8 09-16-2015 06:21 AM
Non PWM Laptop Screen Miati Linux - Laptop and Netbook 1 01-12-2015 05:41 AM
PWM Fan Control - Lowering The CPU Fan RPM S3P3HR Linux - Software 1 04-24-2011 05:46 AM
does my bios prohibit pwm/fan control? oxident Linux - Hardware 2 05-10-2009 08:37 AM
PWM Signal jacs Programming 2 10-30-2003 01:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration