Jump to content

Recommended Posts

Posted

Update May-21-2018:  script may have negative impact on HDMI audio, needs further investigation.  Patches pushed to enable I2S HDMI device, but audio does not come out.

 

Update Feb-20-2018:  script update committed for out of the box audio support (both outputs and inputs) for ASUS Tinker Board. 

 

Available sinks:

  • BT-VOIP
  • SPDIF
  • Headset (the jack)

Available sources:

  • BT-VOIP
  • Headset-input (the jack)

 

Tinkerboard sound is possible with Armbian, however I have not worked to get it set up "out of the box" because of a major bug in the sound itself, namely that it outputs pure high pitched garbage from certain applications and certain source materials.  I don't want anyone going deaf/destroying equipment, and I don't want to get backed into a corner on something I don't immediately know how to fix.  That said, I'm hoping @Kwiboo or @Da Alchemist or the like may have an idea of what's going on here, it's one of the more annoying issues holding this back from being a daily driver.  It's important to note I experienced the same sort of insanity using a simple I2S DAC with the Tinker Board.  If some PA settings can take care of it that's great, if it's a clock issue on the Tinker I'm not sure where to go from there.  I will be doing some testing on the new kernel 4.13, as there have been some clock reassignments/adjustments that, while seemingly unrelated, may be.  Also, has anyone found a specific driver for the Realtek chip, or is it still just "generic USB Audio?"

Posted

I am sorry, that I can´t help on this Topic. I am just a User and not someone who can deal with Driver Issues. Looking at Rockchip, i think that they have massive Problems with Sound-Drivers besides BSP Kernels. On my z28 (RK3328) I have only Sound on Android. I don´t think that there will be changes in near future, that is why I cancelled my Order on Rock64.

Posted

@TonyMac32 on LibreELEC for TinkerBoard we use a custom alsa config to force the use of device 2, unfortunately it also disables use of any other USB-Audio device, see https://github.com/Kwiboo/LibreELEC.tv/blob/rockchip/projects/Rockchip/devices/TinkerBoard/filesystem/usr/share/alsa/cards/USB-Audio.conf

We have also seen issues with DMA using Rockchip's release-4.4 kernel, see https://github.com/Kwiboo/linux-rockchip/issues/16 and https://github.com/Kwiboo/linux-rockchip/compare/rockchip-4.4...rockchip-4.4-pl330 for our current solution (use pl330 driver from upstream 4.12).

 

There is also some sort of buffer issue when switching between 2ch PCM, multi-channel PCM or NL-PCM/HBR HDMI modes, sometimes channels might get shifted one channel or garbage gets played depending on HDMI audio mode.

We had a similar issue on the Amlogic S905 SoC that uses the same DesignWare HDMI 2.0 TX IP, the hack used for Amlogic was to force a reset by switching to 2ch PCM mode before switching to any other mode, but on Amlogic multi-channel PCM, NL-PCM and HBR all use the PCM audio driver while on Rockchip I2S is used for all HDMI audio modes.

Posted

I have a few other things I'm playing with, however I wanted to post a quick "for experimentation only" post:

 

This is at your own risk, I take no responsibility for your ears or audio equipment.  I would highly recommend testing this on a small speaker at low gain until we build some confidence. I have had good luck with an experimental 4.4 kernel (Rockchip-curated one, lots of bugs still) and will start trying to flip a few more switches on support wise.  One of those is obviously sound.  

 

Tinker Board sound (to the jack) comes from a largely undocumented realtek USB codec, ALC4040, USB ID 481A.  It has a group of subdevices,  I assume for multi-channel use.  Now, for some reason, device 0,0 is NOT the headphone jack.  Device 0,2 is.  PulseAudio's hardware discovery only seems to log the first one, leaving the others untouched and unselectable.

