• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Budget Standalone "Toslink > DSP > Toslink" with Camilladsp. Set up instructions for newbies.

Rafaille

Member
Joined
Dec 5, 2021
Messages
80
Likes
40
hey Rafaille,

Yes, the RPi4 can accept digital audio via USB, usually from an audio interface. I am not familiar at all with nvidia shield. Is this USB acting as a host? it seems so as you connect it to your DAC. In this case i believe you will have to use your RPi4 in gadget mode. There is a thread in the forum about how to achieve that (I cannot find it now, maybe someone can link it edit: link at the end). I think you will have to use the USB-C port of your RPi4 and an adaptor in gadget mode.
If the shield could act as an audio interface via USB, it would make it much easier. Maybe in the camilladsp tutorial thread you can find someone that does what you aim to (link below).

If you don't want to use your TV as HDMI to SPDIF converter you can also use a dedicated HDMI audio extractor. A couple have been reviewed here with good results.

I have never heard about any issues with the USB 3.0 ports of the RPi4. These are the ones i use for my DAC and interface and they work fine.


using raspberry pi in gadget mode thread:

Thanks so much @MCH for all this.

I was not aware of the gadget mode on the Pi, this looks relatively straightforward, however since I would need to buy a usb otg hub and a bunch of cables I may as well go the converter route.

Re conversion, I am not too keen on hdmi splitter either, I use a few hdcp protected streaming platforms on the shield and in my experience finding a splitter that is both good quality audio wise and video wise (4k 60 Hz hdcp compliant) is challenging and expensive.
I did forget about one possibility though, usb to spdif! They are apparently less prone to introducing jitter and that would leave the video path alone.

So to sum up, I could do away with a usb to spdif to connect shield to Pi through a hifime digi s2 for instance. On the plus side, I can use the toslink out of the hifime to direct low freqs to the sub (through cheap dac), while the high freqs go to my current dac and speakers.

Do you think it makes sense?
 
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,676
Likes
2,299
Thanks so much @MCH for all this.

I was not aware of the gadget mode on the Pi, this looks relatively straightforward, however since I would need to buy a usb otg hub and a bunch of cables I may as well go the converter route.

Re conversion, I am not too keen on hdmi splitter either, I use a few hdcp protected streaming platforms on the shield and in my experience finding a splitter that is both good quality audio wise and video wise (4k 60 Hz hdcp compliant) is challenging and expensive.
I did forget about one possibility though, usb to spdif! They are apparently less prone to introducing jitter and that would leave the video path alone.

So to sum up, I could do away with a usb to spdif to connect shield to Pi through a hifime digi s2 for instance. On the plus side, I can use the toslink out of the hifime to direct low freqs to the sub (through cheap dac), while the high freqs go to my current dac and speakers.

Do you think it makes sense?
Yes, that should work, but you need a USB to toslink at the shield side and one toslink to usb at the raspberry pi side.
 

Rafaille

Member
Joined
Dec 5, 2021
Messages
80
Likes
40
Yes, that should work, but you need a USB to toslink at the shield side and one toslink to usb at the raspberry pi side.
Just read my post again, it was not very clear, but yes 2 converters are needed.
Thanks for your help!
 
  • Like
Reactions: MCH

mattzildjian

Member
Joined
Oct 17, 2020
Messages
69
Likes
24
how much latency would be added with all those converstion steps and processing though? Would it be noticeable?
 
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,676
Likes
2,299
how much latency would be added with all those converstion steps and processing though? Would it be noticeable?
Currently, I use a similar TV > toslink > card > raspberry pi > usb DAC.
I have never measured the delay, but when we forget the TV speakers on sometimes it takes some time until we realise. I mean, it is noticeable but I wouldn't even call it a echo. For me is more than good enough to watch films and listening to music. Maybe for a different use it isn't good enough (?) I have no idea.
 

mattzildjian

Member
Joined
Oct 17, 2020
Messages
69
Likes
24
Currently, I use a similar TV > toslink > card > raspberry pi > usb DAC.
I have never measured the delay, but when we forget the TV speakers on sometimes it takes some time until we realise. I mean, it is noticeable but I wouldn't even call it a echo. For me is more than good enough to watch films and listening to music. Maybe for a different use it isn't good enough (?) I have no idea.

Hmm ok, that sounds promising.
Are you still using the cheap LEAGY sound card from your original write up?
 
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,676
Likes
2,299
Hmm ok, that sounds promising.
Are you still using the cheap LEAGY sound card from your original write up?
No, I switched to a mindsp ddrc2x4 as toslink to usb card a long time ago. But iirc the latency was similar. I can't be sure anymore, it has been a while.
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,530
Likes
3,408
Location
Detroit, MI
how much latency would be added with all those converstion steps and processing though? Would it be noticeable?

HDMI to TOSLINK extractors don't add any latency.

Using a TOSLINK to USB device will probably add < 5 ms latency compared to a direct USB solution.

The biggest issue with latency will be the inherent latency in CamillaDSP, I would expect 20-30 ms in almost all cases. This is fine for A/V applications but may cause lip sync issues if you add long linear phase FIR filters with additional latency.

Michael
 

mattzildjian

Member
Joined
Oct 17, 2020
Messages
69
Likes
24
HDMI to TOSLINK extractors don't add any latency.

Using a TOSLINK to USB device will probably add < 5 ms latency compared to a direct USB solution.

The biggest issue with latency will be the inherent latency in CamillaDSP, I would expect 20-30 ms in almost all cases. This is fine for A/V applications but may cause lip sync issues if you add long linear phase FIR filters with additional latency.

Michael

Thanks, I assume then camilladsp does not have a zero latency mode like EqualiserAPO does.
Is this something that could be implemented to camilladsp in the future or is it just not possible in this scenario?
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,530
Likes
3,408
Location
Detroit, MI
Thanks, I assume then camilladsp does not have a zero latency mode like EqualiserAPO does.
Is this something that could be implemented to camilladsp in the future or is it just not possible in this scenario?

Depends on what you mean by zero latency mode. Most DSP engines that advertise zero latency are only referring to zero additional latency from applying filters. However, if you are applying linear phase FIR filters this will always add latency, only way to get around this in a A/V application is to also delay video. I would expect all DSP engines to have some sort of fixed latency associated with buffers, a quick search on equalizer APO suggests this is around 10 ms.

From what I've seen CamillaDSP adds no additional latency when applying filters. You can reduce the baseline latency by reducing chunk size but how low you can reduce it will depend on your specific setup. If you are concerned with latency and want low chunk size, you need to be using a capture and playback device that share the same clock and you do not want any resampling or rate adjust. From what I've seen, a latency of about 5 ms is about as low as you can achieve in an ideal scenario.

Michael
 

mattzildjian

Member
Joined
Oct 17, 2020
Messages
69
Likes
24
Depends on what you mean by zero latency mode. Most DSP engines that advertise zero latency are only referring to zero additional latency from applying filters. However, if you are applying linear phase FIR filters this will always add latency, only way to get around this in a A/V application is to also delay video. I would expect all DSP engines to have some sort of fixed latency associated with buffers, a quick search on equalizer APO suggests this is around 10 ms.

From what I've seen CamillaDSP adds no additional latency when applying filters. You can reduce the baseline latency by reducing chunk size but how low you can reduce it will depend on your specific setup. If you are concerned with latency and want low chunk size, you need to be using a capture and playback device that share the same clock and you do not want any resampling or rate adjust. From what I've seen, a latency of about 5 ms is about as low as you can achieve in an ideal scenario.

Michael

Thanks.

I purchased one of the cheap cm6206 based soundcards to test with a windows 11 laptop however the SPDIF output was incredibly unstable and cut out every second. I tried 4 different drivers and they all varied in results but none of them would output stable digital audio via SPDIF.

Would you recommend the Hifime S2 Digi instead? It supports way more sample rates and bit rates (44-192kHz/16-32bit), therefore could it also be that this will have lower latency than the cm6206 cards that are fixed at 48khz 16bit?
Additionally, could the processing power of the device performing the DSP also affect latency? For example, could the RPi5 have lower latency than the RPi4 as it's cpu is up to 3x faster?
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,530
Likes
3,408
Location
Detroit, MI
Thanks.

I purchased one of the cheap cm6206 based soundcards to test with a windows 11 laptop however the SPDIF output was incredibly unstable and cut out every second. I tried 4 different drivers and they all varied in results but none of them would output stable digital audio via SPDIF.

Would you recommend the Hifime S2 Digi instead? It supports way more sample rates and bit rates (44-192kHz/16-32bit), therefore could it also be that this will have lower latency than the cm6206 cards that are fixed at 48khz 16bit?
Additionally, could the processing power of the device performing the DSP also affect latency? For example, could the RPi5 have lower latency than the RPi4 as it's cpu is up to 3x faster?

With CamillaDSP, the only things that appreciably impact latency are the chunk size you specify and whether you have resampling enabled. Processing power differences will have negligible impact on latency compared to those factors.

Sample rate doesn't really impact it either. At lower sample rates you can use lower chunk sizes, but in my experience the lowest chunk size you can use is still equivalent between sample rates. For example, at 48 kHz your min chunk size may be 128 and at 96 kHz it may be 256 but these are effectively the same in terms of delay.

Michael
 

mattzildjian

Member
Joined
Oct 17, 2020
Messages
69
Likes
24
With CamillaDSP, the only things that appreciably impact latency are the chunk size you specify and whether you have resampling enabled. Processing power differences will have negligible impact on latency compared to those factors.

Sample rate doesn't really impact it either. At lower sample rates you can use lower chunk sizes, but in my experience the lowest chunk size you can use is still equivalent between sample rates. For example, at 48 kHz your min chunk size may be 128 and at 96 kHz it may be 256 but these are effectively the same in terms of delay.

