LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-15-2018, 07:24 PM   #1
dylanrhodes0
LQ Newbie
 
Registered: Jun 2018
Posts: 15

Rep: Reputation: Disabled
Control multiple audio levels and where they output


Sorry if the title is not great, I had no idea how to word it really.

Here is what I need help with:

I need to take a signal from an ADC which is hooked up to a pi. (0-1023)
I need to (possibly) do math since the source is linear, and I may want it to be log since it will be controlling audio.
I need that signal, to control the audio level of a specific channel (so not the main/default device, but a different, specific channel) on the pi.

In addition, I need to be able to change what output device, an input is sent to. Example, input 1 I may want to go to only output 1. But input 2 I may want to go to both output 1 and 2.

All of this is on the Pi. All of this is software control. None of this is hardware mixing. There is no hardware mixer. Do not worry about mics, speakers, or trying to reinvent my wheel. I have already figured out what I want, and what I need. I know how traditional audio works. I know how audio over IP works. I do NOT know how to interact with an audio program on Linux to control the volume of a specific channel, using a number given to me by an ADC.

Last edited by dylanrhodes0; 06-17-2018 at 04:33 AM. Reason: People not understanding what I need help with and offering help that is very much not needed.
 
Old 06-15-2018, 07:49 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
A web search for "create soundboard linux" turns up some interesting results.

Here's one: https://makezine.com/projects/make-3...le-soundboard/
 
Old 06-15-2018, 08:52 PM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Pulseaudio has a per application level thing. I tend to run pulse over jack on a 2 channel interface. Which can tax a pi significantly if you start adding EQ and other effects via calf plugins. With my current speakers I have to lower the levels before output to prevent distortions. Probably the interface TBH. Pulse basically routes (qjackctl) to jack_mixer to lower the levels 32dB. Before outputting to jackd (jackdbus). But there's a headphone preamp and an amplified stereo in between the interface and the speakers. It sounds more like you are trying to accomplish this with mostly hardware though. Sound can have a lot of bandwidth, and even without much processing, it can add up when dealing with 7 channels. Even on a beefy RPi 3B+. I basically cannot do the 30 band EQ from calf on the pi. And even 20 band is problematic in < 24 hours. But no issues so far with just jack_mixer. And a month plus with the 30 band EQ on a quad core HP with 8GB RAM. At which point the flakey ethernet port gets in the way on that hardware.
 
Old 06-15-2018, 08:57 PM   #4
dylanrhodes0
LQ Newbie
 
Registered: Jun 2018
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by frankbell View Post
A web search for "create soundboard linux" turns up some interesting results.

Here's one: https://makezine.com/projects/make-3...le-soundboard/
Why yes it does...hm...I am looking into it. Thanks!
 
Old 06-15-2018, 09:02 PM   #5
dylanrhodes0
LQ Newbie
 
Registered: Jun 2018
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Shadow_7 View Post
Pulseaudio has a per application level thing. I tend to run pulse over jack on a 2 channel interface. Which can tax a pi significantly if you start adding EQ and other effects via calf plugins. With my current speakers I have to lower the levels before output to prevent distortions. Probably the interface TBH. Pulse basically routes (qjackctl) to jack_mixer to lower the levels 32dB. Before outputting to jackd (jackdbus). But there's a headphone preamp and an amplified stereo in between the interface and the speakers. It sounds more like you are trying to accomplish this with mostly hardware though. Sound can have a lot of bandwidth, and even without much processing, it can add up when dealing with 7 channels. Even on a beefy RPi 3B+. I basically cannot do the 30 band EQ from calf on the pi. And even 20 band is problematic in < 24 hours. But no issues so far with just jack_mixer. And a month plus with the 30 band EQ on a quad core HP with 8GB RAM. At which point the flakey ethernet port gets in the way on that hardware.
I have been informed of calf plugins, and the only thing that I would do is normalize it. I am not THAT much of an audiophile to do crazy things...yet. As long as it sounds good, I am happy. Maybe later on I will look at getting a beefier computer to do the processing using calf plugins. But for now, I just want to control the volume of a channel using a hardware interface, like you said. And it sounds like I also want to route channels to the desired output.
 
Old 06-16-2018, 03:10 AM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I simply can't understand how it would be possible. There is no external interface to the sound chip.
 
Old 06-16-2018, 03:35 AM   #7
dylanrhodes0
LQ Newbie
 
Registered: Jun 2018
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AwesomeMachine View Post
I simply can't understand how it would be possible. There is no external interface to the sound chip.
I don't quite understand what you mean. Care to elaborate a little bit? I've seen every aspect of what I want to work. Granted it wasn't with a raspberry pi, rather it was an expensive console board (like ones from Telos/Axia). And for remote volume control, Oxmoor DCA-2/DCA-2T does exactly what I am looking to do, except it deals with changing actual audio levels. And I have found stuff for changing audio levels via code in windows at least. So I don't see what part of it is not possible...