tony@tinkerboard:/etc/pulse$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Audio [USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 2: USB Audio [USB Audio #2]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: rockchipminiarm [rockchip,miniarm-codec], device 0: ff890000.i2s-i2s-hifi i2s-hifi-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0

So, time to do things "the wrong way" (If anyone knows how to do it the "right way" let me know, I'm just making it work for now.  I would assume figuring out how to make PA enumerate it properly is the right answer, that's not what I'm doing here.)

 

tony@tinkerboard:~$ cd /etc/pulse
tony@tinkerboard:/etc/pulse$ sudo nano default.pa

find the section that looks like

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=inp$
#load-module module-null-sink
#load-module module-pipe-sink

Then add to that section:

load-module module-alsa-sink device=hw:0,2 sink_name=tinker_output

and save.

 

Now reboot for best results.  You should see another "USB Audio" device, select it as your sink if it's not already selected.  I haven't bothered making it the default device as yet.

 

Now, for the warnings:

 

    I fully believe this to be a Rockchip problem, not an ASUS or Tinkerboard problem, but in the past when I've tested this I would, upon playing certain source material, get absolute garbage out of the output.  Very loud and terrifying garbage.  There have been a lot of changes to the clock system over the last year with Rockchip, assignments and improvements, so it is possible this has been remedied, so I am testing it again.

Posted

I tested it with a linaro-rockchip Git image I built on 2018/01/04. There are two programs capable of audio playing in the linaro-rockchip image, namely, aplay and Chromium Browser (and I cannot install any other, since networking is broken in the image).

 

I tried with an assorted set of files, with different sample sizes and frequencies, from 16b/44khz to 24b/192khz. Some of them were in WAV and others in FLAC format. Results were:

  • Chromium Browser plays all files perfectly.
  • aplay plays WAV files OK, but when you try FLAC files it makes a horrible loud noise. My guess is that it doesn't recognize FLAC format, and reads the files as raw audio data.

So it looks like the driver is working OK, and the problem is only with aplay.

Posted

Thank you for the feedback, I spent yesterday playing videos/movies/music/etc with the rockchip kernel on Armbian with no problems, I'll move over to mainline next

 

  On 1/15/2018 at 5:15 PM, JMCC said:

My guess is that it doesn't recognize FLAC format, and reads the files as raw audio data

Expand  

 

I would guess that to be true but don't "know" in a legal sense, I found some various references that show people piping like this:

flac -d filesname.flac -o - | aplay -D sysdefault:CARD=card

 

Posted

Yep. The problem is that the flac binary is not included in the image, and since it has no network it would be very difficult to install it. However, FLAC files are played OK by Chromium, and other WAV files with the same frequency and sample size are played OK by aplay too. So I think the driver is working fine.

Posted

Okay, so I figured out a way to connect my Tinker to wired ethernet, and did the remaining tests. As expected, files play perfectly. I also did some tests regarding graphics, but I will start another thread for that.

 

Posted

I just noticed the Debian stretch image for the Tinkerboard, downloaded it and tried it. No HDMI sound. Is there a way to enable it, just like the one you pointed our for the USB audio?

Posted

Please provide the output link of armbianmonitor -u

 

I haven't messed with sound on mainline yet, but I recall a sound-soc error in my dmesg, meaning there probably is something wrong .

Posted

[2.875599] OF: /sound/simple-audio-card,codec: could not get #sound-dai-cells for /hdmi@ff980000

[ 2.875607] asoc-simple-card sound: parse error -22

[ 2.875630] asoc-simple-card: probe of sound failed with error -22

 

Well then.

Posted
  On 1/14/2018 at 7:30 PM, TonyMac32 said:

I have a few other things I'm playing with, however I wanted to post a quick "for experimentation only" post:

 

This is at your own risk, I take no responsibility for your ears or audio equipment.  I would highly recommend testing this on a small speaker at low gain until we build some confidence. I have had good luck with an experimental 4.4 kernel (Rockchip-curated one, lots of bugs still) and will start trying to flip a few more switches on support wise.  One of those is obviously sound.  

 

Tinker Board sound (to the jack) comes from a largely undocumented realtek USB codec, ALC4040, USB ID 481A.  It has a group of subdevices,  I assume for multi-channel use.  Now, for some reason, device 0,0 is NOT the headphone jack.  Device 0,2 is.  PulseAudio's hardware discovery only seems to log the first one, leaving the others untouched and unselectable.

tony@tinkerboard:/etc/pulse$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Audio [USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 2: USB Audio [USB Audio #2]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: rockchipminiarm [rockchip,miniarm-codec], device 0: ff890000.i2s-i2s-hifi i2s-hifi-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0

So, time to do things "the wrong way" (If anyone knows how to do it the "right way" let me know, I'm just making it work for now.  I would assume figuring out how to make PA enumerate it properly is the right answer, that's not what I'm doing here.)

 

tony@tinkerboard:~$ cd /etc/pulse
tony@tinkerboard:/etc/pulse$ sudo nano default.pa

find the section that looks like

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=inp$
#load-module module-null-sink
#load-module module-pipe-sink

Then add to that section:

load-module module-alsa-sink device=hw:0,2 sink_name=tinker_output

and save.

 

Now reboot for best results.  You should see another "USB Audio" device, select it as your sink if it's not already selected.  I haven't bothered making it the default device as yet.

 

Now, for the warnings:

 

    I fully believe this to be a Rockchip problem, not an ASUS or Tinkerboard problem, but in the past when I've tested this I would, upon playing certain source material, get absolute garbage out of the output.  Very loud and terrifying garbage.  There have been a lot of changes to the clock system over the last year with Rockchip, assignments and improvements, so it is possible this has been remedied, so I am testing it again.

Expand  

 

As a beginner, I tried to get the sound working on the jack.  The way described by TonyMac32 (above) works well, Thank you for the quality of description !

Posted
  On 1/20/2018 at 3:24 PM, TonyMac32 said:

[2.875599] OF: /sound/simple-audio-card,codec: could not get #sound-dai-cells for /hdmi@ff980000

[ 2.875607] asoc-simple-card sound: parse error -22

[ 2.875630] asoc-simple-card: probe of sound failed with error -22

 

Well then.

Expand  

 

I see this on my system as well. Does that mean that there's no sound support for the Tinker Board with armbian?

Posted

The USB codec is available following the above instructions on all kernels.  It would appear, at least for mainline, the HDMI out and I2S are not working.  They should be fine for 4.4 kernels.

Posted

uname -a says "Linux tinkerboard 4.14.18-rockchip #39 SMP PREEMPT Fri Feb 9 12:48:26 CET 2018 armv7l GNU/Linux"

 

linux-image-next-rockchip - 5.41.180208

I did not have /etc/pulse/default.pa, but I created it with this:

load-module module-alsa-sink device=hw:0,2 sink_name=tinker_output

aplay -l says:

**** List of PLAYBACK Hardware Devices ****
card 0: Audio [USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 2: USB Audio [USB Audio #2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@tinkerboard:~#

 

(I want to use the analog jack output)

Posted

Card 0:2 is the desired alsa device.  It will not change anything in aplay to map it to pulse audio, but it should appear in the menu of available sinks on the desktop.

Posted (edited)

hi,

i am completely new to the raspberry world.

 

I bought a Tinker board with the pi desktop element  14 case. After some issues mainly because of the support of the power button, all works fine except the sound: i have simply no sound from hdmi nor jack outputs.

 

With the informations below, can someone help me ?

 

Thanks,

 

Willy.

 

 

Result of "uname -a":

Linux tinkerboard 4.14.23-rockchip #55 SMP PREEMPT Thu Mar 1 10:56:06 CET 2018 armv7l armv7l armv7l GNU/Linux

 

Result of "aplay -l":

*** List of PLAYBACK Hardware Devices ****
card 0: Audio [USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 2: USB Audio [USB Audio #2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

 

Result of "dmesg | grep -e audio":

[    1.261741] usbcore: registered new interface driver snd-usb-audio
[    2.362115] OF: /sound/simple-audio-card,codec: could not get #sound-dai-cells for /hdmi@ff980000

 

Result of "cat /var/log/syslog | grep -e alsa":

Mar  5 19:19:48 localhost pulseaudio[2993]: [pulseaudio] module.c: Failed to load module "module-alsa-sink" (argument: "device=OnBoard_D0 sink_properties=device.description="BT_VOIP-Output""): initialization failed.

 

Result of "cat /etc/pulse/default.pa":

  Reveal hidden contents

 

Edited by Tido
added spoiler
Posted
  On 3/5/2018 at 7:14 PM, JMCC said:

You must install the "default" image, not "mainline".

Expand  

 

Correct.  Now that Default is working, mainline will receive this update as well. (kernel patch and testing in process)

 

until then see the post above this one in this thread: 

 

Posted

Bumping this due to some random issues seen with PulseAudio and perhaps ALSA allegedly due to the PA scriptto properly name the onboard USB names.  @chwe, if you would so kindly take the last few posts from the Tinker Board Bluetooth thread involving audio and stuff them in here?

Posted

Mainline kernel is a bit odd on my armbian build for my rk3288 tv box. It works but I think there is something not perfect in the HDMI driver because sound works every other time I power cycle the monitor.

When the sound is not working ,text and graphics looks a bit blurry, like the monitor is not set up for native resolution. Doing a power cycle gives sharp text and graphics and perfectly working sound.

Posted (edited)
  Reveal hidden contents

 

 

Woohoo! On 4.14.52-rockchip (mainline) I got it working immediately with this fix! A small tweak; instead of rebooting, killing pulseaudio worked for me. Note that on the "debian server" image pulseaudio isn't installed by default.

pulseaudio -k
mplayer <some song>

Now let's go replacing my old bulky media server with my fancy new tinker board ;)

Edited by Tido
added spoiler
Posted
  On 8/24/2018 at 6:09 PM, zeekoe said:

Woohoo! On 4.14.52-rockchip (mainline) I got it working immediately with this fix!

Expand  

:o

 

I didn't know it wasn't working out of the box, I've fixed the issue in the scripts and aded a udev rule:

https://github.com/armbian/build/commit/9b6a1c23a3252719cda76a0e8b20d756004b3b1f

 

That rule keeps you from getting the "USB analog stereo" or whatever sink/source, where pulseaudio probes the device after it's been manually loaded.

 

Thanks for the (inadvertent) heads up, and for the kudos.  :)

Posted
  On 8/28/2018 at 3:33 AM, TonyMac32 said:

:o

 

I didn't know it wasn't working out of the box, I've fixed the issue in the scripts and aded a udev rule: 

https://github.com/armbian/build/commit/9b6a1c23a3252719cda76a0e8b20d756004b3b1f

 

That rule keeps you from getting the "USB analog stereo" or whatever sink/source, where pulseaudio probes the device after it's been manually loaded.

 

Thanks for the (inadvertent) heads up, and for the kudos.  :)

Expand  

Thanks. About the solution, isn't the main problem the missing manual configuration? (the load-module module-alsa-sink device=hw:0,2 sink_name=tinker_output part)? That's not there after a clean install.

Posted
  On 8/29/2018 at 11:24 AM, TonyMac32 said:

it won't be reflected in downloads until we rebuild images.

Expand  


Are they (both) ready for the rebuild? Are there any open things that would need extra update hacks?

 

v5.59 = images, v5.60 = (bugfix) update with all packages rebuild. 

Posted

With the fix to 4.14 reboot last night they should be ready. The only thing I can think of is the RPi touchscreen on 4.4 has an upside-down touchscreen response, if the user rotates the desktop in settings it's ok again.

Sent from my Pixel using Tapatalk

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines