anabolyc / pcm5102a-for-armbian-orangepi-zero

5 stars 1 forks source link

192KHz support? #1

Open robcazzaro opened 3 years ago

robcazzaro commented 3 years ago

Hello, and thanks for sharing this, really appreciate all the work you did.

I just installed this on my ancient OrangePi Zero, everything works. As part of the tests I ran, I wanted to see if 192KHz works. According to the pcm5102a.c file, 192KHz should be supported

But when I try with "speaker test - r 192000", no quotes, I get an error (see below), while "speaker-test -r 96000" works without problems

speaker-test 1.2.2

Playback device is default
Stream parameters are 192000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 192000Hz (requested 192000Hz)
Buffer size range from 128 to 131072
Period size range from 64 to 16384
Using max buffer size 131072
Periods = 4
Unable to set hw params for playback: Invalid argument
Setting of hwparams failed: Invalid argument

I then compiled this https://download.atmark-techno.com/misc/demos/usb-audio-a500-howto/hw_params.c and the output is

PLAYBACK
        Device: hw:0 (type: HW)
        Access types: MMAP_INTERLEAVED RW_INTERLEAVED
        Formats: S16_LE S24_LE
        Channels: 2
        Sample rates: 8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 176400 192000
        Interrupt interval: 166-2048000 us
        Buffer time: 333-16384000 us

CAPTURE

Which seems to imply that 192KHz is supported (but not S32_LE, interestingly enough, even if that was listed)

do you know how I can generate a test signal at 192KHz? I'm clearly out of my depth here...

anabolyc commented 3 years ago

Hi @robcazzaro I've encounter the same annoying issue, it would not support any format beyond standard 44.1K/16. Unfortunately this is beyond my skills to set it up properly. I guess this goes to the fact that this driver is very generic, not taking into account chip specifics to much. If you'll ever find solution for this please let me know.

robcazzaro commented 3 years ago

Thanks for the prompt reply. Clearly the OrangePi Zero was not meant to be used with I2S :) Since it's well beyond my current skills and I have other SBCs that actually support I2S, I won't pursue this further. Given that the WiFi on that device doesn't work either, disabling WiFi to enable I2S was a good tradeoff, but there is clearly more work needed for a device that really has negligible use. You made a valiant effort...

I'll leave this open, in case someone else tries to make it work.