yashsingh1/xdaforums huggingface dataset:
[LG V30 Guides, News, & Discussion] TheDannemand:
I apologize for the tardy response. Swamped these days.

1) Ahh. I don't use cross fading myself, but I see what you mean, it's a valid request.

2) My entire music collection is carefully curated as well (manually edited tags) and I've never seen any problems with UAPP handling albums correctly. You could try Clearing the database and Scan again. But you probably already did...

I suggest you write to the Dev about both issues. You can either email info@extreamsd.com or post in their support thread on Head-Fi. I've found them very response to user requests and issues.

BTW, also check this recent Head-Fi post by [MENTION=9305992]csglinux[/MENTION]: It appears LG really screwed up the Quad DAC in Pie, so it now re-samples even some HiRes files (which all play perfectly on Oreo from most apps). It also sabotages UAPP in the process.

I don't know why LG is so hellbent on messing up music playback, when they spend good money putting a high-end audiophile grade DAC in their phones :rolleyes:
[LG V30 Guides, News, & Discussion] BROKEN1981:
I did send an email to the Dev. We tested a few things and then I guess he quickly made a newer version of the app and gave me a download link. It's a beta but he seen what the issue was and fixed it. Total time with emails and download link took about 30 minutes. I never expected the guy to reply so fast that a few minutes would go by with me not seeing his new email.

Awesome support! Just wish the UI would be gesture-based. Having to back out of a current playing album is a pain in the butt. PowerAmp definitely did this correctly.
[LG V30 Guides, News, & Discussion] DooMLoRD77:
I've edited three config files from US998 30b which I attached to this post. With this mod I always get 24bit and 44.1kHz output through Mixer. Now I can't hear the noise, but I'm curious if anyone can so please test it after making a system backup in TWRP. The mod contains the files without any script.

[MENTION=832590]TheDannemand[/MENTION] and everyone who is interested.

I was trying to get direct output, but it's maybe impossible. I tried to have direct output instead of deep_buffer, but only UAPP wanted to use direct and other apps "moved" to primary output. Also the primary output does not tolerate any messing cause it's a p...y. So I'm not able to do what even [MENTION=9305992]csglinux[/MENTION] couldn't.

Solutions:

1) It's not possible due to most apps just don't support direct output even if we convert it to 24bit on the fly. Apps can use primary output instead of deep buffer but direct is like an isolated thing lol. I did enough tests with policy files to get bored of it.

2) Maybe I can try replacing or somewhat in mixer_paths_tavil.xml in vendor/etc to get the direct output. (?)

3) We need to do hard modifications in source codes and codec driver. Or just accept this Mixer and use it with some mod. :D So sad.
[LG V30 Guides, News, & Discussion] csglinux:
Huge thanks to you, DoomLoRD77, for your efforts on this. Major props also to TheDanemmand, who has been relentlessly pursuing this little problem with LG's phones.

So, I took your config files, and voila, they work as promised, at least according to audio_flinger:

Output thread 0xeb1034c0, name AudioOut_15, tid 1804, type 0 (MIXER):

I/O handle: 21

Standby: no

Sample rate: 44100 Hz

HAL frame count: 1792

HAL format: 0x6 (AUDIO_FORMAT_PCM_24_BIT_PACKED)

HAL buffer size: 10752 bytes

Channel count: 2

Channel mask: 0x00000003 (front-left, front-right)

Processing format: 0x6 (AUDIO_FORMAT_PCM_24_BIT_PACKED)

That's the good news. The bad news... for reasons I don't completely understand, all the exact same re-sampling artifacts are there, just as audible as before. (I think most of us are using the same test track here - Speak to Me, from The Dark Side Of The Moon.) Either audio_flinger is misreporting, or being fooled, or there's something else going on here that I don't understand.

I'd mentioned to some of the other headfi folks that Amazon's new lossless streaming service doesn't display these digital artifacts (it still doesn't sound quite as good as Tidal to my ears, but the SQ gap is much closer). Amazon re-samples everything on Android to 48 kHz using 32-bit float. I would have thought doing no resampling at all and shifting to 24-bit for the digital volume control would be enough, but apparently not. My best guess is those extra zeros we're packing into those remaining 8 bits aren't actually being used by the digital volume control.
[LG V30 Guides, News, & Discussion] TheDannemand:
Thanks a ton for your efforts here and for sharing these modified files!

Unfortunately I won't be able to test them myself, both because my V30 is still on Oreo (and I have no plans to update it yet) and because I am currently unrooted, waiting for LG to approve a warranty claim (at which they're dragging their feet).

I think with your work and [MENTION=9305992]csglinux[/MENTION]' feedback we have established that there is something going on beyond just the re-sampling of the Mixer. The fact your changes eliminated the noise you were hearing, but NOT the artifacts csglinux has reported, would indicate that maybe we have two different problems going on. And so far only playing DIRECT (bypassing the Mixer) solves both problems.

Re your point (3) I did actually spent quite a bit of time studying the source code for the ESS codec driver for the various LG models (es9218p.c and es9218p.h in the kernel source code). Interestingly, 44100 is NOT one of the sample rates listed in there as being supported. The rates and formats listed below are references in the snd_soc_dai_driver structure towards the end of the driver, with which the codec driver declares its capabilities. I've been puzzled how DIRECT play of 24/44 is even possible given this fact. But audio_flinger claims to do it -- and it sounds great when it does.

#define ES9218_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | \
SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \
SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 | \
SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_384000 ) //|SNDRV_PCM_RATE_352800 TODO for dop128

#define ES9218_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | \
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE | \
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE)

I am completely swamped with work at the moment, so I have no time at all to play (neither play music NOR tinker with my phone). I promise I will contribute more actively again once I have more time AND once I have a phone I can root.

Once again thanks a lot for your contribution! :good::good::good:
[LG V30 Guides, News, & Discussion] DooMLoRD77:
You're welcome. Yes, I played the Speak To Me song at the volume level of 10/75 from about 0:14 to 0:40. It can be possible that it's just misreporting, but it's weird that you hear the same artifacts and I hear just very very little noise instead of big. So we hear 2 different thing separately. From my experience it seems that the extra 8 bits are used for volume control. Or 24bit is more accurate for interpolating as you wrote something on head-fi. I will see more results later with GR09.

Also, thank you for the efforts and for this test!

I can mention an app for 16/44.1 lossless it's called D**zl#ad*r (replace "*" with "e" and "#" with "o"). I know it's not great to get files for free but I can play it offline through direct. It's for Android too and there are some funny facts how it can work.

You're welcome, too. Something is really weird about the Mixer as there is 2 kind of issue, indeed. I will just probably give up this soon for now, but I'm thankful for the support as I could achieve a small improvement.

If it's really a declaration as you said and I looked a bit into it then it's also weird how it can support 44.1 without resampling.

To replace Tidal offline there is an app above but it requires re-downloading everything. I solved it by automation. Life is just short to be always a good boy:silly:
[LG V30 Guides, News, & Discussion] Eneen:
Looks like deep-buffer is used for high latency low power output and this is ok for music. As I'm new I can't post proper link here, but googling "android audio deep buffer" gives answer.

To enable deep-buffer for music we need:

adb shell setprop audio.deep_buffer.media 1

So it looks like without it android is still using 48kHz from primary output and still resamples internally or I'm missing something. I own V30 but I'm not rooted yet so can't test this.

In the meantime I've looked into policy and there's additional MQA policy available. Maybe UAPP is using it to play MQA on LG?

I've also tried to use 16bit direct output from UAPP and there's noise on all recordings when V30 volume is low and I set my amplifier to almost full. This is unrealistic scenario but easily shows 16bit limitation. [MENTION=9309275]DooMLoRD77[/MENTION], [MENTION=832590]TheDannemand[/MENTION] could you check this UAPP setting if it plays through mixer or directly: MQA enabled and 16 bit hi-res driver audio format. Could tou also check if setting mixer into 32bit float mode works? This setting works for UAPP.
[LG V30 Guides, News, & Discussion] DooMLoRD77:
You are right that mixer is using 48khz upsampling either through deep buffer or primary output or call it whatever. Deep buffer for music is by default. Where did you found that MQA policy?

I can't help you now as my V30's motherboard is dying and it will take some time to replace it, but I can tell you that modifying the mixer to give 32bit output gives nothing just mute sound and lagging youtube playback maybe because of buffer size or idk.

You can have 32bit with direct, of course. Anyway, what recordings are giving noise? Vinyl? 16 bit does not have limitations like that. I guess you hear the noise generated by AVC in the Quad DAC. It has a high SNR but not enough if you amplify it with don't know what at max volume. I just assume that. I appreciate your interest.
[LG V30 Guides, News, & Discussion] Eneen:
Recordings from Tidal app (except MQAa) and when UAPP is set into 16bit mode inside "HiRes driver audio format" give noise. When I change this option to "Auto" then noise is gone. To hear it I just set sound level to 1/70 (lowest possible) and amplify rest on my amp. I'm not sure it's due to digital volume control or something else, but noise is there and I'm still above my NAD C372 noise level (100dB). How to check output path? I can do it myself but haven't found how...

If music is using deep buffer then your solution is very elegant IHMO and should work. Is youtube also using deep_buffer? Is deep_buffer always used or only when phone is sleeping?

MQA policies are inside /vendor/audio_output_policy.conf: direct_pcm_16_mqa and direct_pcm_24_mqa. As I see /etc/audio_policy.conf is depreciated but looks like /vendor/etc/audio_output_policy.conf is used and there are two different audio_policy_configuration.xml files. Is there documentation for android audio available?
[LG V30 Guides, News, & Discussion] DooMLoRD77:
I think direct does not support 16bit. It can be DVC or just the not really perfect mixer makes noise or what kind of interpolation error. You should have SDK platform tools to check it. Start inside an adb connection in cmd. Command: "adb shell" or "./adb shell" then "dumpsys media.audio_flinger" and it should read much thing about path and so on.

YouTube uses deep_buffer if it's available. It's used when music is played not only when sleeping. Primary is more like for notifications maybe some games. Sorry, what solution? LoL. 24bit modification?

I will check that policies again, thanks.
[LG V30 Guides, News, & Discussion] DooMLoRD77:
1. OK. A simple question and they may add support for V30 or rather not.

2. That would be great.

3. That modification got my speaker muted so I kept primary output unchanged for the speaker and removed speaker from devices list from deep_buffer. Apps were working in primary instead of deep_buffer when speaker was on.

4. Don't know. I think resampling is done every time regardless of output parameters.

I really don't understand many things. Do you hear that another noise what csglinux hears even after modification? I believe that the issue is due to DVC and imperfection of mixer resampling.
[LG V30 Guides, News, & Discussion] Eneen:
I've tried to ask about direct output rather then just V30. Will prepare petition.

I'm still not rooted as I need to send my V30 for warranty battery replacement. I've checked UAPP resampler using android audio and noise is present too, both on ESS and standard DAC.

So is muted speaker effect of deep_buffer only mod or primary output mod or both?
[LG V30 Guides, News, & Discussion] DooMLoRD77:
The speaker was muted both on deep_buffer and primary when it was modded to 24bit output as I remember.

Happy New Year!:cool:
[LG V30 Guides, News, & Discussion] Eneen:
Thx! Happy New Year for you too! :cool:

Have you tried to change speaker device into AUDIO_FORMAT_PCM_24_BIT_PACKED?

There's one more thing to try: copy all profiles of "mixPort name="direct_pcm" role="source" into deep buffer. I think mixing may be done on input or mixer can't convert between 16 and 24_packed and this is why speaker is muted.
[LG V30 Guides, News, & Discussion] DooMLoRD77:
The speaker was playing 24bit or at least it displayed that. I don't get it what do you mean by change speaker device to 24_BIT_PACKED. Can you explain that?

I think I have tried that, but I'm not sure as I got confused at the end of my experiments.

Again I don't understand :D. Input...? If it can't convert between 16 and 24 for speaker then it could not for jack too. Or what?
[LG V30 Guides, News, & Discussion] nikothebarber:
Could you guys make this a module for magiks?
[LG V30 Guides, News, & Discussion] Eneen:
You have changed "Wired Headphones" and "Wired Headset" into AUDIO_FORMAT_PCM_24_BIT_PACKED, but speaker is still AUDIO_FORMAT_PCM_16_BIT. 16bit audio is converted by android into 24bit and when you switch from jack into speaker 24bit data is indeed sent to speaker from deep_buffer but it can't play it. Have you tried to leave "Wired... " at default 16bit and only copy all content of "direct_pcm" into "deep_buffer" section? Actually AUDIO_OUTPUT_FLAG_DIRECT and AUDIO_OUTPUT_FLAG_DEEP_BUFFER are, except audio format, main differences between streams.

Ofc here comes question: how UAPP plays 24bit data when there is no 24bit output device available inside config (before change)? It looks like this is where their "hi-res driver" takes job and it works (https://www.extreamsd.com/index.php/hires-audio-driver) by checking available "direct" flag and using it. "Hires driver flags" setting matches nicely audio_output_policy.conf content including "mqa" flag. Maybe <devicePorts> section from audio_policy_configuration.xml is meant to configure mixer to tell where audio should be sent to after mixing? If this is true then we need to reconfigure whole mixer into 24bit to avoid muted speaker problem...

I can't find any useful documentation how to configure android audio, are you aware of any?

I've also checked and I get bit louder hiss-noise from qualcomm dac and no noise when playing through UAPP. I'm almost certain that what I hear is 16bit noise floor not resampling as my NAD is set to max volume and I've got my head "inside" speaker ;)
[LG V30 Guides, News, & Discussion] TheDannemand:
There is no actual mod yet to bypass the mixer for 16/44 streams -- although [MENTION=9309275]DooMLoRD77[/MENTION] and [MENTION=10341937]Eneen[/MENTION] have been making great progress. (Thank you, guys!)

That includes this post by DoomLoRD77, which worked to let the Mixer output in 44.1KHz. But the artifacts that we have attributed to upsampling were still present, leading to the conclusion that something else is afoul when playing through the Mixer, even when it doesn't re-sample. Possibly precision loss due to DVC. Or maybe something else.
[LG V30 Guides, News, & Discussion] BROKEN1981:
I'm just glad this is still going.
[LG V30 Guides, News, & Discussion] Eneen:
[MENTION=9309275]DooMLoRD77[/MENTION], this is partial repost from head-fi forum:

I've found nice test to see (and hear): https://lastique.github.io/src_test/

When you play speex-1 you can clearly hear artifacts at the end of last sweep at about 1:02, but other files are clean. I've played original 44/16 on android and no way to hear this either so android has to use quite fine resampler. Noise is of course present. I encourage you to try. What I'm trying to tell is that if we have doubts that this solution is working or not regarding resampling we actually need to either measure it or have very good and obvious listening test.
[LG V30 Guides, News, & Discussion] nikothebarber:
Had this been been abandoned?
[LG V30 Guides, News, & Discussion] TheDannemand:
Well yes, and no: Members [MENTION=10341937]Eneen[/MENTION] and [MENTION=9309275]DooMLoRD77[/MENTION] have made huge efforts, for which they deserve much credit. And as posted in the thread, some improvements were discovered, even though the ultimate goal of achieving system wide Direct path for 16/44 has not been accomplished. It was shown that Direct path 16/44 is possible by forcing the MQA flag on, but that has other undesirable affects, probably caused by the MQA digital filter.

I am admittedly less engaged than I used to be when I started this thread: A nerve disease killed much of my hearing last hear, so I don't listen to music anymore -- except a little bit from time to time, at very low volume and heavily volume normalized, just to keep my hearing nerves from dying. So the topic is mostly academic for me at this point.

I am still convinced that there has to be a way to accomplish this, but maybe only with significant changes to the ROM or kernel.

Sauron Narsil is a Magisk module which professes to accomplish something along our goals. But since audio_flinger logging is not available when using it, it is not clear to me exactly what it does on our LG phones. Somebody with intact hearing would have to check it :o
[LG V30 Guides, News, & Discussion] zyhk:
I don't have any LG V30, but I'm interested in this topic. I think the most simple way to achieve it is using another phone to control UAPP (DLNA player) on LV V30 remotely like "Spotify Connect" or something. Spotify app or else on another phone can stream 44.1kHz/16bit audio by using AirAudio (DLNA (WAV) server mode).

AirAudio as it is uses "loudness enhancer" and converts 44.1kHz to 48kHz and more over 44.1kHz again. However, modified r_submix_audio_configuration.xml for 44.1kHz and audio_effects.xml (eliminating effects, e.g. loudness_enhancer, equalizer, base_boost, reverb, virtualizer, visualizer, etc.) helps AirAudio to stream near bit-perfectly. (Perhaps AirAudio uses "peak limiter", so -1.5dB gain adjustment is needed.)

If another phone is DRC enforced, edit audio_policy_configuration.xml to disable DRC. Amazon Music app looks at the sampling rate of "primary output" and determines its output sampling rate to the output remote submix virtual device. Avoiding the app's resampling from 44.1kHz to 48kHz and down to 44.1kHz, Edit audio_policy_configuration.xml to change the "primary output" sampling rate to 44.1kHz.
[LG V30 Guides, News, & Discussion] TheDannemand:
Hi zyhk,

Thank you for your input. I apologize for taking a few days to respond.

I see what you're saying. I never used UAPP's UPnP/DLNA features, and I don't know if it still performs its bit-padding when playing in this mode. But I don't see why it wouldn't.

Of course for local files, we always just play directly from UAPP, and there is no problem. So this is only relevant for streaming services who are able to play as UPnP/DLNA servers. It's a good idea.

I let my streaming subscriptions expire for the reasons I mentioned in my last post. My 3 month Amazon HD deal just expired about a week ago. I never actually used it, since Amazon HD doesn't recognize the HiRes capabilities at all. It see 48KHz as the max sample rate on LG phones and resamples everything to that internally -- and THEN sends it through the Mixer for good measure.

If I still had it, I might try the mods you suggested. I'll certainly be interested if others try it.

Thanks again for sharing this! :good:
[LG V30 Guides, News, & Discussion] Miku_Claudiu21:
i don't know how or why, but i think i bypassed this by mistake by using a high resolution convolver on jamesdsp. didn't even expect it sounding better, just did one for fun (i had one of 44.1 to eq left and right channels separatelly and made one version of it of 352), and the goddamn highs (over 10khz) are so crisp now, changing back to the old one feels like listening to a low quality mp3 lmao
[LG V30 Guides, News, & Discussion] Darkaedenxxx:
Can you please provide us details? Thanks!
[LG V30 Guides, News, & Discussion] RlTd:
Upsample to 384kHZ, you will get almost perfect 44.1kHZ result. The cost is jitter and harmonic wave.

https://xdaforums.com/t/mod-guide-r...mi-redmi-note-9s-family.4265823/post-85325445
[LG V30 Guides, News, & Discussion] TheDannemand:
I apologize for the late response.

Personally I don't want to do that. I want bit-perfect, Direct path to the Quad DAC, so it can perform internal oversampling as part of its noise shaping.

No doubt it IS possible to perform software upsampling that rivals that of the DAC, such as with HQPlayer for Windows and similar software. But it is NOT trivial and generally very CPU intensive.

So far UAPP is still our best bet: It plays bit-perfect through Direct path both to USB DACs and to the internal Quad DAC. This also preserves MQA for those who want to use that.
[LG V30 Guides, News, & Discussion] 1400700226:
Interesting discussion, marked
[LG V30 Guides, News, & Discussion] zyhk:
Hi, People being interested in resampling distortion. I made a magisk module Audio Misc. Settings which makes your phone to have no resampling distortion for usual music streaming services.

This changes AudioFlinger's resampling quality from stop band attenuation 90dB (cut off 100%) to 140dB (cut off 91%) , i.e. a mastering quality. Additionally, this disables AudioFlinger's effects framework, so its audio quality can be as same as that of UAPP.
[LG V30 Guides, News, & Discussion] xicotorro:
Hello and excuse my ignorance. I recently entered the world of dacs and other things. I am trying to test your module and I would like to know how I can modify it or if just installing it is enough. Greetings and have a nice life.
[LG V30 Guides, News, & Discussion] zyhk:
If your phone uses a Snapdragon SoC, you probably need drc-remover for disabling DRC on all audio outputs. Just installing audio-misc-settings and optionally drc-remover is enough for usual music lovers, I think. (Don't forget to disable battery optimizations described in its README.md)

You can listen to music by usual music streaming apps in a quality being comparable to that of hires. audio apps.
[LG V30 Guides, News, & Discussion] xicotorro:
Hi, I've been using the modules you've created, I've removed all the battery optimizations I could, but when there's an mqa playing, there's some pretty annoying distortion. This does not happen with other formats. Thanks for the reply. Have a nice life.
[LG V30 Guides, News, & Discussion] zyhk:
I guess your mqa player app toggles a DRC switch from "off" to "on" for transferring data to be bit-perfect as usual (switching from "on" to "off"), but the switch has already been toggled to "off" by drc-remover.
[LG V30 Guides, News, & Discussion] xicotorro:
Thank you so much. I keep testing the differences. Regards.
[LG V30 Guides, News, & Discussion] xicotorro:
I disabled DRC-remove and the distortion is still there. As I said, only in mqa files from the tidal app, I haven't tried in other applications since my main intention is to have bit perfect in offline files from tidal. I disabled the battery optimizations required by the audio misc settings module and still no change. Anyway, thank you very much for the answers and the modules. :)