Audio Support Rock Pi S

root@rockpis:/home/rock# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Loopback
    Loopback, Loopback PCM
    Default Audio Device
sysdefault:CARD=Loopback
    Loopback, Loopback PCM
    Default Audio Device
front:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    Front speakers
surround21:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    Direct sample mixing device
dmix:CARD=Loopback,DEV=1
    Loopback, Loopback PCM
    Direct sample mixing device
dsnoop:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    Direct sample snooping device
dsnoop:CARD=Loopback,DEV=1
    Loopback, Loopback PCM
    Direct sample snooping device
hw:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    Direct hardware device without any conversions
hw:CARD=Loopback,DEV=1
    Loopback, Loopback PCM
    Direct hardware device without any conversions
plughw:CARD=Loopback,DEV=0
    Loopback, Loopback PCM
    Hardware device with all software conversions
plughw:CARD=Loopback,DEV=1
    Loopback, Loopback PCM
    Hardware device with all software conversions
default:CARD=rockchiprk3308a
    rockchip,rk3308-acodec,
    Default Audio Device
sysdefault:CARD=rockchiprk3308a
    rockchip,rk3308-acodec,
    Default Audio Device
dmix:CARD=rockchiprk3308a,DEV=0
    rockchip,rk3308-acodec,
    Direct sample mixing device
dsnoop:CARD=rockchiprk3308a,DEV=0
    rockchip,rk3308-acodec,
    Direct sample snooping device
hw:CARD=rockchiprk3308a,DEV=0
    rockchip,rk3308-acodec,
    Direct hardware device without any conversions
plughw:CARD=rockchiprk3308a,DEV=0
    rockchip,rk3308-acodec,
    Hardware device with all software conversions

The new kernel is already available via apt. Thanks so much! Now I will try to get some music playing :wink:

1 Like

Hi @xfjx, somehow the repository didn’t work for me, how did you install the new kernel via apt? Thanks

EDIT: on a new install

sudo apt-get dist-upgrade

did the trick

1 Like

Hey again,

so now the devices appear, unfortunately still no sound. I however noted that the loopback and rockchip devices share the same names (“default”, “sysdefault”). Any way to disable the loopback driver?

Hey @xfjx,

did you get it to work, also which pin was the audio on?
(I am looking for line_out audio, but so far no success :frowning: )

Hi,

Sorry for the late reply. First of all I didn’t want to start a flame war here. Your product is nice, as it is. The only thing that popped up is an unique selling point. Regarding micro arm devices, there are plenty out there, like this one http://linuxgizmos.com/worlds-smallest-quad-core-sbc-starts-at-8-dollars/. However there is no small multi mems board available. The rockchip supports this by design, however you have to implement it accordingly.

Regarding the choice of mics, the best option is to use MEMS instead of analog ones. The use of MEMS in combination with an analog processing is no problem or vice versa, as you can use DAC/ADC.
Please have a look at the following schematic, where 2 ADCS are used to feed the audio input

The use of multiple MEMS does not have any advantage unless you are using it for beamforming, i.e. ASR and smart home usage. If you are planning to support multiple MEMS which might be one real USP of your board, the MEMS have to be clock synchronized.

Regarding the choice of MICS on the pin. The rockchip codec seems to be only processing stereo signals. So after having several discussions with some tech experts, we came to the conclusion that you cannot use the standard interface, otherwise the mics are not clock synchronized. If you are planning to support multiple MEMS, the only way would be to use the I2S interface, i.e. I2S0/I2S1 with 8ch: supports up to 8 channels (8xTX or 8xRX).

At the current state, the board (insert link, order code, etc.) can only connect to 6 digital mems microphones via the i2s interface. This is due to pin Y14 being left unconnected (see page 7 of the schematics pdf). Further, it would be nice to have synchronous sampling of the mems microphones and the line-out. According to the RK3308 datasheet, this happens at different hardware units, (audio-codec, i2s interface). In order to have synchronous sampling, the audio driver must take care of reading/writing to those units at the same time (i.e. with the same DMA cycle).

There is a reference implementation available for one variant of the rockchip. You might find some infos here how the sound module was implemented:

For a reference sound driver design intro, using multiple MICS have a look at

However, the are not using the rockchip

We will come back to you, if we find a valid driver design using the proposed I2S with the rockchip.

Best Regards

Matthias

2 Likes

with a very basic /etc/asound.conf

pcm.!default {
        type hw
        card 1
}

ctl.!default {
        type hw
        card 1
}

I was able to get some sound out of my Rock Pi S. I connected headphones to GND, PIN 25 and PIN 26… BUT: I only got sound on one ear. I switched PIN 25 and 26 and got sound on the other ear so it not broken headphones.

3 Likes

Dear Rock Pi S Team

We stumbled uppon the FireFly board

http://en.t-firefly.com/product/rocrk3308cc?theme=pc#spec

It uses the same Rockchip RK3308, as well as support for a 6ch microphone array.
Please have a look at the driver implementation>

http://en.t-firefly.com/doc/download/53.html

I would be extremly cool, if you add this driver specification to your board, as it seems to fullfill all requirements for multi-channel audio recording and playback. If you are experiencing troubles please drop us a line here.

Looking forward to hear from you.

Best Regards

Matthias

1 Like

Any chance to get an answer on that from @jack?

1 Like

…ok, so, what in this phrase is not clear why Radxa have limit on this device?

Just. Say. What? Your link lead to full 40 pins device. OF COURSE IT HAVE AUDIO you desire. Not shit Sherlock!

@dante: In case I was meant here. Was that meant to be funny or offensive? (I do not laugh)

To put this on a more serious polite discussion level. Yes of course it has limited capacity, but do you really need 40 pins?

page 23: https://drive.google.com/drive/folders/1SW9fmIb_zQP0PB8mXkf7HrwLkAhNuvCw

remove the leds and all the other not needed stuff

I already deleted post, so chill. Also, “not needed” for whom? You? Maybe yes. All other ppl? I wouldn’t be that sure.

@jack: you might want to stick to the pin setup provided on page 23 , MIC-Array Digital (roc-rk308-cc-v1_3.pdf) if somehow possible. This is because, there is already a driver implementation for that. Furthermore nobody wants to use analog mics if you have digital MEMS (MEMS have a lot better quality, higher SNR, allow longer wires, …). Therefore, I would recommend to get rid of analog mic support. Then you also have space to add the lineout R/L.

https://drive.google.com/drive/folders/1SW9fmIb_zQP0PB8mXkf7HrwLkAhNuvCw

hope that helps you somehow.
keep up the good work!

@Dante4: “not needed” because they are connected to ground. Hence you need max. 19 Pinouts.

Best Regards

Matthias

I have loopback devices only even after dist-upgrade. I am using official Debian Stretch image. Kernel reported 4.4.143-23-rockchip-g394d86b2b38b . What exactly needs be done for the board to recognize internal DAC?

Did you use the asound.conf I provided a few postings ago? I also would like to get an answer from @jack why there is only one side of the headphones working right now but you could at least read everything in this post before asking questions that were already answered.

1 Like

I think @Jubian has dual channel sound working with flying wire to a headphone jack. @Jubian please confirm the configuration you use.

I tried test it,dual channal sound output is normal,You can use oscilloscope to try the pin is there have output,maybe your pi is broken.

UPDATE OK, after n attempts this is what finally worked for me, to get the soundcard recognized. However, only left channel works.

sudo su
route add default gw <your.gateway.ip.address> eth0
echo "deb http://apt.radxa.com/stretch-testing/ stretch main" | sudo tee /etc/apt/sources.list.d/apt-radxa-com.list
wget -O -  apt.radxa.com/stretch-testing/public.key | sudo apt-key add -
apt-get update
apt-get upgrade
apt-get install -y rockchip-overlay rockchip-fstab
apt-get install -y linux-4.4-rockpis-latest rockpis-dtbo
apt-get autoremove
chmod a+r /etc/group 

For some reason, apt-get dist-upgrade and apt full-upgrade left me with loopback devices only.

Then I modified /etc/asound.conf as posted by @xfjx earlier, and reboot.

You could at least drop the entitled act and stop assuming somebody asking a question in a thread didn’t read said thread and didn’t follow steps described in the thread before posting a question. With such attitude, why don’t you re-read the topic and wiki instead of pestering @jack with your questions? Also, if I was so low opinion of you as you are of others, I would assume you didn’t check which side of the audio header has GND and wired it wrong, which would explain why you have no sound on second channel.

1 Like

Thanks for your reply,
I direct replacement the kernel and device tree,it can works on dual channal,maybe it has bug at apt way, we will test and fix it.

1 Like

At least I know how to create a asound.conf from scratch and was kind enough to share it.

Oi, that’s so great, and totally justifies your disrespectful behaviour… no, it doesn’t.

1 Like