Michael
Thanks for all the info, I notice in another thread you stated the hifimediy S2 Digi was not suitable for this DSP purpose because it didnt have a single clock speed?
However it seems others have been able to use S2 Digi without issue.

Should I go with it or avoid it? I'm running out of options if S2 Digi is also not going to work!
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,530
Likes
3,408
Location
Detroit, MI
Thanks for all the info, I notice in another thread you stated the hifimediy S2 Digi was not suitable for this DSP purpose because it didnt have a single clock speed?
However it seems others have been able to use S2 Digi without issue.

Should I go with it or avoid it? I'm running out of options if S2 Digi is also not going to work!

Difficult to say if my issues were completely the fault of the S2 Digi or the combination of the S2 digi and my DAC. Not sure what post you saw but this is my latest experience with it -> https://www.audiosciencereview.com/...nts-and-rising-noise-floor.42383/post-1845070.

Since you already have the CM6206 it might be worth trying it on Linux to see if it works better.

Just my 2 cents but I wouldn't use a SPDIF in / out device unless I knew how the input / output were being clocked.

Michael
 
OP
M

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,676
Likes
2,299
Just my 2 cents but I wouldn't use a SPDIF in / out device unless I knew how the input / output were being clocked.

Michael
Could it be checked with an oscilloscope? I guess, checking the rises are simultaneous over time? -no idea, just guessing.
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,530
Likes
3,408
Location
Detroit, MI
Could it be checked with an oscilloscope? I guess, checking the rises are simultaneous over time? -no idea, just guessing.

Also have no idea of how you would do it by looking at the SPDIF waveform, maybe some smarter folks know.

I have checked synced by looking at DAC outputs on an oscilloscope while playing a 15 kHz tone. For example take the UL Mk5, route the SPDIF output to the CM6206 and the SPDIF output of the CM6206 to a DAC. Then play a 15 kHz to tone to an analog output and the SPDIF output of the UL Mk5. Observe the analog output of the UL Mk5 and the DAC being feed by the CM6206 on the scope, if they are sync'd you won't see any movement between the traces.

Can also run frequency sweeps using a loopback as timing reference and see if the phase response is stable.

Actually makes we want to try it on the S2 digital to see what it looks like.

Michael
 

mattzildjian

Member
Joined
Oct 17, 2020
Messages
69
Likes
24
Can anyone comment on this audio interface for this job?

It is supported by Linux ALSA sound drivers

Here they mention clock for digital inputs, can someone who understands this let me know if this seems ok?

It mentions a lot about manually setting the sample rate as the interface will not automatically detect sample rate, will this be a problem? Does a TV optical output switch sample rates based on the content or does it always stick to a static sample rate?
 

Rafaille

Member
Joined
Dec 5, 2021
Messages
80
Likes
40
I am a bit lost regarding syncing of several outputs of RPi running camilladsp. I read on another thread that you @mdsimon2 said multiple usb dacs was not a viable option as they all run their own clocks.
Does it mean that several spdif/toslink outputs behave better? How about a mix of spdif/toslink and usb dacs?
For instance my goal is to output 2.1, apart from expensive multichannel usb dacs, what are my options? The leagy from post #1 is attractive with its combination of toslink and analog out but some people reported that the toslink input was buggy.
 
Last edited:

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,530
Likes
3,408
Location
Detroit, MI
Can anyone comment on this audio interface for this job?

It is supported by Linux ALSA sound drivers

Here they mention clock for digital inputs, can someone who understands this let me know if this seems ok?

It mentions a lot about manually setting the sample rate as the interface will not automatically detect sample rate, will this be a problem? Does a TV optical output switch sample rates based on the content or does it always stick to a static sample rate?

That looks like it ticks all the boxes. It sounds like it will act as clock master unless a digital input is detected at which point it will switch to slave. It is limited to 48 kHz which should be fine for a TV application. All TVs I've seen output a constant 48 kHz so no worries about changing sample rates.

Michael
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,530
Likes
3,408
Location
Detroit, MI
I am a bit lost regarding syncing of several outputs of RPi running camilladsp. I read on another thread that you @mdsimon2 said multiple usb dacs was not a viable option as they all run their own clocks.
Does it mean that several spdif/toslink outputs behave better? How about a mix of spdif/toslink and usb dacs?
For instance my goal is to output 2.1, apart from expensive multichannel usb dacs, what are my options? The leagy from post #1 is attractive with its combination of toslink and analog out but some people reported that the toslink input was buggy.

Never use multiple USB DACs. Never use a mixture of USB and SPDIF DACs unless the SPDIF DAC is being clocked by a USB interface.

For example, if you had an audio interface that had SPDIF and analog outputs that would be OK as they would share a common clock. SPDIF carries a clock signal so the SPDIF connected DAC will be sync'd to the interface. In this case there will likely be some delay between the analog output of the interface and the analog output of the SPDIF connected DAC, but this is easy to deal with CamillaDSP.

Michael
 
Top Bottom