I have searched through at91-ssc.c and I cannot figure out why the record makes the pcm behave as it does. I am using PCM A, which configures the SSC as:
case SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBS_CFS: /* * DSP/PCM Mode A format, SSC provides BCLK and LRC clocks. * * The SSC transmit and receive clocks are generated from the * MCK divider, and the BCLK signal is output on the SSC TK line. */ rcmr = (( ssc_p->rcmr_period << 24) & AT91_SSC_PERIOD) | (( 1 << 16) & AT91_SSC_STTDLY) | (( AT91_SSC_START_RISING_RF ) & AT91_SSC_START) | (( AT91_SSC_CK_RISING ) & AT91_SSC_CKI) | (( AT91_SSC_CKO_NONE ) & AT91_SSC_CKO) | (( AT91_SSC_CKS_DIV ) & AT91_SSC_CKS);
rfmr = (( AT91_SSC_FSEDGE_POSITIVE ) & AT91_SSC_FSEDGE) | (( AT91_SSC_FSOS_POSITIVE ) & AT91_SSC_FSOS) | (( 0 << 16) & AT91_SSC_FSLEN) | (((channels - 1) << 8) & AT91_SSC_DATNB) | (( 1 << 7) & AT91_SSC_MSBF) | (( 0 << 5) & AT91_SSC_LOOP) | (((bits - 1) << 0) & AT91_SSC_DATALEN);
tcmr = (( ssc_p->tcmr_period << 24) & AT91_SSC_PERIOD) | (( 1 << 16) & AT91_SSC_STTDLY) | (( AT91_SSC_START_RISING_RF ) & AT91_SSC_START) | (( AT91_SSC_CK_RISING ) & AT91_SSC_CKI) | (( AT91_SSC_CKO_CONTINUOUS ) & AT91_SSC_CKO) | (( AT91_SSC_CKS_DIV ) & AT91_SSC_CKS);
tfmr = (( AT91_SSC_FSEDGE_POSITIVE ) & AT91_SSC_FSEDGE) | (( 0 << 23) & AT91_SSC_FSDEN) | (( AT91_SSC_FSOS_POSITIVE ) & AT91_SSC_FSOS) | (( 0 << 16) & AT91_SSC_FSLEN) | (((channels - 1) << 8) & AT91_SSC_DATNB) | (( 1 << 7) & AT91_SSC_MSBF) | (( 0 << 5) & AT91_SSC_DATDEF) | (((bits - 1) << 0) & AT91_SSC_DATALEN);
break;
Which, while it puts my timing a little off, should allow a valid record if one has TF0 and RF0 connected and TK0 and RK0 connected. Has anyone seen this behavior before?
Looking at strace of arecord gives me a few lines I wonder about. I will attach the entire strace dump as a text file. The lines that give me pause are:
~ $ strace arecord -r8000 -traw -fS8 -d3 test.raw execve("/usr/bin/arecord", ["arecord", "-r8000", "-traw", "-fS8", "-d3", " test.raw"], [/* 7 vars */0 . . . .snip. stat("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644, st_size=8611, ...}) = 0 open("/usr/share/alsa/alsa.conf", O_RDONLY) = 3 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbea17b04) = -1 ENOTTY (Inappropriate ioctl for device) brk(0x1e000) = 0x1e000 read(3, "#\n# ALSA library configuration "..., 4096) = 4096 brk(0x1f000) = 0x1f000 brk(0x20000) = 0x20000 brk(0x21000) = 0x21000 read(3, "r\n\t\t\t\tname defaults.pcm.device\n\t"..., 4096) = 4096 brk(0x22000) = 0x22000 brk(0x23000) = 0x23000 brk(0x24000) = 0x24000 brk(0x25000) = 0x25000 read(3, "{\n\t\t\t@func refer\n\t\t\tname default"..., 4096) = 419 read(3, "", 4096) = 0 close(3) .snip.
Not sure if the ioctl error on my alsa.conf is a big deal or not.
.snip. access("/etc/asound.conf", R_OK) = -1 ENOENT (No such file or directory) access("~/.asoundrc", R_OK) = -1 ENOENT (No such file or directory) .snip.
I thought I had read these files were not necessary for ALSA to work. Do I need one?
.snip. open("/usr/share/alsa/cards/aliases.conf", O_RDONLY) = 3 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbea17a34) = -1 ENOTTY (Inappropriate ioctl for device) brk(0x26000) = 0x26000 read(3, "#\n# Define aliases for various "..., 4096) = 1273 open("/usr/share/alsa/pcm/default.conf", O_RDONLY) = 4 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbea1799c) = -1 ENOTTY (Inappropriate ioctl for device) brk(0x27000) = 0x27000 read(4, "#\n# Default output\n#\n\npcm.!defau"..., 4096) = 762 brk(0x28000) = 0x28000 read(4, "", 4096) = 0 close(4) = 0 open("/usr/share/alsa/pcm/dmix.conf", O_RDONLY) = 4 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbea1799c) = -1 ENOTTY (Inappropriate ioctl for device) brk(0x29000) = 0x29000 read(4, "#\n# dmix output\n#\n\npcm.!dmix {\n\t"..., 4096) = 1521 read(4, "", 4096) = 0 close(4) = 0 open("/usr/share/alsa/pcm/dsnoop.conf", O_RDONLY) = 4 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbea1799c) = -1 ENOTTY (Inappropriate ioctl for device) brk(0x2a000) = 0x2a000 read(4, "#\n# dsnoop\n#\n\npcm.!dsnoop {\n\t@ar"..., 4096) = 1533 brk(0x2b000) = 0x2b000 read(4, "", 4096) = 0 close(4) = 0 read(3, "", 4096) = 0 close(3) .snip.
A lot of ioctl error messages. Again, not sure if they are a concern.
.snip. open("/dev/snd/controlC1", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC1", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC2", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC2", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC3", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC3", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC4", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC4", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC5", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC5", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC6", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC6", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC7", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC7", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC8", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC8", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC9", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC9", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC10", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC10", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC11", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC11", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC12", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC12", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC13", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC13", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC14", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC14", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC15", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC15", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC16", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC16", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC17", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC17", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC18", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC18", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC19", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC19", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC20", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC20", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC21", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC21", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC22", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC22", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC23", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC23", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC24", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC24", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC25", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC25", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC26", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC26", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC27", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC27", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC28", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC28", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC29", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC29", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC30", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC30", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC31", O_RDONLY) = -1 ENOENT (No such file or directory) open("/dev/aloadC31", O_RDONLY) = -1 ENOENT (No such file or directory) .snip.
Not sure why it is trying to open a bunch of interfaces I do not have.
.snip. open("/dev/snd/controlC0", O_RDONLY) = 3 close(3) = 0 open("/dev/snd/controlC0", O_RDWR) = 3 ioctl(3, USBDEVFS_CONTROL, 0xbecba7d8) = 0 ioctl(3, 0x40045532, 0xbecba7e4) = 0 open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK) = 4 close(3) = 0 ioctl(4, AGPIOC_ACQUIRE or APM_IOC_STANDBY, 0xbecba628) = 0 fcntl(4, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK) ioctl(4, AGPIOC_INFO, 0xbecba7d4) = 0 ioctl(4, AGPIOC_RELEASE or APM_IOC_SUSPEND, 0xbecba7cc) = 0 mmap2(NULL, 4096, PROT_READ, MAP_SHARED, 4, 0xfff80000) = -1 ENXIO (No such device or address) ioctl(4, 0xc0844123, 0xbecba748) = 0 fcntl(4, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK) fcntl(4, F_SETFL, O_RDWR) = 0 ioctl(4, AGPIOC_ACQUIRE or APM_IOC_STANDBY, 0xbecbacbc) = 0 rt_sigaction(SIGINT, {0x11530, [INT], SA_RESTART|0x4000000}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGTERM, {0x11530, [TERM], SA_RESTART|0x4000000}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGABRT, {0x11530, [ABRT], SA_RESTART|0x4000000}, {SIG_DFL}, 8) = 0 write(2, "Recording", 9Recording) = 9 write(2, " ", 1 ) = 1 write(2, "raw data", 8raw data) = 8 write(2, " '", 2 ') = 2 write(2, "test.raw", 8test.raw) = 8 write(2, "' : ", 4' : ) = 4 write(2, "Signed 8 bit", 12Signed 8 bit) = 12 write(2, ", ", 2, ) = 2 write(2, "Rate ", 5Rate ) = 5 write(2, "8000", 48000) = 4 write(2, " Hz, ", 5 Hz, ) = 5 write(2, "Mono", 4Mono) = 4 write(2, "\n", 1 ) = 1 ioctl(4, 0xc25c4110, 0xbecb8674) = 0 ioctl(4, 0xc25c4110, 0xbecb8674) = 0 ioctl(4, 0xc25c4110, 0xbecb8674) = 0 ioctl(4, 0xc25c4110, 0xbecb83e8) = 0 ioctl(4, 0xc25c4110, 0xbecb83e8) = 0 ioctl(4, 0xc25c4110, 0xbecb83e8) = 0 ioctl(4, 0xc25c4110, 0xbecb83e8) = 0 ioctl(4, 0xc25c4110, 0xbecb83e8) = 0 ioctl(4, 0xc25c4110, 0xbecb83e8) = 0 ioctl(4, 0xc25c4110, 0xbecb83e8) = 0 ioctl(4, 0xc25c4110, 0xbecb83e8) = 0 ioctl(4, 0xc25c4110, 0xbecb7eec) = 0 ioctl(4, 0xc25c4110, 0xbecb7eec) = 0 ioctl(4, 0xc25c4110, 0xbecb7eec) = 0 ioctl(4, 0xc25c4110, 0xbecb814c) = 0 ioctl(4, 0xc25c4110, 0xbecb814c) = 0 ioctl(4, 0xc25c4110, 0xbecb814c) = 0 ioctl(4, 0xc25c4110, 0xbecb7eec) = 0 ioctl(4, 0xc25c4110, 0xbecb7eec) = 0 ioctl(4, 0xc25c4110, 0xbecb7eec) = 0 ioctl(4, 0xc25c4110, 0xbecb814c) = 0 ioctl(4, 0xc25c4110, 0xbecb814c) = 0 ioctl(4, 0xc25c4110, 0xbecb814c) = 0 ioctl(4, 0xc25c4110, 0xbecb7eec) = 0 ioctl(4, 0xc25c4110, 0xbecb7eec) = 0 ioctl(4, 0xc25c4110, 0xbecb7eec) = 0 ioctl(4, 0xc25c4110, 0xbecb814c) = 0 ioctl(4, 0xc25c4110, 0xbecb814c) = 0 ioctl(4, 0xc25c4110, 0xbecb814c) = 0 ioctl(4, 0xc25c4110, 0xbecb85e4) = 0 ioctl(4, 0xc25c4110, 0xbecb85e4) = 0 ioctl(4, 0xc25c4110, 0xbecb85d8) = 0 ioctl(4, 0xc25c4110, 0xbecb898c) = 0 ioctl(4, 0xc25c4111, 0xbecb898c) = 0 ioctl(4, 0xc0844123, 0x24f58) = 0 ioctl(4, 0xc0684113, 0xbecb8554) = 0 ioctl(4, 0xc0844123, 0x24f58) = 0 ioctl(4, 0x4140, 0x400ba1a8) = 0 ioctl(4, 0xc0844123, 0x24f58) = 0 ioctl(4, 0xc0844123, 0x24f58) = 0 rmdir("test.raw") = -1 ENOTDIR (Not a directory) unlink("test.raw") = 0 open("test.raw", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3 ioctl(4, 0x800c4151, 0xbecb8c34) = -1 EIO (Input/output error) write(2, "arecord", 7arecord) = 7 write(2, ": ", 2: ) = 2 write(2, "pcm_read", 8pcm_read) = 8 write(2, ":", 1:) = 1 write(2, "1346", 41346) = 4 write(2, ": ", 2: ) = 2 write(2, "read error: ", 12read error: ) = 12 write(2, "Input/output error", 18Input/output error) = 18 write(2, "\n", 1 ) = 1 exit(1) = ? Process 754 detached .snip.
The final sequence here. Seems that when it tried some kind of ioctl on pcmC0D0c, it received an error. Perhaps this control signal is what is causing the HW problems with RF0.
Again, the full strace is attached. Not sure if this helps, I am trying my best to figure out what is wrong with RF0. I know it works as my polling ssc driver works just fine with both capture and playback.
If anyone has any clue to what I can try, look at, etc. please feel free to let me know.
Paul
*************************************** Paul David Kavan Project Engineer GRH Electronics, Inc. 402-734-4900 pkavan@gmail.com ***************************************