Hello team,
I wanted to share with anyone interested these easy to follow noob-proof instructions to build something that i think can be a very handy device for very little money.
The motivation:
Not long ago, and thanks to folks here, i decided to go ahead and do some room correction in my livingroom. I bought a umik-1, downloaded REW... and i must say that the results were very noticeable. I don't have, not even by far, one of these super flat responses that some people post here, but i do have a couple of very annoying resonances/room modes at around 50 Hz that needed correction badly, and it worked very well.
My setup looks like this:
2 channel streamed music > raspberry pi w/moode/camilladsp room correction > USB > topping D30pro > power amp > speakers
Additionally:
CD/DVD player > coax > tv (+spotify/films) > stereo toslink > same topping D30pro > power amp > speakers
The thing is, when I got used to the room correction, the sound coming from my tv directly to the D30pro, obviously with no correction, became difficult to accept. Even if only for casual background spotfy listening or for movies, those ugly resonances are again there.... grrrrr!!!
So what can be done to apply the same correction to the signal coming from the tv? I definitely dont want to spend a lot of money nor i am willing to have to install a big AVR or similar.
I just want to take the toslink from my tv, apply eq, and send it to my dac via spdif (the USB is occupied with the main music streamer)...
So easy, and so difficult apparently... the fact is that there are not many detailed instructions at newbie level on how to build such a thing, or at least i could not find them, so i thought this could be helpful for others in my situation. I hope you find them useful.
First, let me explain you a couple of apparently obvious solutions that i decided not to try, and why:
- Hifiberry digi+ I/O hat: Looks like the ideal solution. It has toslink in and out. But the only information i could get online was users complaining because they could not make the input and output work simultaneously and hifiberry looking somewhere else... so it did not seem to be a newbie friendly solution.
https://support.hifiberry.com/hc/en...igi-I-O-support-simultaneous-input-and-output-
- Input a spdif signal to my already existing moodeaudio streamer: moodeaudio has indeed the possibility to chose input from spdif, but unfortunately it only works with two cards, and i think none of them has toslink input. Tim Curtis himself explains it in the links below. Again does not look like a thing a newbie can do easily...:
https://moodeaudio.org/forum/showthread.php?tid=3981&highlight=input
https://moodeaudio.org/forum/showthread.php?tid=3377&highlight=input+selection
The inspiration came from people reporting to have had interfaces sending and receiving simultaneously signal to a raspberry pi running camilladsp.... Great! but can this be done with something very small that i can hide behind the tv, toslink in and out, and most importantly, on the ultra cheap?? there we go!
The first i did was to try a Sound Blaster X-fi HD USB card that has toslink input and output, and after some initial issues, i could make it work! But i need the X-fi for something else, so i decided to go for something that i could buy as cheap as possible in amazon, and i found this:
https://www.amazon.de/gp/product/B07W21PGJQ/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
Toslink in and out, 25 euros.... i am sure it wont be as good as SOTA DACs, not even as the X-fi HD, but not needing any DAC tasks, is it even relevant?i decided to give it a try.
Detailed newbie-proof instructions:
Most of this is an adaptation of @mdsimon2 tutorial on multichannel raspberry pi camiladsp mentioned below. In that tutorial there is information enough to build something like what we are trying to do here if you have a bit of knowledge, but does not address this use case with step by step instructions. Here i try to focus on what is specific for my use case and on describing some things at the newbie level that might be not so evident for the absolute dummy like me when following Michael's tutorial.
NOTE: I will be using a raspberry pi 4b 2 Mb and doing the setup in a Windows pc via wifi.
1. The first step is to follow mdsimon2's tutorial and install camilladsp in a raspberry pi. It is very easy and even someone without any experience can get it done in a coouple of hours:
https://www.audiosciencereview.com/forum/index.php?threads/rpi4-camilladsp-tutorial.29656/
The only thing that can be confusing for the newbie is point "6) Create CamillaDSP yml configuration file". There you need to input the configuration details for any of the 3 DACs Michael uses and you wish you had, but you don't. But dont worry, just chose the one you like best and move forward, we will change it later on. In my case i chose ultralitemk5_toslink.txt.
Stop in step 12), that is, you don't need to create a loopback (step 13) nor any of the following steps for this particular project.
2. Find out the information you need from the soundcard to create its camilladsp profile:
Open ubuntu in your pc and connect via ssh to your pi running camilladsp that you have just created. In my case:
ssh marcosch@raspcamilla
once you are in, lets find out the name of the card, with, for instance, aplay -l
We see here the name of the card 1, our USB card, is ICUSBAUDIO7D
Let’s see now what this 25 euros wonder can do with this instruction:
cat /proc/asound/ICUSBAUDIO7D/stream0
Ok, the first part of the outcome is the playback capabilities, we see that the only format it supports is S16LE (this is when you remember you paid only 25 euros), sample rates are 44100, 48000 (perfect for my tv toslink) and even 96000. (worth noting here that the X-fi HD, that can be found used for very little money too, supports 24 bits and up to 192 kHz).
In the lower part we see the capture capabilities:
Same S16LE and sample rates limited to 44100 and 48000.
I dont even know if all this is very relevant as we don't aim to do any AD nor DA conversion and the sound from a regular tv comes at 48 kHz...
Maybe someone can chime in and indicate if it is worth trying to find a better card or if on the other hand it would be a waste of resources.
3. Select the input in alsamixer
There is probably a better way to do this, but I have found that with these cards with several inputs (this one has toslink, line and mic), one way to select which input you want to use is alsamixer. Just type in the command prompt:
alsamixer
And a window like this will open:
What you see here is the alsamixer control for headphone of the pi. To change to your USB card, press F6 and a window will appear where you can select it by its name, in this case ICUSBAUDIO7D. Then you will see more of these bars. Then press F5 and you will see all the inputs and outputs of the card together:
The important action to do here, is to move sideways with the cursor and when on "PCM Capture", in between the options (Line, mic...) select "IEC958 In". Here you can also adjust the gains etc. I did not experiment with that and don't really know what effect it has in camilladsp. If, like me, you don't know what you are doing, just leave it like it is.
Exit alsamixer pressing ESC
Now, and this is very important, to make the changes in alsamixer permanent, enter the following instruction:
sudo alsactl store
If you don’t do this, next time you reboot the pi the card will go back to the previous setting and you will not get the sound from the toslink.
4. Create the camilladsp configuration
Open your browser and open your camilladsp gui
http://yourcamilladspdomain:5000/gui/index.html
In my case http://raspcamilla:5000/gui/index.html
When you set up camilladsp following mdsimon2 tutorial, you selected one of the example configuration files he provided, that will be what is loaded now in camilladsp. In my case, it was the ultralitemk5_toslink. And this is what we get on the screen:
This is actually pretty close to what we will need in our case, just need to change a few things, i.e., obviously, the number of channels from 16 and 18 to 2 both in the capture and the playback device. When you do this, you will get some error messages as the rest of the configuration is not compatible with only 2 channels in and 2 channels out. But don't worry, we will address that in the following steps.
Of course, you also need to change the name of the input and output device, see how it looks like. There are other changes to be done, I left mine like this to start with:
See that i did not play with sample rates or resampling. I am sure there are settings that could improve the results but i am not knowledgeable enough to indicate the best settings possible. If someone has suggestions, feel free to comment.
5. Upload and set your room correction filters and rest of the pipeline:
In the "Files" tab, under the "Filters" section below "Configs" section, you can upload your room correction convolution filters you created with REW and saved as a .wav file for each channel. To upload your filters, press the "upload arrow". In the picture below you can see mine already uploaded, for both 44k and 48k rates. In this case i will only use the 48k rates that is what my tv toslink outputs. You can also see that i have other configurations there i played with before. If this is your first attempt, you will only see "camilladsp.yml" conf. This is normal and more than enough.
Then, to be able to add the filters to your pipeline later on, you need to set them first in the filters tab: go to the filters tab and press the green "+" to add a new filter. In type select "Conv", in subtype "Wav".
Note that in my case I also created a "gain" filter to play with, but that’s a different story, just ignore it. I left it in the picture just as an example to indicate that you can create as many filters as you want.
Mixerst tab:
What we are building here is straight stereo in, stereo out.Then, of course, you need to delete all the additional channels that the configuration for the Ultralite has and keep only 2 channels input (0 and 1) linked to 2 channels output (0 and 1). It should look like this:
Pipeline tab:
And finally, in pipeline, you add your room correction filters to each channel pressing the green "+" in each channel and selecting from the drop down list from the filters you set up before. Channel 0 for L and 1 for R in my case (I don't know if it is always the same). It should look like this:
Pressing the "Plot the pipeline" button besides the green "+" at the bottom, you get an overview of the, in this case very simple, pipeline:
And you are done, as soon as you apply and save all the changes, pressing "apply to DSP" at the left of the screen, the magic happens and your "Standalone Toslink in – Toslink out DSP Room Correction" device is up and running. Place in between your source, whatever that is, and DAC, and enjoy your EQed music!
And you might be wonder, what about the latency? In my setup, with such a simple configuration, low sample rates and my REW made convolution filters, the delay is barely noticeable. I don't have the means to measure, but if i add the sound coming directly from the tv on top of the sound from the speakers there is no significant delay. Yes, you can notice there are two overlaping sound sources, but it is completely irrelevant for lip sync. I would imagine as well that if you want to do some complex processing using a pi zero 2w, it might be a different story...
And here it is how it looks like:
Now you are all set, and this is the beauty of it for me, you dont need to do any other changes and you can switch it off and on and if everything is well in place it should start to work without the need to press any button or activate anything. Just hide it somewhere behind the telly (yes, that blue led is very annoying and screams cheap) and forget it exists!
I wanted to share with anyone interested these easy to follow noob-proof instructions to build something that i think can be a very handy device for very little money.
The motivation:
Not long ago, and thanks to folks here, i decided to go ahead and do some room correction in my livingroom. I bought a umik-1, downloaded REW... and i must say that the results were very noticeable. I don't have, not even by far, one of these super flat responses that some people post here, but i do have a couple of very annoying resonances/room modes at around 50 Hz that needed correction badly, and it worked very well.
My setup looks like this:
2 channel streamed music > raspberry pi w/moode/camilladsp room correction > USB > topping D30pro > power amp > speakers
Additionally:
CD/DVD player > coax > tv (+spotify/films) > stereo toslink > same topping D30pro > power amp > speakers
The thing is, when I got used to the room correction, the sound coming from my tv directly to the D30pro, obviously with no correction, became difficult to accept. Even if only for casual background spotfy listening or for movies, those ugly resonances are again there.... grrrrr!!!
So what can be done to apply the same correction to the signal coming from the tv? I definitely dont want to spend a lot of money nor i am willing to have to install a big AVR or similar.
I just want to take the toslink from my tv, apply eq, and send it to my dac via spdif (the USB is occupied with the main music streamer)...
So easy, and so difficult apparently... the fact is that there are not many detailed instructions at newbie level on how to build such a thing, or at least i could not find them, so i thought this could be helpful for others in my situation. I hope you find them useful.
First, let me explain you a couple of apparently obvious solutions that i decided not to try, and why:
- Hifiberry digi+ I/O hat: Looks like the ideal solution. It has toslink in and out. But the only information i could get online was users complaining because they could not make the input and output work simultaneously and hifiberry looking somewhere else... so it did not seem to be a newbie friendly solution.
https://support.hifiberry.com/hc/en...igi-I-O-support-simultaneous-input-and-output-
- Input a spdif signal to my already existing moodeaudio streamer: moodeaudio has indeed the possibility to chose input from spdif, but unfortunately it only works with two cards, and i think none of them has toslink input. Tim Curtis himself explains it in the links below. Again does not look like a thing a newbie can do easily...:
https://moodeaudio.org/forum/showthread.php?tid=3981&highlight=input
https://moodeaudio.org/forum/showthread.php?tid=3377&highlight=input+selection
The inspiration came from people reporting to have had interfaces sending and receiving simultaneously signal to a raspberry pi running camilladsp.... Great! but can this be done with something very small that i can hide behind the tv, toslink in and out, and most importantly, on the ultra cheap?? there we go!
The first i did was to try a Sound Blaster X-fi HD USB card that has toslink input and output, and after some initial issues, i could make it work! But i need the X-fi for something else, so i decided to go for something that i could buy as cheap as possible in amazon, and i found this:
https://www.amazon.de/gp/product/B07W21PGJQ/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
Toslink in and out, 25 euros.... i am sure it wont be as good as SOTA DACs, not even as the X-fi HD, but not needing any DAC tasks, is it even relevant?i decided to give it a try.
Detailed newbie-proof instructions:
Most of this is an adaptation of @mdsimon2 tutorial on multichannel raspberry pi camiladsp mentioned below. In that tutorial there is information enough to build something like what we are trying to do here if you have a bit of knowledge, but does not address this use case with step by step instructions. Here i try to focus on what is specific for my use case and on describing some things at the newbie level that might be not so evident for the absolute dummy like me when following Michael's tutorial.
NOTE: I will be using a raspberry pi 4b 2 Mb and doing the setup in a Windows pc via wifi.
1. The first step is to follow mdsimon2's tutorial and install camilladsp in a raspberry pi. It is very easy and even someone without any experience can get it done in a coouple of hours:
https://www.audiosciencereview.com/forum/index.php?threads/rpi4-camilladsp-tutorial.29656/
The only thing that can be confusing for the newbie is point "6) Create CamillaDSP yml configuration file". There you need to input the configuration details for any of the 3 DACs Michael uses and you wish you had, but you don't. But dont worry, just chose the one you like best and move forward, we will change it later on. In my case i chose ultralitemk5_toslink.txt.
Stop in step 12), that is, you don't need to create a loopback (step 13) nor any of the following steps for this particular project.
2. Find out the information you need from the soundcard to create its camilladsp profile:
Open ubuntu in your pc and connect via ssh to your pi running camilladsp that you have just created. In my case:
ssh marcosch@raspcamilla
once you are in, lets find out the name of the card, with, for instance, aplay -l
We see here the name of the card 1, our USB card, is ICUSBAUDIO7D
Let’s see now what this 25 euros wonder can do with this instruction:
cat /proc/asound/ICUSBAUDIO7D/stream0
Ok, the first part of the outcome is the playback capabilities, we see that the only format it supports is S16LE (this is when you remember you paid only 25 euros), sample rates are 44100, 48000 (perfect for my tv toslink) and even 96000. (worth noting here that the X-fi HD, that can be found used for very little money too, supports 24 bits and up to 192 kHz).
In the lower part we see the capture capabilities:
Same S16LE and sample rates limited to 44100 and 48000.
I dont even know if all this is very relevant as we don't aim to do any AD nor DA conversion and the sound from a regular tv comes at 48 kHz...
Maybe someone can chime in and indicate if it is worth trying to find a better card or if on the other hand it would be a waste of resources.
3. Select the input in alsamixer
There is probably a better way to do this, but I have found that with these cards with several inputs (this one has toslink, line and mic), one way to select which input you want to use is alsamixer. Just type in the command prompt:
alsamixer
And a window like this will open:
What you see here is the alsamixer control for headphone of the pi. To change to your USB card, press F6 and a window will appear where you can select it by its name, in this case ICUSBAUDIO7D. Then you will see more of these bars. Then press F5 and you will see all the inputs and outputs of the card together:
The important action to do here, is to move sideways with the cursor and when on "PCM Capture", in between the options (Line, mic...) select "IEC958 In". Here you can also adjust the gains etc. I did not experiment with that and don't really know what effect it has in camilladsp. If, like me, you don't know what you are doing, just leave it like it is.
Exit alsamixer pressing ESC
Now, and this is very important, to make the changes in alsamixer permanent, enter the following instruction:
sudo alsactl store
If you don’t do this, next time you reboot the pi the card will go back to the previous setting and you will not get the sound from the toslink.
4. Create the camilladsp configuration
Open your browser and open your camilladsp gui
http://yourcamilladspdomain:5000/gui/index.html
In my case http://raspcamilla:5000/gui/index.html
When you set up camilladsp following mdsimon2 tutorial, you selected one of the example configuration files he provided, that will be what is loaded now in camilladsp. In my case, it was the ultralitemk5_toslink. And this is what we get on the screen:
This is actually pretty close to what we will need in our case, just need to change a few things, i.e., obviously, the number of channels from 16 and 18 to 2 both in the capture and the playback device. When you do this, you will get some error messages as the rest of the configuration is not compatible with only 2 channels in and 2 channels out. But don't worry, we will address that in the following steps.
Of course, you also need to change the name of the input and output device, see how it looks like. There are other changes to be done, I left mine like this to start with:
See that i did not play with sample rates or resampling. I am sure there are settings that could improve the results but i am not knowledgeable enough to indicate the best settings possible. If someone has suggestions, feel free to comment.
5. Upload and set your room correction filters and rest of the pipeline:
In the "Files" tab, under the "Filters" section below "Configs" section, you can upload your room correction convolution filters you created with REW and saved as a .wav file for each channel. To upload your filters, press the "upload arrow". In the picture below you can see mine already uploaded, for both 44k and 48k rates. In this case i will only use the 48k rates that is what my tv toslink outputs. You can also see that i have other configurations there i played with before. If this is your first attempt, you will only see "camilladsp.yml" conf. This is normal and more than enough.
Then, to be able to add the filters to your pipeline later on, you need to set them first in the filters tab: go to the filters tab and press the green "+" to add a new filter. In type select "Conv", in subtype "Wav".
Note that in my case I also created a "gain" filter to play with, but that’s a different story, just ignore it. I left it in the picture just as an example to indicate that you can create as many filters as you want.
Mixerst tab:
What we are building here is straight stereo in, stereo out.Then, of course, you need to delete all the additional channels that the configuration for the Ultralite has and keep only 2 channels input (0 and 1) linked to 2 channels output (0 and 1). It should look like this:
Pipeline tab:
And finally, in pipeline, you add your room correction filters to each channel pressing the green "+" in each channel and selecting from the drop down list from the filters you set up before. Channel 0 for L and 1 for R in my case (I don't know if it is always the same). It should look like this:
Pressing the "Plot the pipeline" button besides the green "+" at the bottom, you get an overview of the, in this case very simple, pipeline:
And you are done, as soon as you apply and save all the changes, pressing "apply to DSP" at the left of the screen, the magic happens and your "Standalone Toslink in – Toslink out DSP Room Correction" device is up and running. Place in between your source, whatever that is, and DAC, and enjoy your EQed music!
And you might be wonder, what about the latency? In my setup, with such a simple configuration, low sample rates and my REW made convolution filters, the delay is barely noticeable. I don't have the means to measure, but if i add the sound coming directly from the tv on top of the sound from the speakers there is no significant delay. Yes, you can notice there are two overlaping sound sources, but it is completely irrelevant for lip sync. I would imagine as well that if you want to do some complex processing using a pi zero 2w, it might be a different story...
And here it is how it looks like:
Now you are all set, and this is the beauty of it for me, you dont need to do any other changes and you can switch it off and on and if everything is well in place it should start to work without the need to press any button or activate anything. Just hide it somewhere behind the telly (yes, that blue led is very annoying and screams cheap) and forget it exists!
Last edited: