PDA

View Full Version : RBP/Squeezelite/IQaudIO DAC+ resampling in Max2play and Picoreplayer



AlexM
02-06-2015, 17:42
Quick question rather than fold it into the IQA DAC+ mega thread..

I was playing with resampling options in Max2Play and after some manual configuration I got squeezelite to upsample to 32/384 (according to the debug log), but got no audio output. CPU utilisation was suspiciously low, so I'm not sure whether it was actually working at that bitrate.

I also tried PiCoreplayer with -u mL upsampling option. I got some sound out, and the debug log confirmed upsampling to 176Khz or 192Khz if I used -u mLX to enable asynchronous upsampling.

My questions are a) does squeezelite support 384Khz upsampling with the Dac+ b) how do I make it work with Max2play and c) how does PiCoreplayer know what the maximum sample rate is: configuration file, driver or something else?.

Any help would be appreciated.

Cheers,
Alex

NRG
02-06-2015, 19:10
Hi Alex, I think the highest you can go with squeezelite is 192K. I tried 384K with piCorePlayer and it really screwed it up...it got stuck in an unresponsive loop and wouldn't play, the only way I could gain access to the RPi was to re-write the SD card!

To see what the rate is ssh into the RPi, play some music and paste this into the command line:

sudo cat /proc/asound/card1/pcm0p/sub0/hw_params

Changes only take affect after piCorePlayer has been restarted or rebooted....

Krisbee
02-06-2015, 20:01
Quick question rather than fold it into the IQA DAC+ mega thread..

I was playing with resampling options in Max2Play and after some manual configuration I got squeezelite to upsample to 32/384 (according to the debug log), but got no audio output. CPU utilisation was suspiciously low, so I'm not sure whether it was actually working at that bitrate.

I also tried PiCoreplayer with -u mL upsampling option. I got some sound out, and the debug log confirmed upsampling to 176Khz or 192Khz if I used -u mLX to enable asynchronous upsampling.

My questions are a) does squeezelite support 384Khz upsampling with the Dac+ b) how do I make it work with Max2play and c) how does PiCoreplayer know what the maximum sample rate is: configuration file, driver or something else?.

Any help would be appreciated.

Cheers,
Alex

Don't have an IQAUDIO DAC + , but product features say:

IQaudIO Pi-DAC+ Features


Raspberry Pi HAT (A+/B+/2) compliant accessory; EEPROM, mounting holes, WITH camera & screen flat flex cut outs
Full-HD audio – up to 24-bit/192kHz playback
Integrated hardware volume control (via ALSA), full 2v RMS
Built in High quality audio headphone amplifier (TI TPA6133A)
Class leading audio; 112db SNR, and -93db THD
Audiophile TI Burr Brown 32-bit/384kHz DAC (TI PCM5122)
Advanced ESD protection
Uses the digital I2S audio signals to reduce CPU load over USB audio solutions
Raspberry Pi powered, no external power requirements
Industry standard audio quality Phono/RCA connectors
Built in IR header to take optional Vishay TSOP4838
Fully built and tested Raspberry Pi accessory (Additional I/O pin headers are user soldered)
Designed and manufactured in the UK

So the max rate supported by IQUAIOD DAC+ is not matched by its max playback rate.

Squeezelite gets the rates supported by your audio hardware via ALSA's API, as you know how to get debug output from squeezelite, you should see a line something like this:



[17:39:19.918002] output_init_common:394 supported rates: 384000 352800 192000 176400 96000 88200 48000 44100 32000 24000 22500 16000 12000 11025 8000

or this:


[17:39:19.918002] output_init_common:394 supported rates: 192000 176400 96000 88200 48000 44100 32000 24000 22500 16000 12000 11025 8000


The supported rates are for your hardware, obviously if the IQAUDIO DAC+ is limited to 24/192 then trying to upsample to a higher rate makes no sense.

The max rate supported by squeezelite is a separate question, I don't know if Triode's squeezelite supports anything higher than 32/384.

AlexM
02-06-2015, 22:28
Hi Both, thanks for your replies.

Debug log under picoreplayer contains the following:


[21:34:56.225539] output_init_common:402 supported rates: 192000 176400 96000 88200 48000 44100 32000 16000 11025 8000

sudo cat /proc/asound/card1/pcm0p/sub0/hw_params just returns:


sudo cat hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 3840
buffer_size: 15360


Both of which support the statement that 192k is the maximum supported rate under piCorePlayer with the IQaudIO DAC+

but the debug log under max2play shows:


output_init_common:410 supported rates: 384000 352800 192000 176400 96000 88200 48000 44100 32000 24000 22500 16000 12000 11025 8000

cat /proc/asound/card1/pcm0p/sub0/hw_params returns 'no config' with the upsampling option -u mLX, and the following without (as expected):


access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 882
buffer_size: 3528


I'm lost now.. it looks like the device driver is telling squeezelite that it supports up to 384k playback, but cant initialize the card at that bitrate. A bug in max2play probably? any other troubleshooting suggestions would be welcome. I will try limiting max bitrate to 192k and then advance through the list of higher bitrates to see where it stops working.

Cheers,
Alex

NRG
03-06-2015, 07:49
cat /proc/asound/card1/pcm0p/sub0/hw_params returns 'no config' with the upsampling option -u mLX, and the following without (as expected):


access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 882
buffer_size: 3528


I'm lost now.. it looks like the device driver is telling squeezelite that it supports up to 384k playback, but cant initialize the card at that bitrate. A bug in max2play probably? any other troubleshooting suggestions would be welcome. I will try limiting max bitrate to 192k and then advance through the list of higher bitrates to see where it stops working.

Cheers,
Alex

Alex, I think you may need to set the max sample rate with the -r option IE: -r 19600

AlexM
03-06-2015, 17:45
Hi Neal,

Yes, can confirm that Max2play is happy resampling when I limit the maximum rate to 192k. Not totally sure I like the outcome after all of that though, will listen some more before deciding. It is definitely different, but not sure if I prefer it. I'm still curious why ALSA is reporting the 384k rate as available, and I have read that MPD players (Volumio) are using upsampling to 384k, so maybe it is do-able by the card after all. CPU utilisation for the Squeezelite process is about 16-20% on the core it is using, although the system stays responsive as this is only about 5% across all four cores.

For reference, my squeezelite command line is as follows (delete the -f and -d parameters if you don't need the logging)


./squeezelite -o default:CARD=IQaudIODAC -a 80:4:: -f /home/pi/sldebug.log -d all=debug -r 192000 -u mL:::28

Thanks for your help.

Regards,
Alex

NRG
03-06-2015, 18:21
I found quite a difference in presentation between the Linear, Minimum and Intermediate phase filters. I've settled on the Intermediate setting as Linear was a little too forward for me and Minimum made the sound stage shrink back towards the 'speakers and widen. As all of my material is 44.1 I stuck with Integer up sampling to 176400 and found it has a smidge bit more clarity...as ever YMMV...

AlexM
04-06-2015, 19:38
Thanks Neal.

I have noticed that because the upsampling reduces the volume level by 1Db by default to prevent clipping, you need to compensate for the reduced output by increasing gain. I'm still experimenting with different filters, but for the moment I'm sticking with medium linear phase. The effects are quite subtle, but seem to improve resolution of fine detail slightly, and broaden the acoustic slightly compared to non-upsampled. It does seem to reduce bass impact slightly though.. not sure why that would be.

Alex