Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: SPDIF out via GPIO (No Hat!)
#1
Ok so hear me out - I'm good enough with linux to follow instructions and do basic troubleshooting but definitely no expert.  I have been playing with digital output directly through the Pi's GPIO pins to my A/V receiver.  I'm hoping to find a way to get this working on a moOde installation and then having an entry in the drop-down menu as an Output Device in the Audio settings menu.

GitHub - mill1000/raspdif: S/PDIF digital audio output via Raspberry Pi GPIO.

I tried a couple things:

Note: All testing done on a PI4 with 4GB of RAM, but from what I can tell this works on any Pi.

Attempt #1

- Fresh install of moOde 8.3.0 - 64-bit
- install git and clang
- clone git and try to make - errors.
- manage to fix errors but doesn't seem to work

Attempt #2

- Fresh install of moOde 8.3.0 - 32-bit
- install git and clang
- clone git and try to make - no errors.
- install and test using ffmpeg - works!
- clearly 64-bit is a no-go

The rest of the steps don't yield results so I'm still poking around with moOde's configuration files to see if I can find a way to have it output to the FIFO, or maybe use the loopback option.  
I'll post an update when I get something working better, but thought I'd share my initial information in case someone else here has tried something similar or knows an easy way to make this work.
Reply
#2
(03-25-2023, 10:56 PM)Rees86 Wrote: Ok so hear me out - I'm good enough with linux to follow instructions and do basic troubleshooting but definitely no expert.  I have been playing with digital output directly through the Pi's GPIO pins to my A/V receiver.  I'm hoping to find a way to get this working on a moOde installation and then having an entry in the drop-down menu as an Output Device in the Audio settings menu.

GitHub - mill1000/raspdif: S/PDIF digital audio output via Raspberry Pi GPIO.

I tried a couple things:

Note: All testing done on a PI4 with 4GB of RAM, but from what I can tell this works on any Pi.

Attempt #1

- Fresh install of moOde 8.3.0 - 64-bit
- install git and clang
- clone git and try to make - errors.
- manage to fix errors but doesn't seem to work

Attempt #2

- Fresh install of moOde 8.3.0 - 32-bit
- install git and clang
- clone git and try to make - no errors.
- install and test using ffmpeg - works!
- clearly 64-bit is a no-go

The rest of the steps don't yield results so I'm still poking around with moOde's configuration files to see if I can find a way to have it output to the FIFO, or maybe use the loopback option.  
I'll post an update when I get something working better, but thought I'd share my initial information in case someone else here has tried something similar or knows an easy way to make this work.

Hi,

reading your post I just noticed that git repo. Not read through it, but if it is about S/PDIF audio output without using a HAT looks interesting; I can have a look about making it compile for x64 arch.

Any pics/examples somewhere, just to see how it is used in real life?
Reply
#3
1) as far as compiling goes, moOde is just Raspberry Pi OS. If the 64-bit build process fails, then that should be flagged as an issue on the raspdif github repo.

2) you haven't specified what "don't yield results" means. It looks like issue #12 (started by a moOde user) may contain relevant information. Have you followed it?

I don't have any S/PDIF gear so can't follow along at home.

Regards,
Kent
Reply
#4
(03-26-2023, 12:59 PM)Nutul Wrote: Hi,

reading your post I just noticed that git repo. Not read through it, but if it is about S/PDIF audio output without using a HAT looks interesting; I can have a look about making it compile for x64 arch.

Any pics/examples somewhere, just to see how it is used in real life?

The hardware part is really simple, I just picked up some screw terminal RCA connectors and hooked up to the digital input of my receiver but you could sacrifice an existing RCA cable by cutting the end off.  For testing I used an old junk receiver I have laying around and just hooked the GPIO directly to the digital input - for better safety the resistor should be added inline with the signal for a final configuration as shown on the authors github.

I also see a user reported that if you wire up an LED instead of a cable you can use an optical cable.  I'll test that out once I get things working.

(03-26-2023, 01:28 PM)TheOldPresbyope Wrote: 2) you haven't specified what "don't yield results" means. It looks like issue #12 (started by a moOde user) may contain relevant information. Have you followed it?

I don't have any S/PDIF gear so can't follow along at home.

Regards,
Kent