Last edited by dylanrhodes0; 06-16-2018 at 10:46 AM. Reason: Had a typo
 
Old 06-16-2018, 05:51 PM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Sounds like a standard mixer TBH. But those generally have cables to a soundcard / interface. Some have interfaces built in.

http://mackie.com/products/profxv2-series
 
Old 06-16-2018, 06:12 PM   #9
dylanrhodes0
LQ Newbie
 
Registered: Jun 2018
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Shadow_7 View Post
Sounds like a standard mixer TBH. But those generally have cables to a soundcard / interface. Some have interfaces built in.

http://mackie.com/products/profxv2-series
I am aware of what a mixer is. But with a mixer:
1) I cannot do 7.1, as one of my outputs would need to be
2) There are generally fewer stereo pairs of channels (eg 7 is left and 8 is right)
3) From what I have seen, it generally takes a more expensive board to get things like multiple bus outputs
4) I have not seen any that do remote control, and the device that I mentioned is old/expensive (for one that works)
5) Cannot switch between headphones and speakers
6) Limited in what they can do, compared to having the audio go through a Linux box and using Calf Plugins to do a huge variety of manipulation. More than I would probably ever use. As I mentioned, the most I would probably do, at least for a while is normalize, which I still don't think a standard mixer will do. So I would STILL need to have audio go though a computer to do so.

My background for the last year has been working at a NPR affiliated, state wide radio station. I understand how traditional audio works. Before the radio station, I have used, messed with, and looked into mixers. It was not until I got the radio station that I saw cool things like an entire audio over IP network, audio routing, processing, etc. The only things that are analog are the mics, headphones, and studio monitors until they get to a node to convert it to an audio stream, or vise versa. Our satellite down links to get BBC and NPR, how audio gets from the mic (node) to the computer for a particular studio (since the mics are in the room and the computers are in our server racks), how audio gets to the final machines for processing and to be broadcast over the state, is all audio over IP. Livewire to be specific.

I understand that this is the newbie section, but I just didn't know where to put it and did not want to put it in the wrong place. I have built and used countless Linux and Unix systems, both for personal and business use. I have just never needed to worry about even having audio on those machines. And even if I did, I am sure it would be pretty standard and nothing like what I am trying to get help for.
 
Old 06-16-2018, 06:20 PM   #10
dylanrhodes0
LQ Newbie
 
Registered: Jun 2018
Posts: 15

Original Poster
Rep: Reputation: Disabled
Buggered

Last edited by dylanrhodes0; 06-16-2018 at 06:22 PM. Reason: Removing
 
Old 06-17-2018, 03:45 AM   #11
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Mixing board

Quote:
Originally Posted by dylanrhodes0 View Post
I don't quite understand what you mean. Care to elaborate a little bit? I've seen every aspect of what I want to work. Granted it wasn't with a raspberry pi, rather it was an expensive console board (like ones from Telos/Axia). And for remote volume control, Oxmoor DCA-2/DCA-2T does exactly what I am looking to do, except it deals with changing actual audio levels. And I have found stuff for changing audio levels via code in windows at least. So I don't see what part of it is not possible...
If you use a self-contained mixing board to directly alter the sound signals off the output on the computer, that has nothing to do with the computer. If you're trying to somehow alter the sound signals at the computer level, by some external means, I don't think it will work, because there is no interface.
 
Old 06-17-2018, 03:55 AM   #12
dylanrhodes0
LQ Newbie
 
Registered: Jun 2018
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AwesomeMachine View Post
If you use a self-contained mixing board to directly alter the sound signals off the output on the computer, that has nothing to do with the computer. If you're trying to somehow alter the sound signals at the computer level, by some external means, I don't think it will work, because there is no interface.
I'm not looking to change at the source computer level. Any computer I want audio from, want to send audio to, and the pi, are gonna have an audio over IP driver. Part of that is having a sound device show up on the system that can be selected to output to. This is already something I have. My computer will be set to output game audio on one of its audio over IP interfaces, and system sounds on the other. A separate Linux box will have voice chat, music, and system sounds output to their individual audio over IP interfaces. The Pi will then take those sources over the network, and come in as individual inputs. NOW is the part that I need help with. Controlling the audio of a source (source in general since I don't think it will matter what type it is), and then controlling where all that outputs to. Which would be one of three audio over IP interfaces on the Pi setup for output. One for headphones, one for recording, and one for remote. For instance, I may want music to be on HP but not recording, but I may want game to be on both. Then my separate Linux box will pick up those streams being output by the Pi, which is over the network, and output to the sound card for headphones, be picked up by my recording software, or used on another machine for remote.

I'm working on getting the audio over IP stuff. I'm not asking for help with that specifically. I'm asking for help on how to take a number from an ADC, and use it to control an audio level of a specific interface, on a Pi, on some version of Linux.

And again, I am WELL aware of how traditional audio works. I know that when using a traditional external audio board, that it has nothing to do with the computer. But as I have also explained, none of this is a traditional audio board. This is audio over IP.

Last edited by dylanrhodes0; 06-17-2018 at 03:57 AM.
 
Old 06-17-2018, 04:01 AM   #13
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Put a headphone preamp between the mixer and speakers, and those tend to have buttons for MUTE and MONO. The MUTE tends to ONLY affect the speakers, not the headphone out. And yes expensive. 7.1 is just 8 SINGLE channels. With the .1 being a center channel for a woofer and frequencies <= 150Hz. Not quite an audiophile myself, but I do have a $150 "stereo" interface, a $100 headphone preamp (for the MUTE option), and $1,500 speakers. The phile part being 2x sound devices MM-1's ($350 each) for stereo mic input. The mic preamps basically allow me to use ANY interface and still use pro quality mic(s). From anywhere since they are battery powered (about 4 hours on 2x AAs with phantom power enabled per preamp). You can software all the DSP you want, but you still need the ADC for input and the DAC for output. Which for 7.1 is an 8 channel interface / mixer MINIMUM.

Perhaps:

https://www.sweetwater.com/store/detail/R16--zoom-r16

About as cheap as I've seen for the I/O. Even if you cobbled an 8 channel option with 8x RPi's and 8x headset mics, it can add up ($35 * 8 + $5 * 8 == $320). But that's lowball since no MicroSD or power supplies. And you're talking significant latencies with computations and networking.
 
Old 06-17-2018, 04:08 AM   #14
dylanrhodes0
LQ Newbie
 
Registered: Jun 2018
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Shadow_7 View Post
Put a headphone preamp between the mixer and speakers, and those tend to have buttons for MUTE and MONO. The MUTE tends to ONLY affect the speakers, not the headphone out. And yes expensive. 7.1 is just 8 SINGLE channels. With the .1 being a center channel for a woofer and frequencies <= 150Hz. Not quite an audiophile myself, but I do have a $150 "stereo" interface, a $100 headphone preamp (for the MUTE option), and $1,500 speakers. The phile part being 2x sound devices MM-1's ($350 each) for stereo mic input. The mic preamps basically allow me to use ANY interface and still use pro quality mic(s). From anywhere since they are battery powered (about 4 hours on 2x AAs with phantom power enabled per preamp). You can software all the DSP you want, but you still need the ADC for input and the DAC for output. Which for 7.1 is an 8 channel interface / mixer MINIMUM.

Perhaps:

https://www.sweetwater.com/store/detail/R16--zoom-r16

About as cheap as I've seen for the I/O. Even if you cobbled an 8 channel option with 8x RPi's and 8x headset mics, it can add up ($35 * 8 + $5 * 8 == $320). But that's lowball since no MicroSD or power supplies. And you're talking significant latencies with computations and networking.
It seems I am not really getting the help I need. I never mentioned needing to hook up mics, I have a separate interface for that (UMC404HD). It would be absolutely stupid to have all 7.1 channels go through a STEREO board. Meaning a board that ONLY outputs, LEFT AND RIGHT.

I DO NOT NEED SUGGESTIONS FOR HOW TO NOT DO WHAT I AM DOING, WANT TO DO, AND HAVE ALREADY FIGURED OUT WHAT I NEED. If standard stuff did what I needed, I wouldn't be using my time trying to reinvent the wheel.

I will phrase this as simply as I can...

HERE IS WHAT I NEED HELP WITH

I need to take a value, given to me by an ADC.
I need to then use that value to control the volume of a SPECIFIC audio channel, on a raspberry pi, running some kind of Linux.

Like this: https://learn.adafruit.com/trinket-usb-volume-knob

EXCEPT not USB, and not for Windows, and not for the main audio level.
 
Old 06-17-2018, 04:08 AM   #15
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
I have my RPi 3B+ as a pulseaudio server with a pulse over jack configuration. Because I'm lazy and cheap, only one good sound interface and one good set of speakers. That's not a hard thing to do. Reliably controlling pulseaudio, especially remotely, IS a hard thing to do. Or anything reliable when it comes to dynamically changing your audio setup. There's some lash stuff to "remember" various configurations, but it's not implemented (especially not by default) in most distros.
 
  


Reply



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
why printk prints all the levels even control level is 4 4 17 ebaozhu Linux - General 1 07-10-2013 09:50 PM
Jack Audio Server multiple output ports DJ Shaji Linux - Software 2 05-28-2011 06:39 AM
Audacity - I can't control the recording levels shea1roh Linux - Software 3 12-02-2007 12:45 PM
SB Live & alsa - Can't Control Volume Levels NeccoWolf Linux - Hardware 5 10-08-2004 11:11 PM
run control (rc) levels...a definition? nuzzy Linux - General 4 06-28-2002 02:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:20 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