Trying to pipe audio from a 3.5mm speaker output of a PC through the aux in input on the AmpliPi, but don’t seem to be getting any output on my zones.
Verified that I can play music through the zones using the built-in music stream.
Verified that the PC is outputting audio through the 3.5mm speaker output jack.
Verified using a multimeter in continuity mode that all three conductors are good with no shorts or breaks.
Am I missing something regarding configuration (using the Android app from the play store)?
Unfortunately we haven’t integrated those inputs as selectable streams yet. However you can manually create a stream for the aux/optical inputs by following two steps.
First create the stream. Click on the API link at the bottom of the AmpliPi web UI, find the “Create Stream” section, click on the “Example” tab, and replace the text in the box with:
{"name": "Input Playback", "type": "fileplayer", "url": "alsa://plughw:cmedia8chint,0"}
The name can be whatever you’d like and you can change it later in the web UI. Once done click on the “Try” button. After refreshing the web UI page you should now be able to select a stream called “Input Playback” or whatever you called it.
Next switch the audio chip’s input to 3.5mm aux or S/PDIF optical. Only one of the two inputs can be used at a time. SSH into the AmpliPi and run the following command for setting the aux as input:
amixer -D usb71 set "PCM Capture Source" "Line"
or this command for selecting optical:
amixer -D usb71 set "PCM Capture Source" "IEC958 In"
In my initial testing the “PCM Capture Source” setting seems to persist even after power loss, so if you only need the aux input you can set it once and never have to SSH in again! And of course we will work on getting these inputs better integrated into the WebUI as soon as we can. An issue was recently added to GitHub regarding the aux/optical inputs:
Thank you! I was able to get the aux in following your instructions. My understanding is that the aux in signal gets mixed in with input source channels 2 - 4 as well. I tried setting source 2 to rca, but I don’t get the aux in signal mixed in.
Currently no mixing is done anywhere in AmpliPi. For the RCA inputs this is due to hardware limitations. For the inputs from the Pi mixing could be added in software but hasn’t been implemented yet. To get an idea of the hardware limitations this signal diagram shows a good high-level overview.
The slightly confusing part here is that the Aux input, while analog, is really a “digital” source since it comes from the Raspberry Pi. The Aux in comes from the Cmedia USB DAC/ADC, goes into the Pi, then either gets played back out to the same Cmedia USB DAC/ADC as an output this time (digital sources 2-4) or to the I2S DAC (digital source 1).
So what you WANT to be able to do is set source 2 to the SAME “Input Playback” stream you created, but our sound setup using ALSA isn’t capable of that right now. All we can do is 1-to-1 mappings of input audio to output audio. Just yet another thing we’d love to be able to improve in the future!
Now with all of that said, I’m not sure exactly what you are trying to do. If you just want more zones to play what’s coming in from the Aux port then simply change those zones to source 1. It sounds kinda like you want an “announcement” though, which would get mixed in to whatever is playing on other sources. Some basic PA-like abilities were added with Feature Request: PA · Issue #67 · micro-nova/AmpliPi · GitHub and further improvements are planned in the future Feature: PA Improvements · Issue #163 · micro-nova/AmpliPi · GitHub but @linknum23 is the expert on that.
Okay, sounds good! Thanks for the explanation and the quick response!
Thanks for the instructions – simple to follow and seemed to direct S/PDIF input to the defined stream.
However, after about a minute of successful playback, the audio started stuttering. Everything works fine from same device/stream via RCA. Any idea what could be going on?
Also, I didn’t force anything, but S/PDIF cables no long click into port solidly, and screw directly above seemed lose and actually fell down into my rack, so I may actually have a physical/port problem here too? Cable clicks into other amps just fine.
Any ideas what might be going on or how to fix? Feeling like “I have a screw loose”
As of now we really haven’t testing the aux or optical inputs other than to verify the hardware is functional, so it’s possible there’s a software bug we haven’t ran into. Since you can use RCA, I’d recommend just using that.
As for the screw problem, maybe @jason has an idea for you?
Hey @skoledin,
Yes, so we had a few issues with the screw that holds the SPDIF connector in place. We had been using an M3x5mm self-tapping screw for this port and it worked reasonably well. However, some of the latest SPDIF connectors we received had a bit wider/deeper of a taper on the front side of the hole. This resulted in the M3x5mm screw not making enough contact with the connector to keep it in place over time. Once we noticed the problem, we switched over to either an M3x8mm or M3x10mm self-tapping screw. I need to check on the exact length we settled on but if memory serves it was one of these two. It looks like you unit went out with the shorter screw and the SPDIF connector with the deeper tapered hole, sorry for that. If you send me a PM I can get your details and get a replacement screw out to you.
Jason
Thanks! Anything I can do to help debug/triage the stuttering issue with s/pdif input?
The use of VLC seemed to fix rate conversion issue for us in the past, but in case there’s a lingering issue with that do you know what sample rate is being output from your player?
I’m not sure really, and can’t physically plug in the optical until I get a new screw to secure the port.
In my case, it just happened to be SoundCloud streaming to Google Audio Cast, so no idea really what the audio looked like when it eventually went out optical.
Once I can get things connected again, I’ll take a closer look and try a wider variety of sources.
Do you know of any way to see what the digital audio characteristics are once it’s inside the amplipi? Is there a vlc log or a way to query vlc about what it is seeing?
Is there a vlc log or a way to query vlc about what it is seeing?
For right now there is no output logged by the FilePlayer since it was built to prototype announcements on.
You can test this by ssh’ing into your amplipi though:
- Set tab Audio “source” 1’s input to the blank inpuit
- Run this command in ssh
cvlc -A alsa --alsa-audio-device ch0 alsa://plughw:cmedia8chint,0 vlc://quit
- Play audio to the spdif input
- Check out the output of the command line vlc interface, hopefully it is useful
Does this still apply to software release 0.1.8?
I’m running 0.1.8 and SPDIF isn’t working for me (hadn’t tried it on 0.1.7).
My input configuration looks like this;
{
"id": 1005,
"name": "Input Playback",
"type": "fileplayer",
"url": "alsa://plughw:cmedia8chint,0"
}
And device configuration on the pi looks like this;
amixer -D usb71 get “PCM Capture Source”
Simple mixer control ‘PCM Capture Source’,0
Capabilities: enum
Items: ‘Mic’ ‘Line’ ‘IEC958 In’ ‘Mixer’
Item0: ‘IEC958 In’
I’ve validated the input is working on another amp (and tried a pi reboot).
Any ideas?
Yeah We still need to add some plumbing for better logging support.
At first glance that configuration looks correct.
I’m assuming you tried the check mentioned above? (Can't get aux in working - #12 by linknum23)
What kind of input is it? We haven’t done extensive testing on the decoding modes are supported on the spdif input. For instance we have not tested this with any Dolby Digital inputs although our current assumption is that they are not supported.
I’ve got a Sonos Port connected via digital coax which is converted to optical using one of these; https://www.amazon.co.uk/gp/product/B00LPHJMII/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1
I tried the check above and am seeing no output;
cvlc -A alsa --alsa-audio-device ch0 alsa://plughw:cmedia8chint,0 vlc://quit
VLC media player 3.0.12 Vetinari (revision 1.0.6-1618-g917488b78)
[0066f7e0] main interface error: no suitable interface module
[005dab58] main libvlc error: interface "globalhotkeys,none" initialization failed
[0066f7e0] dummy interface: using the dummy interface module...
According to this forum post Sonos Port- digital out format? | Sonos Community the Sonos Port output PCM.
I just tested various input formats on the SPDIF input, using another CM6206 chip (USB External 7.1 Channel Audio Adapter - Vantec Thermal Technologies). I tried 44.1kHz and 48kHz sample rates and verified on the AmpliPi using this awesome little program GitHub - vestom/cm6206ctl: Control utility for CM6206 based USB sound cards. REG3 bits 8:7 show the SPDIF input sample rate that was detected. I tried varying my output’s bit depth between 16, 24, and 32 bits but unless I hook up a scope I don’t see a way to verify what’s actually what’s being sent over the wire (or rather optical fiber).
At a 48kHz sample rate everything work great using all tested bit depths of s16le, s24le, s24_32le, and s32le.
At a 44.1kHz sample rate I am getting audio but it crackles a bit. I suspect this might actually be a problem on the sender’s side but I’ll need to get some more SPDIF output devices to try.
So for your case @mako I’d expect at least SOME audio to be received. Your output from VLC at least is what we’d expect since there are no errors other than the GUI failing to start. You can try adding -vv
to @linknum23’s command to see more info:
cvlc -vv -A alsa --alsa-audio-device ch0 alsa://plughw:cmedia8chint,0 vlc://quit
The problem is if there is NO input at all there aren’t any warnings or errors… And unfortunately we don’t have either that Sonos Port or your adapter to try. Have you verified any other devices can receive audio from your coax to optical converter? Also I’m not sure the power requirements of that converter but are you powering it from one of AmpliPi’s USB ports?
I tested the output from the coax to optical converter with the sonos attached to my old amp (Vantage 850D-DA) which plays fine.
Thanks for the verbose flag, sadly it doesn’t show anything useful (to my eyes) simply looping these messages;
[0115d178] main audio output debug: inserting 6047 zeroes
[0115d178] main audio output warning: playback too early (-46434): down-sampling
[0115d178] main audio output warning: timing screwed (drift: -99234 us): stopping resampling
[0115d178] main audio output warning: playback too early (-105993): down-sampling
[0115d178] main audio output warning: playback way too early (-125881): playing silence
[0115d178] main audio output debug: inserting 6042 zeroes
[0115d178] main audio output warning: playback too early (-46431): down-sampling
[0115d178] main audio output warning: timing screwed (drift: -99410 us): stopping resampling
[0115d178] main audio output warning: playback too early (-106010): down-sampling
[0115d178] main audio output warning: playback way too early (-125949): playing silence
I’ve just tried ‘Line’ input via the 3.5mm jack and that is working ok (caveat: the quality is pretty awful via the Line input).
I know this is an old thread, but implementing the Line In 3.5mm jack as an input just launched in the 0.3.2 version of software.