Jump to content

Transcoding/Encoding


Guest

Recommended Posts

I know transcoding (source file is compressed) or encoding (source file uncompressed) takes place within Poweramp sometimes twice. Once to convert to a higher bit depth for mastering with the powerful equalizer then again for the output to a lower bit depth unless you turn on float32 in the output settings and it outputs to float32 not 24bit (it seems to me Bluetooth always encodes/transcodes after the mastering for compatibility reasons but I could be wrong in certain situations). This disables dithering by keeping the bit depth of the output after mastering to 24 bits/float32 hence not needing dithering because no downsampling occurs. I know dithering is needed when downsampling to a lower bit depth but not from float32 to 24 bit because they have the same bit depth. However, after the source file has been transcoded or encoded for mastering Poweramp then does it again but shows a different format when on Bluetooth but does not on aux, USB DAC, or speaker. This obviously means the format has changed but does Poweramp always notify on a format change? For example, my source file is FLAC, I master it in Poweramp with float32 enabled to stop downsampling with dithering hence no quality loss, and then my output shows USB DAC or whatever output device I'm on without giving the current format. Does this mean that the output is the same format I started with hence in my scenario truly lossless being FLAC?

Edited by MWalton
Link to comment
Share on other sites

@MWalton Poweramp doesn't do any transcoding. If you mean sample bitwidth changes (and sample rate resampling) - that will happen depending on source track, Poweramp settings, Android device firmware/inner settings, connection and end device. As this pipeline is quite long, multiple bitwidth changes and resamplings may happen, where bitwidth changes are usually lossless (e.g. 16->32->16 is loseless conversion if done right), and sample rate conversions - no so much, due to resampling artifacts and filtering brought by not quality optimized resamplers.

Some of that information is available in Poweramp Audio Info popup, but conversions happening closer to end of chain are hidden from us (for example, LDAC end device silently switches between 48 and 96 khz sample rate depending on connection quality - and any distance more than 20cm from phone results in 48khz resampling in the end device).

 

Link to comment
Share on other sites

So your saying the transcoding/encoding for resampling takes place by the device not Poweramp even though the settings in Poweramp make an influence? For example, Bluetooth always ends in a format change for me obviously for compatibility. How can bitwidth 16 to 32 to 16 be lossless conversions? Downsampling always needs dithering based off my research which means there is some quality loss. Also would sample rate conversions introduce artifacts both on upsampling and downsampling? 

Edited by MWalton
Link to comment
Share on other sites

@maxmp Thanks for the help. I knew transcoding/encoding took place just got confused on what did it for resampling. Now I know it's the device. I understand what your saying about bitdepth now. I just got confused that dithering was still needed even though the audio resolution actually never changed from 16 to 32 to 16. Just like adding more bitrate from lower bitrates increases no quality just larger file sizes. In other words whether the resolution changed or not I thought based off what the resolution says (real or fake) dithering was needed. However, 32 to 16 to 32 would obviously require dithering once. I'll continue to do my research on dithering and resampling as I love my music truly lossless. 

Link to comment
Share on other sites

@maxmp please correct me if I'm wrong but going from 44.1 to 48 to 44.1 should be no introduction of resampling artifacts because the sampling rate never actually changed? However, 48 to 44.1 to 48 would cause resampling artifacts once from an actual change? Upsampling never causes artifacts because there is no data loss but with downsampling there is? Like I said please correct me if I'm wrong as I'm learning and you are very bright in tech. 

Link to comment
Share on other sites

To anyone wanting to change their Bluetooth audio codec please turn on developer options (go to settings, hit about phone, and tap build number 7 times) and search for Bluetooth audio codec. Depending on your ROM you can change to a different codec and hopefully aptX Lossless (available on some devices) that should be lossless assuming the environment isn't to busy interfering with the connection. I prefer wired such as a USB DAC or aux as it is truly lossless! Bluetooth is not for lossless lovers as the device transcodes/encodes to a compatible format for Bluetooth and the connection can prevent lossless playing even if converting from FLAC to aptX Lossless! 

Edited by MWalton
Link to comment
Share on other sites

Not going to clear up every remaining question you have, but this would be a relevant read for you: https://www.headphonesty.com/2020/03/bluetooth-audio-codecs-explained/#aptX_HD

 

All Bluetooth codecs involve compression at some point. Not all originally 1411kbps 16bit/44.1 kHz signals can fit in LDAC's 330kbps, 660kbps, or 990 kbps containers. aptX codecs all sit somewhere in between (352-576kbps) the first two possible LDAC bitrates.

 

Regarding resampling, Poweramp has SoX high quality resampler as an option (slightly more battery use but worth it) for cleanly calculating 44.1kHz and 48kHz multiples to your chosen output frequency.

Link to comment
Share on other sites

Thanks for the article. I'm actually talking about aptX Lossless available on limited amount of devices. Either way you confirmed why I have a distaste for Bluetooth. Even with aptX Lossless it doesn't guarantee lossless as I explained earlier and I prefer wired over it. 

https://www.whathifi.com/features/i-tried-aptx-lossless-bluetooth-and-yes-we-can-all-look-forward-to-it-with-caution

https://www.whathifi.com/advice/aptx-lossless-what-is-the-breakthrough-bluetooth-codec-how-can-you-get-it

Edited by MWalton
Link to comment
Share on other sites

18 minutes ago, MWalton said:

Thanks for the article. I'm actually talking about aptX Lossless available on limited amount of devices. Either way you confirmed why I have a distaste for Bluetooth. Even with aptX Lossless it doesn't guarantee lossless as I explained earlier and I prefer wired over it. 

https://www.whathifi.com/features/i-tried-aptx-lossless-bluetooth-and-yes-we-can-all-look-forward-to-it-with-caution

https://www.whathifi.com/advice/aptx-lossless-what-is-the-breakthrough-bluetooth-codec-how-can-you-get-it

Ah, I see (that a newer variant exists, bitrate of ~ 1Mbps).

As with all new standards, I hope manufacturers will pony up the licensing fees to support it.

Link to comment
Share on other sites

Agreed I couldn't imagine them not in time. The output device has to support it as well so you probably have to get new headphones/earbuds. However, at least people reading forums can change to a better bluetooth codec if their output device supports it as this is something I recently learned:)

Link to comment
Share on other sites

Re: the bit-depth change from 16-bit->32-bit->16-bit being potentially lossless.

Think of it like having a quality rating for something ranging from 1-5, which gets changed to a more detailed range of 1-10. So a value of 2 out of 5 now becomes 4 out of 10, and 3 out of 5 becomes 6 out of 10, etc. Assuming you don't add anything else (like an extra score of 3 or 7 out of 10) then you can convert those 4/10 and 6/10 scores completely losslessly back to 2/5 and 3/5.

Andre

Link to comment
Share on other sites

It seems android phones (not certain if all) like to resample to 48 kHz or multiples of it. Even if on hires output trying to change the sample rate its still defined by device with it being multiples of 48 kHz. There seems no way around this other than apps I refuse to go too that support bypassing this on your android device. However, my question still remains if upsampling to 48 kHz is lossy or lossless anyway. If Max could implement bypassing this it be great. However, if not the sound enhancement from the equalizer is not worth forsakening if he never does. It's certainly not a huge degrade in audio quality if it's lossy. 

Edited by MWalton
Link to comment
Share on other sites

4 hours ago, MWalton said:

It seems android phones (not certain if all) like to resample to 48 kHz or multiples of it. Even if on hires output trying to change the sample rate its still defined by device with it being multiples of 48 kHz.

This will depend on exactly what device you are trying to output to. Almost all devices use 48kHz for the speaker output. If the device still has an analog headphone jack, this could also be limited to 48kHz, but others (i.e. LG phones with Quad DAC) can still range up to 192kHz. Bluetooth wireless connections can be similarly locked to specific bit and sample rate pairings. And for USB connected devices, this can theoretically be upwards of 768kHz (or more?) for high end external DACs, but again this could be limited by the device.

The answer isn't using an app to circumvent this limit, but to ensure your device and any OS supports the range you want. Most vendors use a customized variation of the base Android OS. Some are better than others when it comes to the audio capabilities. Hardware and OS combination limits are unfortunately the reality here.

Link to comment
Share on other sites

Thanks for the reply. However, I'm talking about android phones automatically resampling to 48 kHz and multiples of it. The device automatically does this and Poweramp doesn't override it. This link below explains how apps can circumvent this problem and some media players already have. I hope Poweramp will join them. 

https://darko.audio/2021/07/tidal-is-quietly-rolling-out-a-bit-perfect-android-app/

Edited by MWalton
Link to comment
Share on other sites

36 minutes ago, MWalton said:

Thanks for the reply. However, I'm talking about android phones automatically resampling to 48 kHz and multiples of it. The device automatically does this and Poweramp doesn't override it. This link below explains how apps can circumvent this problem and some media players already have. I hope Poweramp will join them. 

https://darko.audio/2021/07/tidal-is-quietly-rolling-out-a-bit-perfect-android-app/

Are you looking for exceptions to this arbitrary rule? Because there are plenty.. Just seek out a device with stated support for the sample rates you want.

Poweramp doesn't lack the ability to "override" anything. Your device either supports the sampling rate via the chosen output method or it doesn't.

Poweramp just requires you to stick to one sampling rate or another (until manually changed at your discretion).

SoX resampler makes trivial work of the interpolation needed to be transparent. Ignoring the actual signal processing and just looking at ratios:

44100 × (16÷14.7) = 48000.

48000 × (14.7÷16) = 44100.

You can plainly see what here is L and M for the following method.

If the ratio of the two sample rates is (or can be approximated by) a fixed rational number L/M: generate an intermediate signal by inserting L − 1 zeros between each of the original samples. Low-pass filter this signal at half of the lower of the two rates. Select every M-th sample from the filtered output, to obtain the result.

Link to comment
Share on other sites

Android devices and the OS automatically resamples from 44.1 kHz to 48 kHz. In other words the current sample rate if a multiple of 44.1 kHz is resampled to the nearest multiple of 48 kHz. Why? I haven't quite understood or found the reason why. However, my device does support 44.1 kHz but selecting won't work because the sample rate is given by the device as his app says underneath the sample rate in output settings. Using a different app that bypasses the device and OS resampling automatically allowed 44.1 kHz which is what I want no resampling. I'm not looking for bitperfect playing as the equalizer in Poweramp is something I adore along with other features including the UI. I won't switch from Poweramp but I suggest reading into what bitperfect audio players can do. 

Link to comment
Share on other sites

My Galaxy s10+ does not on Lineage OS for microg (hires output not supported ln Custom ROM) and on my other s9+ I tested on hires output but does the same thing forces 48 kHz even if I try to force 44.1 kHz on aux/wired. It's all good though.

Link to comment
Share on other sites

It is the Samsung device that is locking your rates.

I have an iBasso DX160 digital audio player that uses Android 8.1 as the OS. I can choose any sample rate I prefer up to 384kHz, in 44.1k or 48k steps. You can see the current playback rate in the upper right status bar in the screenshots below. My LG G8 could do the same up to 192kHz. Even if I start with a 24bit/96kHz file.

074C8EEC-BA0D-4D2D-A08A-8CE2724069B6.thumb.jpeg.10d45999503204e93cc4c6f89e6c0172.jpeg

 

E10C533E-4896-4191-A091-1E31803B249A.thumb.png.3c247757ea01be7dd1d70cd4b5f9620f.png

7D40D70E-05F7-499C-A79C-865B8517B97B.thumb.png.d492b0b2374186972f0b6199a65aac6f.png

D5729FC0-6D63-4573-81A1-9B811A956149.thumb.png.bcabf4c45a35f469f8765db83134c283.png

FC916A12-8E13-4FEB-94F1-6A5A0DCAECE5.thumb.jpeg.32894ee8f4fdbc0e078212ff60c6709b.jpeg

44297380-D8F5-42E9-BBA3-1F7727E9B47D.thumb.png.24645a857e3d8c77b03de3b8bbe448e6.png

Edited by MotleyG
Link to comment
Share on other sites

Your device allows changing output frequency then. Keep in mind other players allow no resampling on USB DAC and other outputs but when using my phone speaker output my device fails to not resample (not certain how the media player bypasses resampling yet on certain outputs). Anyways thought I'd clarify myself. The goal is to get no resampling on the USB DAC and all other outputs as not all devices allow what yours can (assuming yours can go no resampling on all outputs). Not willing to buy digital audio player just for that:) Also I don't want to mislead people the device and OS are doing this resampling. However, I dont know if it's just the ROM causing resampling or both the device too. My guess is Andre is correct about just the ROM causing it in phones. Most phones are to high tech to be limited at a certain sample rate in my opinion and I say that being ignorant to what my phone allows. It's whatever. Also everything I've said please verify as I do make mistakes and the last thing I want is to be bloating the forums with wrong info. 

Edited by Mitch Walton
Link to comment
Share on other sites

Seems I've got some things wrong as this thread explains a lot about what I was talking about. Something maxmp doesn't want to introduce and he explains why he won't follow apps like Neutron or USB Audio Player Pro that allows no resampling. It's certainly a mouthful but give it a read. 

Link to comment
Share on other sites

TL;DR

Those of us with (comparatively niche) DAPs from the likes of iBasso, FiiO, etc., would benefit from this. (Max says as such, that the methods employed in UAPP and Neutron work fine in these cases). However since the vast majority has smartphones and OEM limitations (locking bit depths to sample rates in the case of Samsung), it ends up being more trouble than it's worth.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...