PDA

View Full Version : Transcoding requirements on a Pi?



s2kiwi
2017-06-12, 13:38
Hi all,

I'm setting up a multi-room system with 8 zones/players. I was asking elsewhere in the forum if 8 is realistic and the answers generally come back to bandwidth and whether the players can natively transcode the streams.

I have no idea on the transcoding question so thought I'd ask if anyone can point me in the right direction.

My setup includes various versions of squeezelite running on multiple pi's:

Pi A+ (1 player)
Pi1 (original pi) (1 player)
2x Pi B+ (2 players each)
Pi3 (1 player)
One squeezebox classic 3


They are running a mix of onboard DAC's and USB DACs (some pis running 2 players with one of each). Most onboard DAC's are capable of 24khz 192 but one USB DAC is only capable of 48KHz max at 16 bit stereo.

The bits I really don't have clear in my head are:
Is that last DAC likely to cause me issues?
Will any transcoding needed for that lower DAC fall onto the Pi to complete, or will the server need to do that transcoding?
If the server does the transcoding, am I right in thinking all players sync'd will get the same lower quality stream?
Will the hardware of the different types of Pi be similar enough in their nature to play nicely with numerous players (I'm assuming yes). How about with the squeezebox in the mix?

pippin
2017-06-12, 14:40
There is no need to transcode at all if you are playing to a Pi.
The resampling from 192 kHz to 48 kHz shouldn't be a problem either, the Pi only has to do it for its own player.

drmatt
2017-06-12, 15:42
Codec support on the Pis depends on the software stack not hardware, and the SB3 is likely to be your limiting factor in terms of codec support anyway.

And yes if you sync all players and one or more of them has a playback bitrate limit applied then the whole group will receive the same bitrate limited stream. LMS will generally calculate the common capability of a group and use that.

s2kiwi
2017-06-12, 21:16
Codec support on the Pis depends on the software stack not hardware, and the SB3 is likely to be your limiting factor in terms of codec support anyway.

And yes if you sync all players and one or more of them has a playback bitrate limit applied then the whole group will receive the same bitrate limited stream. LMS will generally calculate the common capability of a group and use that.

I'm not sure I understand that comment on the software stack vs hardware...

Do you meant that (ignoring the SB3) running Squeezelite on the Pi's means they will all appear to the server as being able to handle basically anything... and the Pi will handle any codec downgrading needed? Meaning all the other PI's will still play at the better quality?

Or will they present the soundcard limitation back to the server and it'll downgrade everything.

(sorry for the n00b Q's)

Mnyb
2017-06-12, 21:32
Could be a potential problem i LMS also runs on the PI . Is LMS running elsewhere it handles the transcoding on that system ( and thats systems limitiations apply ) .

PI can transcode just fine but if several separate needs arise to older players etc or if you use some obscure formats , ie in cases where you don't sync it migth not have the capacity .

For it's own needs it's fast enough .

But the general case is still that player report thier capabilty to the server and servers has to come up with a streams that fits all in the sync group .

So if the SB3 is in the sync group . the server has to feed all an 24/48 stream . But the transcoding load is on the LMS server machine

And yes wifi can be a limiting factor especially when it's not good as in rpi3 they are known for problems with thier internal wifi .

A good safe starting point is when the LMS server runs on robust fast enough system wired to your network .
If a problem arise with one player you can probably find a workaround.

s2kiwi
2017-06-12, 21:40
But the general case is still that player report thier capabilty to the server and servers has to come up with a streams that fits all in the sync group .

So if the SB3 is in the sync group . the server has to feed all an 24/48 stream . But the transcoding load is on the LMS server machine


I'm running a dedicated linux 2.4Gz machine (ethernet connected) for the LMS so no problems there.

What about if the SB3 isn't in the group - will everything just run at the native file stream and the Pi will do the downgrading where needed (or does the Pi tell the server the hardware capabilities)?

Mnyb
2017-06-12, 22:47
I'm running a dedicated linux 2.4Gz machine (ethernet connected) for the LMS so no problems there.

What about if the SB3 isn't in the group - will everything just run at the native file stream and the Pi will do the downgrading where needed (or does the Pi tell the server the hardware capabilities)?

Good to hear i run annintel nuc nowadays as server ( time to edit My sig )

For the other Q i havent any USB DAC's to try with it's a big maybe from me and i do buy try to buy downloads <24/96 so i have very few 24/192 or "better" ( as I find them pointless) that would be transcoded by one of My rpi3 as ive use that for My main meridian rig and ive set up squeezelite to do 24/96 (-3db) for everything there as it handles 24/96 max .

These are kind of fringe cases :) serving 24/192kHz synced to dozens of players .

Try to not fiddle with LMS so that it sends PCM/WAV to all players instead of FLAC , if you just don't meddle with the file types settings your good .
It's a popular myth that WAv sounds better but you basically gets double the bandwith requirements and it's usually not a problem excepts you wants to sync 9 players and FLAC uses much less bandwith and player buffers will last longer all works in your favour .

drmatt
2017-06-13, 01:38
I'm not sure I understand that comment on the software stack vs hardware...

Do you meant that (ignoring the SB3) running Squeezelite on the Pi's means they will all appear to the server as being able to handle basically anything... and the Pi will handle any codec downgrading needed? Meaning all the other PI's will still play at the better quality?

Or will they present the soundcard limitation back to the server and it'll downgrade everything.

(sorry for the n00b Q's)
Ok fair question. To provide more details;

- the software (squeezelite) is the same on all the Pis so they all offer the same file formats natively supported.
- the different hardware DACs only restricts the maximum sample rate and bits-per-sample. I.e. 96khz/24bit. All will be more than capable of playing CD audio uncompressed (44k/16b).

So when you sync them all LMS will find the lowest common denominator of:
- the source file or stream's format, resolution and bitrate
- each player's supported format, resolution and bitrate.

The default is for LMS to provide the raw source to all players unmodified, assuming that all players have told it they can play that format, resolution and bitrate. End points won't do resampling or transcoding, LMS will produce ONE stream for the whole group in whatever format, resolution and bitrate drops out of the above process.

As I said, the wildcard is the SB3. Does it support MP3 or flac? I don't remember. If not you may find LMS being forced to stream full rate PCM audio to all players at the same time. You can do the maths on that!

Transcoded from Matt's brain by Tapatalk

s2kiwi
2017-06-13, 01:50
Brilliant thanks DrMatt, I appreciate the help.

The reality is that while FLAC is total overkill for 7 or the 8 zones, it is how my music is stored. Part of why I'm trying to get my head around this is so I know what will happen under different scenarios.

Based on this, if I place the SB3 to drive the hallway, it'll only be used when lots of the house is also being used and we are on the go... It'll then force transcoding and significantly reduce the bandwidth needed across the house when lots of players are running.

Then when the kids go to bed and the hall/bedrooms/outside are off I can sit in the lounge and listen to FLAC on the proper system.

I was going to use the cheaper DAC on a pi to trigger the transcoding, but now I know that won't work :)

Sound like a plan?

pippin
2017-06-13, 02:46
Don't do that. FLAC is fine and you've got enough bandwidth unless you do crazy stuff like streaming 384kHz sample rate material and such.
Transcoding to MP3 takes a lot of CPU power and will likely create more issues than it solves.
FLAC is perfect for streaming.

If you really want to save bandwidth make sure the server is connected through a wired LAN not WiFi, the players are way less important (they only take a single stream).

drmatt
2017-06-13, 03:56
Lame encoding a single stream for a single group of players will run fine on a Pi. If you want separate streams all separately encoded then you might run into trouble. I might suggest setting a bandwidth limit on the SB3 to force stepping down the bitrate when it joins the group. Then unsync that one and LMS will drop back to sending flac everywhere.

Transcoded from Matt's brain by Tapatalk

pippin
2017-06-13, 04:22
But if the SB3 is alone on its 2.4GHz network, where's the problem? Still enough bandwidth to stream HD video so why not 48kHz FLAC?

We are talking about 750kbit/s here. If you don't get that out of a WiFi network then it's so broken that even the control connection will probably no longer be stable.

drmatt
2017-06-13, 04:30
Well that's on the assumption that all the Pi are wired. Maybe I missed that statement. The LMS server would be sending 9 times that stream out, which still isn't much in reality I agree, about 7 Mbit/s.

Transcoded from Matt's brain by Tapatalk

Julf
2017-06-13, 08:10
Well that's on the assumption that all the Pi are wired.

Or on a 5 GHz wireless network.

drmatt
2017-06-13, 12:28
I was looking forward to having a separate 5ghz WiFi at home, then I noticed it doesn't go through walls as well as 2.4ghz... and now I find i actually don't use it much..

Julf
2017-06-13, 12:57
I was looking forward to having a separate 5ghz WiFi at home, then I noticed it doesn't go through walls as well as 2.4ghz... and now I find i actually don't use it much..

I agree, it doesn't go through walls as well, but when you have 35 neighboring networks, you still appreciate 5 GHz...

s2kiwi
2017-06-13, 14:00
Given all the various feedback, I think I'm just going to retire the SB3 out of the mix entirely.

For the sake a Pi Zero + DAC I think it'll just make everything simpler to be running on similar hardware :)

Thanks guys!

pippin
2017-06-13, 15:28
Really, don't . All of this is not a problem and the SB3 is a really nice player. Very reliable ne good sound.

s2kiwi
2017-06-13, 15:33
Really, don't . All of this is not a problem and the SB3 is a really nice player. Very reliable ne good sound.

So the bit I didn't mention is one channel seems to have blown on the SB3 (and I don't have the skills to diagnose/replace what I assume will be a dodgy cap) so I was limited where in the house I could use it anyway (as it'll have to be mono only).

pippin
2017-06-13, 15:33
Oh, ok, now THAT is a reason to retire it, indeed.

Mnyb
2017-06-13, 19:39
So the bit I didn't mention is one channel seems to have blown on the SB3 (and I don't have the skills to diagnose/replace what I assume will be a dodgy cap) so I was limited where in the house I could use it anyway (as it'll have to be mono only).

Yes that's the cap problem there are treads with pictures .
It has digital outs these will be unaffected by this problem that only affects the analog out. Is there a zone where something should hook up to a HT reciever or DAC .

If you retire it sell it as spare parts on this forum , someone would probably pick it up and repair it.

s2kiwi
2017-06-14, 01:58
Yes that's the cap problem there are treads with pictures .
It has digital outs these will be unaffected by this problem that only affects the analog out. Is there a zone where something should hook up to a HT reciever or DAC .


So, the mental debate I've had going is this... The only place I have which would take a digital input is the main room. I feel nervous about using the SB via digital in there as all the FLAC material will need to be transcoded on the fly on the 'good' system which feels backward. I'm running dual amps into some sensitive EPOS speakers so I'd really like the best quality... or am I over thinking that. Will a CD quality stream on the SB2 via digital be worse/better/the same as an RCA connected Hifiberry DAC? Will I even notice?

Writing this I suspect it'll come down to the sound signatures of the various devices and how they work together, so I'll just have to get an optical cable and give it a go...?

Mnyb
2017-06-14, 02:06
So, the mental debate I've had going is this... The only place I have which would take a digital input is the main room. I feel nervous about using the SB via digital in there as all the FLAC material will need to be transcoded on the fly on the 'good' system which feels backward. I'm running dual amps into some sensitive EPOS speakers so I'd really like the best quality... or am I over thinking that. Will a CD quality stream on the SB2 via digital be worse/better/the same as an RCA connected Hifiberry DAC? Will I even notice?

Writing this I suspect it'll come down to the sound signatures of the various devices and how they work together, so I'll just have to get an optical cable and give it a go...?

SB3 supports 24/48 kHz .

But if you sync the SB3 in another place to your rpi3 it to will oućuit 24748 anyway in those cases .

In most cases music is 16/44.1 anyway as most records are of this quality....

My personal view better than redbook is debatable i was a stern believer in hirez for a decade . but the actual case is that CD is good enough for human hearing .
Note that the actual master used for hirez release could be very different so it apples an oranges no guarantee which actually better.
The real test downsample a so called hirez file yourself and try hear the diffrence :)

s2kiwi
2017-06-14, 03:05
SB3 supports 24/48 kHz .

But if you sync the SB3 in another place to your rpi3 it to will oućuit 24748 anyway in those cases .

In most cases music is 16/44.1 anyway as most records are of this quality....

My personal view better than redbook is debatable i was a stern believer in hirez for a decade . but the actual case is that CD is good enough for human hearing .
Note that the actual master used for hirez release could be very different so it apples an oranges no guarantee which actually better.
The real test downsample a so called hirez file yourself and try hear the diffrence :)

I alos with you that CD is good enough for anything but extreme cases. I mainly only keep FLAC out of principle. Some of the early MP3's I had access to were terrible quality so I picked a lossless format as my standard to avoid such issues. In saying that half the FLAC's are off CD's with modern day 'maximum volume' mixing which has killed the dynamic range... but I digress.

My main concern concerns are not the raw resolution, but whether transcoding will introduce artifacts and the general sound signature (which is personal preference anyway). I think I'll give it a go and see :)

Mnyb
2017-06-14, 03:47
I alos with you that CD is good enough for anything but extreme cases. I mainly only keep FLAC out of principle. Some of the early MP3's I had access to were terrible quality so I picked a lossless format as my standard to avoid such issues. In saying that half the FLAC's are off CD's with modern day 'maximum volume' mixing which has killed the dynamic range... but I digress.

My main concern concerns are not the raw resolution, but whether transcoding will introduce artifacts and the general sound signature (which is personal preference anyway). I think I'll give it a go and see :)

Just give at try , digital ouputs should be transparent .

And the SoX transcoding library LMS uses is known to be good , it should not assert any particular signature . Unless you want to (its endlessly tweakable ) .

Of topic if you want to experiment with your DAC an rpi3 with a digital output board can be fun.
You can then set squeezelite to output the maximum rate that the dac can handle for any file and say set the volume -3dB while doing it if you for example suspects that your dac does not handle intersample overs properly or use esoteric filters like apodising.
Agread that could lead to endless tweaking for nothing . But a Pi can do that if your inclined to try such things.

Julf
2017-06-14, 03:49
I feel nervous about using the SB via digital in there as all the FLAC material will need to be transcoded on the fly on the 'good' system which feels backward.

I don't really understand the problem. Why would the FLAC material need to be transcoded?

[edit: had forgotten about the "one USB DAC is only capable of 48KHz max at 16 bit stereo" constraint]

Mnyb
2017-06-14, 03:56
I don't really understand the problem. Why would the FLAC material need to be transcoded?

If you aquire 24/196 dowloads to replace your mp3's .

Funny thing music bussines for downloads , you can buy total cr*p low rate mp3's or total overkill hirez :) normal CD standard FLAC is less common ?