epoch1970 wrote: 
> I'm thinking of a player that allows playing from digital stream and
> from analog in. I thought of a simple physical input switch, but then I
> thought of the CDplayer plugin, that transcends normal CD playing by
> making it multi-room.
> All right then, let's make the switch in Alsa somehow. 
> I'm playing with this:
> - pi3, pCP 3.20
> - analog out
> - a crap C-Media USB thinggy that has mic in
> - "alsaloop -v -P plughw:0,0 -C plughw:1,0 -t 500"
> With this ridiculous 0.5ms latency constraint (-t 500), running the
> alsaloop executable instead of some loop plugin directly in Alsa (?),
> CPU usage is under 10%. Of course lip-sync is perfect between a speaker
> driven by the Pi and a phone playing a video and outputting audio with a
> cable. 
> Before that I was running with latency 250ms, lip-sync was already more
> than perfect and CPU load about nil.
> 
> That makes me wonder if sending the input stream to LMS and then back to
> the players, allowing synced playback, could be worth a try?
> I assume that would require using Alsa to send the stream with JACKd,
> receive it on the LMS server and process it with this plugin.
> 
> I've virtually no experience with JACK.
> Do you have an idea of what kind of latency the end-result would have?
> Lip-sync (~250ms) is desirable, but interactive controls response
> (~500ms?) would still be interesting, I think.
> What about the processing chain? JACK+WaveIn?

I don't really understand what you are trying to do - it looks too
complicated and should be simplified.  Pulseaudio can do networked audio
(i.e source on different system and Pulse make it appear on LMS server
audio device) - it was discussed at some point in last few years.
Another way that was tested was using netcat to send a pure PCM stream
from one system to another.

Waveinput does nothing special - it is a command line which produces PCM
stream that feeds it into LMS as if it cam from a remote source.

If you can produce a command line with Jack or whatever that productes a
CD type PCM stream on stdout - then all you do is put your command into
the custom-command.conf file.

Any latency and delay will have two components.
1. LMS - time to send PCM stream to player and amount of data buffered
in player before audio start playing.  Syncing audio and video is 
2. Delay introduced by ALSA , Pulseaudio , Jack, netcat or whaever -
this is where big delays occur (often by some hard to control internal
buffers) and this is what you have to measure and reduce before messign
about with LMS & Waveinput


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=49584

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to