USB Audio Player PRO (UAPP): 24- and 32-bit playback, ubiquitous USB audio support for Android
Mar 6, 2021 at 11:55 AM Post #4,516 of 6,195
Hi All, I'm trying to get UAPP working correctly on the Sony NW-A105 but when enabling the hi-res driver and running logcat I can see that with no flags set UAPP is using the android audio limit of 48/16. If I enable 'Direct' I can see that the full 192/24 (sample file rate) is passed to the driver however it fails to play unless I set the audio format to 16-bit. All other formats fall back to 48/16. Any idea what I'm missing? I can't help but feel I'm so close to getting this working bit perfect
 
Last edited:
Mar 6, 2021 at 12:16 PM Post #4,517 of 6,195
Hi All, I'm trying to get UAPP working correctly on the Sony NW-A105 but when enabling the hi-res driver and running logcat I can see that with no flags set UAPP is using the android audio limit of 48/16. If I enable 'Direct' I can see that the full 192/24 (sample file rate) is passed to the driver however it fails to play unless I set the audio format to 16-bit. All other formats fall back to 48/16. Any idea what I'm missing? I can't help but feel I'm so close to getting this working bit perfect

What happens if you try 32 bit? As far as I know, UAPP isn't supposed to work (correctly) on Sony Android DAPs. But I'm glad to see someone trying!
 
Mar 6, 2021 at 12:26 PM Post #4,518 of 6,195
What happens if you try 32 bit? As far as I know, UAPP isn't supposed to work (correctly) on Sony Android DAPs. But I'm glad to see someone trying!
32-bit gives it a go, staggers a few seconds then plays in 192/32 however the app becomes unstable and play/pause fails to actually stop the music! 32-bit float generates a whole world of pain, refuses to play, gets stuck in an error loop and the track skips through at a random fast rate. I'm sure the answer is to pass the audio at 24-bit (or at track native bitrate) but that option doesn't seem to exist.

Edit

Using Hi Res Driver with the following settings is stable and passing the sample rate correctly..
HiRes driver flags : Direct
HiRes driver Audio Format : 16-bit
Bit Perfect Mode : ON (Required for MQA Playback)
Upsampling : OFF
Buffer Size : 1310072 frames (65536 also seems to work)

Now obviously this is not bit perfect but is the closest I can get it working so far. I've spent 4 hours staring at terminal code whilst trying to get this to work, I think I need a vodka now.

If anyone has any tips I'm all ears. Also, is 192/16 to 192/24 significant or worth further effort?

Code sample showing sample rate being passed correctly to hi res driver:


Code:
03-06 17:45:11.642 10030 11670 D SoundServiceImpl: HandleCtrl: HighRes(Red)
03-06 17:45:11.642 10030 11670 I SoundServiceImpl: Track[HighRes(Red)] received CtrlPacket: Play
03-06 17:45:11.643 10030 11670 D IzmEffectProcessor: [HighRes(Red)] Open
03-06 17:45:11.644 10030 11670 I Fundamentals: ---------- AudioConfig[OutputId[HighRes(Red)]] ----------
03-06 17:45:11.644 10030 11670 I Fundamentals:   f_samp: 192000
03-06 17:45:11.644 10030 11670 I Fundamentals:   format: S16_LE
03-06 17:45:11.644 10030 11670 I Fundamentals:   num_of_ch: 2
03-06 17:45:11.644 10030 11670 D Alsa    : Create
03-06 17:45:11.644 10030 11670 D AlsaForNxpLpa: AlsaForNxpLpa
03-06 17:45:11.644 10030 11670 D AlsaForNxpLpa: Open
03-06 17:45:11.652 10030 11670 D AlsaForNxpLpa: SetHwParams
03-06 17:45:11.652 10030 11670 D AlsaForNxpLpa: [hw:1,2] buffer_time_near: 20000000 -> 20000000
03-06 17:45:11.652 10030 11670 D AlsaForNxpLpa: [hw:1,2] periods_near: 40 -> 40
03-06 17:45:11.665 10030 11670 D AlsaForNxpLpa: SetSwParams
03-06 17:45:11.665 10030 11670 I Alsa    : ---------- HwParams[hw:1,2] ----------
03-06 17:45:11.665 10030 11670 I Alsa    : rate: 192000
03-06 17:45:11.665 10030 11670 I Alsa    : format: S16_LE
03-06 17:45:11.665 10030 11670 I Alsa    : channels: 2
03-06 17:45:11.665 10030 11670 I Alsa    : period_frames: 96000
03-06 17:45:11.665 10030 11670 I Alsa    : period_time: 500000
03-06 17:45:11.665 10030 11670 I Alsa    : period_bytes: 384000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_frames: 3840000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_time: 20000000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_bytes: 15360000
03-06 17:45:11.665 10030 11670 I Alsa    : ---------- SwParams[hw:1,2] ----------
03-06 17:45:11.665 10030 11670 I Alsa    : start_threshold: 192000
03-06 17:45:11.665 10030 11670 I Alsa    : stop_threshold: 3840000
03-06 17:45:11.665 10030 11670 I Alsa    : avail_min: 0
03-06 17:45:11.665 10030 11670 I Alsa    : start_delay: 0
03-06 17:45:11.665 10030 11670 I Alsa    : stop_delay: 0
03-06 17:45:11.665 10030 11670 I Alsa    : ---------- HwParams[ShallowParams[hw:1,2]] ----------
03-06 17:45:11.665 10030 11670 I Alsa    : rate: 192000
03-06 17:45:11.665 10030 11670 I Alsa    : format: S16_LE
03-06 17:45:11.665 10030 11670 I Alsa    : channels: 2
03-06 17:45:11.665 10030 11670 I Alsa    : period_frames: 96000
03-06 17:45:11.665 10030 11670 I Alsa    : period_time: 500000
03-06 17:45:11.665 10030 11670 I Alsa    : period_bytes: 384000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_frames: 192000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_time: 1000000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_bytes: 768000
03-06 17:45:11.665 10030 11670 D AlsaForNxpLpa: [hw:1,2] UpdateBufferCtrlMode: Shallow
03-06 17:45:11.685  3387  3850 I AddressedMediaPlayer: null queue from com.extreamsd.usbaudioplayerpro, constructing single-item list
03-06 17:45:11.738  3387  3850 I AddressedMediaPlayer: null queue from com.extreamsd.usbaudioplayerpro, constructing single-item list
03-06 17:45:11.738  3387  3850 V Avrcp   : Send track changed
 
Last edited:
Mar 6, 2021 at 12:51 PM Post #4,519 of 6,195
32-bit gives it a go, staggers a few seconds then plays in 192/32 however the app becomes unstable and play/pause fails to actually stop the music! 32-bit float generates a whole world of pain, refuses to play, gets stuck in an error loop and the track skips through at a random fast rate. I'm sure the answer is to pass the audio at 24-bit (or at track native bitrate) but that option doesn't seem to exist.

Edit

Using Hi Res Driver with the following settings is stable and passing the sample rate correctly..
HiRes driver flags : Direct
HiRes driver Audio Format : 16-bit
Bit Perfect Mode : ON (Required for MQA Playback)
Upsampling : OFF
Buffer Size : 1310072 frames (65536 also seems to work)

Now obviously this is not bit perfect but is the closest I can get it working so far. I've spent 4 hours staring at terminal code whilst trying to get this to work, I think I need a vodka now.

If anyone has any tips I'm all ears. Also, is 192/16 to 192/24 significant or worth further effort?

Code sample showing sample rate being passed correctly to hi res driver:


Code:
03-06 17:45:11.642 10030 11670 D SoundServiceImpl: HandleCtrl: HighRes(Red)
03-06 17:45:11.642 10030 11670 I SoundServiceImpl: Track[HighRes(Red)] received CtrlPacket: Play
03-06 17:45:11.643 10030 11670 D IzmEffectProcessor: [HighRes(Red)] Open
03-06 17:45:11.644 10030 11670 I Fundamentals: ---------- AudioConfig[OutputId[HighRes(Red)]] ----------
03-06 17:45:11.644 10030 11670 I Fundamentals:   f_samp: 192000
03-06 17:45:11.644 10030 11670 I Fundamentals:   format: S16_LE
03-06 17:45:11.644 10030 11670 I Fundamentals:   num_of_ch: 2
03-06 17:45:11.644 10030 11670 D Alsa    : Create
03-06 17:45:11.644 10030 11670 D AlsaForNxpLpa: AlsaForNxpLpa
03-06 17:45:11.644 10030 11670 D AlsaForNxpLpa: Open
03-06 17:45:11.652 10030 11670 D AlsaForNxpLpa: SetHwParams
03-06 17:45:11.652 10030 11670 D AlsaForNxpLpa: [hw:1,2] buffer_time_near: 20000000 -> 20000000
03-06 17:45:11.652 10030 11670 D AlsaForNxpLpa: [hw:1,2] periods_near: 40 -> 40
03-06 17:45:11.665 10030 11670 D AlsaForNxpLpa: SetSwParams
03-06 17:45:11.665 10030 11670 I Alsa    : ---------- HwParams[hw:1,2] ----------
03-06 17:45:11.665 10030 11670 I Alsa    : rate: 192000
03-06 17:45:11.665 10030 11670 I Alsa    : format: S16_LE
03-06 17:45:11.665 10030 11670 I Alsa    : channels: 2
03-06 17:45:11.665 10030 11670 I Alsa    : period_frames: 96000
03-06 17:45:11.665 10030 11670 I Alsa    : period_time: 500000
03-06 17:45:11.665 10030 11670 I Alsa    : period_bytes: 384000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_frames: 3840000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_time: 20000000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_bytes: 15360000
03-06 17:45:11.665 10030 11670 I Alsa    : ---------- SwParams[hw:1,2] ----------
03-06 17:45:11.665 10030 11670 I Alsa    : start_threshold: 192000
03-06 17:45:11.665 10030 11670 I Alsa    : stop_threshold: 3840000
03-06 17:45:11.665 10030 11670 I Alsa    : avail_min: 0
03-06 17:45:11.665 10030 11670 I Alsa    : start_delay: 0
03-06 17:45:11.665 10030 11670 I Alsa    : stop_delay: 0
03-06 17:45:11.665 10030 11670 I Alsa    : ---------- HwParams[ShallowParams[hw:1,2]] ----------
03-06 17:45:11.665 10030 11670 I Alsa    : rate: 192000
03-06 17:45:11.665 10030 11670 I Alsa    : format: S16_LE
03-06 17:45:11.665 10030 11670 I Alsa    : channels: 2
03-06 17:45:11.665 10030 11670 I Alsa    : period_frames: 96000
03-06 17:45:11.665 10030 11670 I Alsa    : period_time: 500000
03-06 17:45:11.665 10030 11670 I Alsa    : period_bytes: 384000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_frames: 192000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_time: 1000000
03-06 17:45:11.665 10030 11670 I Alsa    : buffer_bytes: 768000
03-06 17:45:11.665 10030 11670 D AlsaForNxpLpa: [hw:1,2] UpdateBufferCtrlMode: Shallow
03-06 17:45:11.685  3387  3850 I AddressedMediaPlayer: null queue from com.extreamsd.usbaudioplayerpro, constructing single-item list
03-06 17:45:11.738  3387  3850 I AddressedMediaPlayer: null queue from com.extreamsd.usbaudioplayerpro, constructing single-item list
03-06 17:45:11.738  3387  3850 V Avrcp   : Send track changed

Oddly enough, it seems to work for MQA tracks at 32 bit and bitperfect=on

Code:
03-06 12:49:14.370  3091  6115 I Alsa    : ---------- HwParams[hw:1,2] ----------
03-06 12:49:14.370  3091  6115 I Alsa    : rate: 88200
03-06 12:49:14.370  3091  6115 I Alsa    : format: S32_LE
03-06 12:49:14.370  3091  6115 I Alsa    : channels: 2
03-06 12:49:14.370  3091  6115 I Alsa    : period_frames: 44100
03-06 12:49:14.370  3091  6115 I Alsa    : period_time: 500000
03-06 12:49:14.370  3091  6115 I Alsa    : period_bytes: 352800
03-06 12:49:14.370  3091  6115 I Alsa    : buffer_frames: 1764000
03-06 12:49:14.370  3091  6115 I Alsa    : buffer_time: 20000000
03-06 12:49:14.370  3091  6115 I Alsa    : buffer_bytes: 14112000
03-06 12:49:14.370  3091  6115 I Alsa    : ---------- SwParams[hw:1,2] ----------
03-06 12:49:14.370  3091  6115 I Alsa    : start_threshold: 88200
03-06 12:49:14.370  3091  6115 I Alsa    : stop_threshold: 1764000
03-06 12:49:14.370  3091  6115 I Alsa    : avail_min: 0
03-06 12:49:14.371  3091  6115 I Alsa    : start_delay: 0
03-06 12:49:14.371  3091  6115 I Alsa    : stop_delay: 0
03-06 12:49:14.371  3091  6115 I Alsa    : ---------- HwParams[ShallowParams[hw:1,2]] ----------
03-06 12:49:14.371  3091  6115 I Alsa    : rate: 88200
03-06 12:49:14.371  3091  6115 I Alsa    : format: S32_LE
03-06 12:49:14.371  3091  6115 I Alsa    : channels: 2
03-06 12:49:14.371  3091  6115 I Alsa    : period_frames: 44100
03-06 12:49:14.371  3091  6115 I Alsa    : period_time: 500000
03-06 12:49:14.371  3091  6115 I Alsa    : period_bytes: 352800
03-06 12:49:14.371  3091  6115 I Alsa    : buffer_frames: 88200
03-06 12:49:14.371  3091  6115 I Alsa    : buffer_time: 1000000
03-06 12:49:14.371  3091  6115 I Alsa    : buffer_bytes: 705600
 
Mar 6, 2021 at 12:55 PM Post #4,520 of 6,195
Oddly enough, it seems to work for MQA tracks at 32 bit and bitperfect=on

Code:
03-06 12:49:14.370  3091  6115 I Alsa    : ---------- HwParams[hw:1,2] ----------
03-06 12:49:14.370  3091  6115 I Alsa    : rate: 88200
03-06 12:49:14.370  3091  6115 I Alsa    : format: S32_LE
03-06 12:49:14.370  3091  6115 I Alsa    : channels: 2
03-06 12:49:14.370  3091  6115 I Alsa    : period_frames: 44100
03-06 12:49:14.370  3091  6115 I Alsa    : period_time: 500000
03-06 12:49:14.370  3091  6115 I Alsa    : period_bytes: 352800
03-06 12:49:14.370  3091  6115 I Alsa    : buffer_frames: 1764000
03-06 12:49:14.370  3091  6115 I Alsa    : buffer_time: 20000000
03-06 12:49:14.370  3091  6115 I Alsa    : buffer_bytes: 14112000
03-06 12:49:14.370  3091  6115 I Alsa    : ---------- SwParams[hw:1,2] ----------
03-06 12:49:14.370  3091  6115 I Alsa    : start_threshold: 88200
03-06 12:49:14.370  3091  6115 I Alsa    : stop_threshold: 1764000
03-06 12:49:14.370  3091  6115 I Alsa    : avail_min: 0
03-06 12:49:14.371  3091  6115 I Alsa    : start_delay: 0
03-06 12:49:14.371  3091  6115 I Alsa    : stop_delay: 0
03-06 12:49:14.371  3091  6115 I Alsa    : ---------- HwParams[ShallowParams[hw:1,2]] ----------
03-06 12:49:14.371  3091  6115 I Alsa    : rate: 88200
03-06 12:49:14.371  3091  6115 I Alsa    : format: S32_LE
03-06 12:49:14.371  3091  6115 I Alsa    : channels: 2
03-06 12:49:14.371  3091  6115 I Alsa    : period_frames: 44100
03-06 12:49:14.371  3091  6115 I Alsa    : period_time: 500000
03-06 12:49:14.371  3091  6115 I Alsa    : period_bytes: 352800
03-06 12:49:14.371  3091  6115 I Alsa    : buffer_frames: 88200
03-06 12:49:14.371  3091  6115 I Alsa    : buffer_time: 1000000
03-06 12:49:14.371  3091  6115 I Alsa    : buffer_bytes: 705600

do you get any audio drops when playing? I can get it to play at 192/32 (bit perfect off) but unstable, I'll try again with bit perfect on. We must be close.
 
Mar 6, 2021 at 12:59 PM Post #4,521 of 6,195
do you get any audio drops when playing? I can get it to play at 192/32 (bit perfect off) but unstable, I'll try again with bit perfect on. We must be close.
Oddly enough, it seems to work for MQA tracks at 32 bit and bitperfect=on

Code:
03-06 12:49:14.370  3091  6115 I Alsa    : ---------- HwParams[hw:1,2] ----------
03-06 12:49:14.370  3091  6115 I Alsa    : rate: 88200
03-06 12:49:14.370  3091  6115 I Alsa    : format: S32_LE
03-06 12:49:14.370  3091  6115 I Alsa    : channels: 2
03-06 12:49:14.370  3091  6115 I Alsa    : period_frames: 44100
03-06 12:49:14.370  3091  6115 I Alsa    : period_time: 500000
03-06 12:49:14.370  3091  6115 I Alsa    : period_bytes: 352800
03-06 12:49:14.370  3091  6115 I Alsa    : buffer_frames: 1764000
03-06 12:49:14.370  3091  6115 I Alsa    : buffer_time: 20000000
03-06 12:49:14.370  3091  6115 I Alsa    : buffer_bytes: 14112000
03-06 12:49:14.370  3091  6115 I Alsa    : ---------- SwParams[hw:1,2] ----------
03-06 12:49:14.370  3091  6115 I Alsa    : start_threshold: 88200
03-06 12:49:14.370  3091  6115 I Alsa    : stop_threshold: 1764000
03-06 12:49:14.370  3091  6115 I Alsa    : avail_min: 0
03-06 12:49:14.371  3091  6115 I Alsa    : start_delay: 0
03-06 12:49:14.371  3091  6115 I Alsa    : stop_delay: 0
03-06 12:49:14.371  3091  6115 I Alsa    : ---------- HwParams[ShallowParams[hw:1,2]] ----------
03-06 12:49:14.371  3091  6115 I Alsa    : rate: 88200
03-06 12:49:14.371  3091  6115 I Alsa    : format: S32_LE
03-06 12:49:14.371  3091  6115 I Alsa    : channels: 2
03-06 12:49:14.371  3091  6115 I Alsa    : period_frames: 44100
03-06 12:49:14.371  3091  6115 I Alsa    : period_time: 500000
03-06 12:49:14.371  3091  6115 I Alsa    : period_bytes: 352800
03-06 12:49:14.371  3091  6115 I Alsa    : buffer_frames: 88200
03-06 12:49:14.371  3091  6115 I Alsa    : buffer_time: 1000000
03-06 12:49:14.371  3091  6115 I Alsa    : buffer_bytes: 705600
I've just tried 32-bit with bit perfect on any its working Perfect. Well, its passing 192/24 as 192/32 to the hires DAC and is stable with my settings above. I had tried 32-bit and bit perfect OFF as well as 16-bit with bit perfect ON but missed 32/ON.

I think we cracked it!

Final settings, can someone verify?

Using Hi Res Driver with the following settings is stable and passing the sample rate correctly..
HiRes driver flags : Direct
HiRes driver Audio Format : 32-bit
Bit Perfect Mode : ON
Upsampling : OFF
Buffer Size : 1310072 frames
 
Mar 6, 2021 at 1:08 PM Post #4,522 of 6,195
I've just tried 32-bit with bit perfect on any its working Perfect. Well, its passing 192/24 as 192/32 to the hires DAC and is stable with my settings above. I had tried 32-bit and bit perfect OFF as well as 16-bit with bit perfect ON but missed 32/ON.

I think we cracked it!

Final settings, can someone verify?

Using Hi Res Driver with the following settings is stable and passing the sample rate correctly..
HiRes driver flags : Direct
HiRes driver Audio Format : 32-bit
Bit Perfect Mode : ON
Upsampling : OFF
Buffer Size : 1310072 frames

Testing now with different sample rates, MQA, etc...
 
Mar 6, 2021 at 1:12 PM Post #4,523 of 6,195
Testing now with different sample rates, MQA, etc...
I’ve tried local ALAC and FLAC files at 16/44, 24/48, 24/96, 24/192 and MQA at 24/96, all seem to work although showing 32 bit for all. Does that matter? It’s my understanding upsampling the bitrate doesn’t affect quality as it’s just adding null data, could be wrong!
 
Mar 6, 2021 at 1:18 PM Post #4,524 of 6,195
I’ve tried local ALAC and FLAC files at 16/44, 24/48, 24/96, 24/192 and MQA at 24/96, all seem to work although showing 32 bit for all. Does that matter? It’s my understanding upsampling the bitrate doesn’t affect quality as it’s just adding null data, could be wrong!

I'm pretty sure that bit padding 24 bit to 32 bit is transparent. I have also tried several different formats with 100% success so far. You should probably post this in the Sony threads. I did notice that it is not offloading MQA, but UAPP is doing the first unfold.
 
Mar 6, 2021 at 1:24 PM Post #4,525 of 6,195
I'm pretty sure that bit padding 24 bit to 32 bit is transparent. I have also tried several different formats with 100% success so far. You should probably post this in the Sony threads. I did notice that it is not offloading MQA, but UAPP is doing the first unfold.

Thought padding the bitrate up was transparent, good to confirm.

I'm not so concerned about MQA although it would be nice to have. I know the DAC can unfold MQA but curiously it does not have any MQA flags available. Setting MQA breaks it. Perhaps I can feed my findings back to the developers and work with them to get MQA working in full too. Mind you 24/96 is still great!

Are you getting any weird behaviour with play/pause? I'm occasionally having the audio continue to play when the app says its paused. Could be a buffer size issue. I'll keep experimenting until I'm 100% happy then I'll share it in the Sony threads too. Don't want to get anyones hopes up.
 
Mar 6, 2021 at 1:29 PM Post #4,526 of 6,195
Thought padding the bitrate up was transparent, good to confirm.

I'm not so concerned about MQA although it would be nice to have. I know the DAC can unfold MQA but curiously it does not have any MQA flags available. Setting MQA breaks it. Perhaps I can feed my findings back to the developers and work with them to get MQA working in full too. Mind you 24/96 is still great!

Are you getting any weird behaviour with play/pause? I'm occasionally having the audio continue to play when the app says its paused. Could be a buffer size issue. I'll keep experimenting until I'm 100% happy then I'll share it in the Sony threads too. Don't want to get anyones hopes up.

Not so far on the play/pause. I'll try some more. I started listening to Led Zeppelin IV and stopped testing.... :sunglasses:
 
Mar 6, 2021 at 1:45 PM Post #4,527 of 6,195
Thought padding the bitrate up was transparent, good to confirm.

I'm not so concerned about MQA although it would be nice to have. I know the DAC can unfold MQA but curiously it does not have any MQA flags available. Setting MQA breaks it. Perhaps I can feed my findings back to the developers and work with them to get MQA working in full too. Mind you 24/96 is still great!

Are you getting any weird behaviour with play/pause? I'm occasionally having the audio continue to play when the app says its paused. Could be a buffer size issue. I'll keep experimenting until I'm 100% happy then I'll share it in the Sony threads too. Don't want to get anyones hopes up.

I have tried a bunch of play/pause cycles and no issue here. I did reboot my A105 once we figured it out. I have noticed a small drop-out in the first second or so of some tracks. It's not consistent, maybe sample rate changing or buffering....
 
Mar 6, 2021 at 1:52 PM Post #4,528 of 6,195
I have tried a bunch of play/pause cycles and no issue here. I did reboot my A105 once we figured it out. I have noticed a small drop-out in the first second or so of some tracks. It's not consistent, maybe sample rate changing or buffering....
Try changing the buffer to 600ms, see if that helps?
 
Mar 6, 2021 at 1:57 PM Post #4,529 of 6,195
Mar 6, 2021 at 2:03 PM Post #4,530 of 6,195
Nope. That breaks it, at least for 192 kHz Flac.
Ha ok, don’t do that then 🤣

I’ll have a play once kids in bed, perhaps what we have is as close to fully working as we can get right now
 

Users who are viewing this thread

Back
Top