Ah thanks I guess I should have caught that issue on github - I went through it looking for a solution to the compiling issue and didn't circle back once that was sorted.  It looks like I'm having the same issues as jtauscher on github but haven't gotten as far in the troubleshooting process.  I'll keep poking around but I'm sure they'll likely solve things first.


Attached Files Thumbnail(s)
   
Reply
#5
Why not just use one of the inexpensive SPDIF HAT boards?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
Try twisting the unshielded pair of wires from the GPIO. The RCA is shielded, but the jumpers from the GPIO are not. Shortening the jumpers will help. Shielding the signal wire, with the shield grounded at the GPIO will help. If that doesn't work, add a 430R or 470R (1/8-1/4W) resistor inline with the signal wire (center of RCA), mounted close to the GPIO. There is likely too much noise on the signal line. The twisted pair will help to cancel noise from external sources, and the inline resistor will filter high frequency noise. If these efforts don't work, you will need a buffer on the GPIO. I initially had the problem with my prototype DIY I2S DAC HAT. With the resistors, I was able to use 10cm unshielded (and untwisted) jumpers from I2S GPIO to an external proto board. I don't have experience with S/PDIF. According to wikip, S/PDIF single ended uses 75 ohm coaxial shielded cable up to 10m length.
Hardware: RPi Zero W | Allo Kali | ProtoDAC TDA1387 X8 | PGA2311 | Icepower 500ASP | Harbeth SHL5
Software: Moode 8.3.3
Source: Win 10 NAS
Reply
#7
(03-26-2023, 03:58 PM)Tim Curtis Wrote: Why not just use one of the inexpensive SPDIF HAT boards?
Hi Tim, this is a valid question and I think the best answer I can provide is "Because we can".  I just thought it was worth trying out to add digital output to a Pi Zero 2 W to allow a low cost integration of moOde into all of my AV receivers.  This may be of little interest to others, and I can't really speak to the overall sound quality because my test setup is just an AV receiver on my kitchen table with a couple small satellite speakers on top Big Grin
(03-26-2023, 05:00 PM)hifinet Wrote: Try twisting the unshielded pair of wires from the GPIO. The RCA is shielded, but the jumpers from the GPIO are not. Shortening the jumpers will help. Shielding the signal wire, with the shield grounded at the GPIO will help. If that doesn't work, add a 430R or 470R (1/8-1/4W) resistor inline with the signal wire (center of RCA), mounted close to the GPIO. There is likely too much noise on the signal line. The twisted pair will help to cancel noise from external sources, and the inline resistor will filter high frequency noise. If these efforts don't work, you will need a buffer on the GPIO. I initially had the problem with my prototype DIY I2S DAC HAT. With the resistors, I was able to use 10cm unshielded (and untwisted) jumpers from I2S GPIO to an external proto board. I don't have experience with S/PDIF. According to wikip, S/PDIF single ended uses 75 ohm coaxial shielded cable up to 10m length.
Thanks for the input, I've been able to get the setup with just two short wires to the connector working consistently without any issues playing through a test track that's about 5 minutes long.   I don't think interference is an issue in my case but for sure if I get everything working smoothly I'll definitely try to make a better permanent connection.
Reply
#8
Hi guys, i just entered this forum and yes, used "search" function and was like wow! another crazy dude tried to combine moode and raspdif! Awesome! 

I also made it work, no special requirements or cables etc. necessary. Only thing you need to do is to change /etc/mpd.conf like this: 

...
audio_output {
type "alsa"
name "ALSA Default"
device "raspdif"
mixer_type "none"
dop "no"
stop_dsd_silence "no"
thesycon_dsd_workaround "no"
}
...

-> sudo systemctl restart mpd

  • Output device shows HDMI (dosnt matter)
  • Volume type: Hardware/fixed
  • Output mode: direct (hw)

Where I'm stuck now is to get this setup to work with multi room config and that's where I could need some help, please. 
The Output is "active" (you can plug in a LED to the GPIO and GND and it lights up) but no signal is transmitted. 
Multiroom works with analoge output but not raspdif. I think I need to thange something in the mpd.conf but not no idea what and how.
Reply
#9
A quick look at the git repo and the ALSA configuration for raspdif uses a FIFO which is incompatible with the Multiroom feature in moOde which uses ALSA Loopback.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: