Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only getting noise output #17

Closed
m-hearn opened this issue Dec 23, 2015 · 8 comments
Closed

Only getting noise output #17

m-hearn opened this issue Dec 23, 2015 · 8 comments

Comments

@m-hearn
Copy link

m-hearn commented Dec 23, 2015

client and server are connected, tested with /dev/urandom.

mopidy config is writing to /tmp/snapfifo, but only delivering noise.

starting and stopping the server audio in mopidy does start/stop noise at client end.

local client (on same server as mopidy) also produces the same issue.

[running on Pi2 server and PiB on client]

  • tried upgrading to dev instance of mopidy - from 1.1.1 - no improvement
@badaix
Copy link
Owner

badaix commented Dec 24, 2015

Hi,
what version of snapcast are you using? Any specific release? Master or develop branch?
Can you try to directly feed in a live radio station without any Mopidy or MPD:
In a root shell (sudo su) on the server Pi do:
wget -q -O - http://1live.akacast.akamaistream.net/7/706/119434/v1/gnl.akacast.akamaistream.net/1live |mpg123 -w - - > /tmp/snapfifo
You might need to install mpg123 (sudo apt-get install mpg123).

@bcm0
Copy link

bcm0 commented Dec 27, 2015

Hi,
when I directly launch gst-launch-0.10 (which is used by mopidy) and pipe a musicfile to /tmp/snapfifo I only hear noise, but using gst-launch-1.0 fixes the problem.
Hopefully mopidy will switch to gstreamer-1.0 in the near future.

gst-launch-0.10 filesrc location=~/sample.mp3 ! decodebin ! audioconvert ! audioresample ! filesink location=/tmp/snapfifo

gst-launch-1.0 filesrc location=~/sample.mp3 ! decodebin ! audioconvert ! audioresample ! filesink location=/tmp/snapfifo

@maosuyun2009
Copy link

Hi,
I have a wav file, I want to know, When I Test with command like "cat 123.wav > /tmp/snapfifo", I only get noise, I think snapclient just read pcm data from snapfifo, when i try to cat 123.wav to snapfifo, why can't play it?

@Lakritzator
Copy link

@maosuyun2009 this is a different thing as the initial ticket was created for.

You are mixing up PCM, a digital representation of audio, with WAV as a file format.
A WAV file (https://en.wikipedia.org/wiki/WAV) can contain PCM, but is not necessary
PCM.

It also would be very inefficient to have uncompressed audio in a WAV file, so currently a lot of them are compressed. And PCM is not compressed audio data!

Even if you have PCM in the WAV, you still have a header and this might cause horrible noise.

In short PCM != WAV!

@maosuyun2009
Copy link

@Lakritzator Thanks, In oss architechture, i always cat wav file to /dev/oss, so I just think i can do it like oss

@badaix
Copy link
Owner

badaix commented Dec 28, 2015

@maosuyun2009 actually for "normal" (containing PCM data) WAV-files cat will work. A requirement for the cat method is that the wave header size is a multiple of 4 (usually it's 44 bytes). Otherwise left/right and upper/lower bytes are mixed up and cause noisy audio.

@prospo
Copy link

prospo commented Mar 2, 2016

Found a solution. Working on Ubuntu 15.10 (Wili Werewolf), mopidy 2.0.0-1 (jessie), snapcast (git-master) with standard gst-launch-1.0

From my /etc/mopidy/mopidy.conf in the audio section:
[audio]
audioresample ! audioconvert ! audio/x-raw,rate=44100,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo

edit: changed the output string, it didn't play well between 48KHz and 44.1KHz input.

@badaix
Copy link
Owner

badaix commented Mar 10, 2016

added this to the Readme.md (3a4bfbd)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants