Custom pcm5122 based DAC, driver and control
Posted: Tue Jun 23, 2015 10:39 pm
Hi all
I'm playing around a custom made DAC board made out of pcm5122
Because I'm using SPI, rather than I2C, I cannot use the hifiberry-dacplus driver
Instead, I use hifiberry-dac (based on pcm5120a, no control, I expect only i2s data), which does not do any SPI/I2C config, and I'm using some custom C++ prog, to set the required registers to make the pcm5122 blast some good tune
The thing is that I did not manage so far to hear anything. Been playing around registers, but no success
Running out of ideas, I've checked the pcm512x.h .c files, to see exactly what's going on there. I've found a couple of more registers that I can play with, but I've also found something inconsistent between code and datasheet
In pcm512x.h:
And according to the PCM5122 datasheet http://www.google.fr/url?sa=t&rct=j&q=& ... 9352,d.bGg page 75, there is nothing about the PCM512x_VIRT_BASE 0x100
Does anybody has an idea about this mismatch ? Is this a datasheet mistake ? Or maybe I missed something
Also, looks like there's a PCM512x-spi.h .c, but I've found no loadable module related to this... Maybe someone knows about it ?
Finally, I there's one more question. Using mplayer, I've seen that it specifies the output caracteristics to ALSA
"AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)" are those the caracs that should be set to the DAC ? Or there's more resampling happening ?
Cheers
Bastien
I'm playing around a custom made DAC board made out of pcm5122
Because I'm using SPI, rather than I2C, I cannot use the hifiberry-dacplus driver
Instead, I use hifiberry-dac (based on pcm5120a, no control, I expect only i2s data), which does not do any SPI/I2C config, and I'm using some custom C++ prog, to set the required registers to make the pcm5122 blast some good tune
The thing is that I did not manage so far to hear anything. Been playing around registers, but no success
Running out of ideas, I've checked the pcm512x.h .c files, to see exactly what's going on there. I've found a couple of more registers that I can play with, but I've also found something inconsistent between code and datasheet
In pcm512x.h:
Code: Select all
#define PCM512x_VIRT_BASE 0x100
#define PCM512x_PAGE_LEN 0x100
#define PCM512x_PAGE_BASE(n) (PCM512x_VIRT_BASE + (PCM512x_PAGE_LEN * n))
#define PCM512x_PAGE 0
#define PCM512x_RESET (PCM512x_PAGE_BASE(0) + 1)
Does anybody has an idea about this mismatch ? Is this a datasheet mistake ? Or maybe I missed something
Also, looks like there's a PCM512x-spi.h .c, but I've found no loadable module related to this... Maybe someone knows about it ?
Finally, I there's one more question. Using mplayer, I've seen that it specifies the output caracteristics to ALSA
Code: Select all
[root@alarmpi modules]# mplayer -ao alsa file:///var/lib/mpd/music/Holden\ \(2003\)/01-american_wheeze.mp3
MPlayer SVN-r37379 (C) 2000-2015 MPlayer Team
210 audio & 441 video codecs
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing file:///var/lib/mpd/music/Holden (2003)/01-american_wheeze.mp3.
libavformat version 56.25.101 (internal)
Audio only file format detected.
Clip info:
Title: American Wheeze
Artist: Sixteen Horsepower
Album: Holden
Year: 2003
Comment:
Track: 1
Genre: Rock
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 192.0 kbit/13.61% (ratio: 24000->176400)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 3.9 (03.9) of 235.0 (03:55.0) 5.9%
Exiting... (End of file)
[root@alarmpi modules]#
Cheers
Bastien