3 3
TonyMac32

Tinker Board Sound

Recommended Posts

8 minutes ago, TonyMac32 said:

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.


That is good enough! Thank. Will rebuild them ASAP and write this as a remark at the download page.

Share this post


Link to post
Share on other sites

I'm not getting sound out of the Tinker with Debian Strench (but with Ubuntu it works!) - Does anyone know what I'm doing wrong? I want audio out of the 3mm audio jack.

Share this post


Link to post
Share on other sites

And another sound related question from me: does anyone have the input working? I have:

* Silence on onboard D0

* mild noise on onboard D1

 

All unrelated to what I do on the input. If I don't ground the input (I connected a 6,5mm jack to it; one of my use cases is a guitar looper), I get 50Hz noise on my audio out. Capture 0 and Capture 1 volume on alsamixer don't seem to have effect on that. The fact that I need to ground the input, gives me the feeling that "something" is working.

I also tried with a regular TRRS head set to check if my weird setup is the problem, same: silence on D0, mild noise on D1.

 

Note that I checked D0 and D1 with audacity over ALSA over SSH. Audacity also had a "default" that did record something. Even with no microphone connected. Then I discovered it recorded the microphone of the laptop on which I run audacity. Still I think D0 and D1 *are* from the tinker board, because when running audacity on the laptop itself (not over SSH) all other inputs are completely different.

 

Does anyone have sound in working? I think it worked before, the first time I checked it, with the TRRS head set. But I'm not sure. Maybe I was too rough on the TRRS connector of the tinker board? It looks very OK though. I'm puzzled.

Share this post


Link to post
Share on other sites

Everyone involved please post the armbianmonitor -u output as directed in the forum guidelines/banners so I can get some idea what we're all talking about.

Sent from my Pixel using Tapatalk

Share this post


Link to post
Share on other sites

Sorry, clicked them away once and now I don't know what was there.

http://teune.email/armbianmonitor.txt

That's with mainline kernel BTW.

Edit: I just tried switching, but the docs point me here where I just see two repos. I can see a linux-u-boot-tinkerboard-next package which may or may not do the trick, and armbian-config just seems to let me switch kernel versions, not mainline to next and vice versa.

Could it help me trying to switch to next? If so, is there a place with slightly more documentation on how to do it?

Edited by zeekoe

Share this post


Link to post
Share on other sites

I haven't looked at 4.14 recently, let me see if there is an issue there. There are 4.19 beta images available in dl.armbian.com under tinkerboard, let me know if you are willing)able to try that out to see if the sound works.

Sent from my Pixel using Tapatalk

Share this post


Link to post
Share on other sites

Thanks. That would mean a full install right, not like switching channels and apt upgrading? Maybe I can try later this week. If I can find a spare SD somewhere (really, I don't have that much of them laying around :))

Share this post


Link to post
Share on other sites

Downloaded what I think is the latest nightly with mainline:

 

papier@tinkerboard:~$ uname -a
Linux tinkerboard 4.19.12-rockchip #5.67.181227 SMP PREEMPT Thu Dec 27 02:25:07 CET 2018 armv7l GNU/Linux

 

papier@tinkerboard:~$ arecord -l

Spoiler

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

 

I think at first opening of audacity I saw an onboard D2, but I didn't see it ever after.

Same results: D0 silence, D1 mild noise independent of the input. I did see spikes however when turning on/off the (70's/80's) stereo set nearby.

Does it help if I upload a new armbianmonitor output?

 

Share this post


Link to post
Share on other sites
11 minutes ago, zeekoe said:

Does it help if I upload a new armbianmonitor output?

 

No, that's alright, I have a nightly running as well.  I've  just used Audacity with 3 different headsets on D1, all function properly.  In Audacity I simply had it set to all defaults, PA set to default source of "Headset-input"

 

4.19.12, Debian Stretch

 

Share this post


Link to post
Share on other sites

Thanks a lot for checking. I did some (hardware) measurements, all seemed well. Then tried just another time, having reconnected everything, and... it all seems to work now. :-? Really don't know why. Sorry for all the fuss...

(Now on to wrestling with jackd to get input and output to work simultaneously, will report the settings back when I get it, won't be tonight...)

 

edit: jackd settings found. Can't seem to set them like this in qjackctl, but can set them manually in .jackdrc:

~$ cat .jackdrc
/usr/bin/jackd -v -dalsa -Chw:OnBoard,1 -Phw:OnBoard,2 -p2048 -n4
  • the -p and -n are trial-and-errored to prevent xruns
  • The headphone jack input is on subdevice OnBoard,1 and the headphone jack output is on subdevice OnBoard,2

 

This is for ARMBIAN 5.60 stable Debian GNU/Linux 9 (stretch) 4.14.70-rockchip

Share this post


Link to post
Share on other sites

Hello, I want to enable sound using the S/PDIF on my tinker board. What I have to do?

 

At the moment I have attached an optical transmitter jack (toslink) at the specified output (pin between USB and LAN connector, the outer one, pin4 - 5V & pin6 - GND).

I have installed the "ARMBIAN 5.73 stable Ubuntu 18.04.2 LTS 4.19.20-rockchip".


 

$ aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: OnBoard [USB Audio OnBoard], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: OnBoard [USB Audio OnBoard], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: OnBoard [USB Audio OnBoard], device 2: USB Audio [USB Audio #2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: rockchiptinkerc [rockchip,tinker-codec], device 0: ff890000.i2s-i2s-hifi i2s-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

 

Share this post


Link to post
Share on other sites
14 hours ago, TonyMac32 said:

They are registered with PulseAudio, in the desktop click on the speaker, go to the second sink is S/PDIF.

 

https://github.com/armbian/build/blob/master/packages/bsp/rockchip/pulseaudio.txt

 

shows the pulseaudio links to which ALSA device.

 

 

 

 

Thank you very much! Such simple solution - the red LED now was switched on. Is there the same solution using LibreELEC? Background information: Armbian actually is very slow with Kodi installation, with LibreELEC it runs smoothly but without SPDIF at the moment. Alternatively I could activate hardware acceleration for GPU in armbian, but how to do?

Share this post


Link to post
Share on other sites

Unknown, that is a different distribution. Have you run the rk3288 media script created by@jmcc? Without it you don't have the Mali drivers , etc.

Sent from my Pixel using Tapatalk

Share this post


Link to post
Share on other sites
On 2/20/2019 at 6:53 PM, TonyMac32 said:

Unknown, that is a different distribution. Have you run the rk3288 media script created by@jmcc? Without it you don't have the Mali drivers , etc.

Sent from my Pixel using Tapatalk
 

Toslink on armbian (using pulseaudio) works fine with my music center. I tried the media script and installed accelerated Kodi (it is not the latest release) from that. Now Kodi is smooth enough and SPDIF is available in audio configuration of Kodi. Next I will test it by playing an video and, when running good enough, configure it to start Kodi on system startup. This could be an alternative to LibreELEC in case of I can't get it to work with S/PDIF.

Share this post


Link to post
Share on other sites
On 2/24/2019 at 7:25 PM, gen2thomas said:

Toslink on armbian (using pulseaudio) works fine with my music center.

Kodi ... SPDIF is available

I'm not able to configure armbian nor KODI with paththrough. Only stereo is available. Can I solve this (with configuration and/or rebuild of kernel and/or KODI) or is this an known limitation at the moment?

Share this post


Link to post
Share on other sites

After some playing around with "aplay -L" and "speaker-test -D" the device "iec958" seems to be not OK.
 

iec958:CARD=OnBoard,DEV=0
    USB Audio OnBoard, USB Audio
    IEC958 (S/PDIF) Digital Audio Output

 

All devices with "DEV=1" in the name, except "dsnoop" switches the LED light on while playing with speaker-test.

The iec958 device only works with "-r8000" like all other devices with "DEV=0" (possible BT-devices) and the LED light keeps off.

see also "cat /proc/asound/card0/stream0" --> gives the rate 8000

 

The test code: "speaker-test -D iec958:CARD=OnBoard,DEV=0 -c2 -r8000"

 

This only works with r8000:        "speaker-test -D dmix:CARD=OnBoard,DEV=0 -c2 -r8000"

This switched the LED on:            "speaker-test -D dmix:CARD=OnBoard,DEV=1 -c2"

This gives sound on head phone: "speaker-test -D dmix:CARD=OnBoard,DEV=2 -c2"

 

Is this wrong mapping, a configuration failure or an kernel issue?

Share this post


Link to post
Share on other sites

Hi, I have made some progress for SPDIF paththrough. All tests are made with alsa and mpv, therefore pulsaudio was deactivated to simplify things.

 

Remember was the problem is:

 aplay -L|grep iec958

 iec958:CARD=OnBoard,DEV=0

Which is wrong for tinkerboard, it should be "DEV=1"

 

Deactivate pulsaudio (use sudo if necessary) refer to KodiWiki:

 * open "/etc/pulse/client.conf", set autospawn from "yes" to "no" and remove comment sign ";"

 * reboot or just "pulseaudio --kill"

 

Prepare mpv with configuration in users home directory:

 * open/create ~/.config/mpv/mpv.conf and add some content for play with:

 

Spoiler

#to prevent to quiet sound
volume=100
#use this command to check for available devices:
# mpv --audio-device=help
# Of cause also "dmix" or others are possible
# I'm using "plughw"
# All options also can passed by command line
# e.g. --volume 100
#BT
#audio-device=alsa/plughw:CARD=OnBoard,DEV=0

#SPDIF with paththrough (will only work with fix):
audio-spdif=ac3,dts,dts-hd,eac3,truehd
audio-device=alsa/iec958:CARD=OnBoard,DEV=1

#SPDIF stereo
#audio-device=alsa/plughw:CARD=OnBoard,DEV=1

#jack for headphone:
#audio-device=alsa/plughw:CARD=OnBoard,DEV=2

#HDMI (sometimes muted):
#audio-device=alsa/plughw:CARD=rockchiptinkerc

 

Test mpv:

* make an ac3 (or another) video available for testing e.g. in users home directory

* open command line (so you can see the messages from mpv)

* start "mpv MyMovie.mkv" --> the movie plays without audio

* stop video and see some errors from mpv marked with [ao]

* modify mpv.conf for your preferred output and start the movie again --> this should work

 

Fix the problem

* see next post(s)

 

Share this post


Link to post
Share on other sites
38 minutes ago, gen2thomas said:

Fix the problem

* see next post(s) 

 

 

For now I have only an dirty hack to force alsa to get the correct device number.

 

Manipulate file

* Open "/usr/share/alsa/cards/USB-Audio.conf" and jump to the end of the file.

* In section "USB-Audio.pcm.iec958.1" set the value of "default 999" to another value, e.g. "1". "999" means "deactivated".

 

Restart alsa and check

* alsactl init
* "aplay -L|grep iec958" will gives a new device

iec958:CARD=OnBoard,DEV=0
iec958:CARD=OnBoard,DEV=1

 

Remove the wrong device and check

* Open "/usr/share/alsa/cards/USB-Audio.conf" and jump to the end of the file.

* In section "USB-Audio.pcm.iec958.0" set the value of "default 0" to "999".

* alsactl init
* "aplay -L|grep iec958" will gives only the right device

iec958:CARD=OnBoard,DEV=1

 

Test mpv:

* open command line (so you can see the messages from mpv)

* start "mpv MyMovie.mkv" --> the movie plays (eventually without audio when no fiber cable is connected to your sound system)

* stop video and see there is no error anymore for audio

* recognize the line "AO: [alsa] 48000Hz stereo 2ch spdif-ac3" --> seems to be the correct paththrough

 

Next step is to prevent this dirty hack with "/etc/asound.conf" or another solution for normally use. Any idea?

 

BTW: This also works great with KODI!

 

Share this post


Link to post
Share on other sites
On 3/8/2019 at 4:54 PM, gen2thomas said:

Next step is to prevent this dirty hack with "/etc/asound.conf" or another solution for normally use. Any idea?

 

 

Using the "/atc/asound.conf" for this to prevent modifications of the system file "/usr/share/alsa/cards/USB-Audio.conf" is pretty simple.

 

* Open the files "/etc/asound.conf" and "/usr/share/alsa/cards/USB-Audio.conf" with your prefered editor.

* Copy the last two sections of the "USB-Audio.conf" incl. "<confdir:pcm/iec958.conf>" to the "asound.conf" (at the end of the file).

* Close the file "USB-Audio.conf".
* Add "cards." before the section description e.g. "cards.USB-Audio.pcm.iec958.0 {...}". in "asound.conf"

* Change the values "default 0" to "default 999" and "default 999" to "default 1".

* alsactl init
* "aplay -L|grep iec958" will gives only the right device

iec958:CARD=OnBoard,DEV=1

 

The result should look something like this:

Spoiler

pcm.OnBoard_D0 {

        type hw
        card OnBoard
        device 0

}

 

pcm.OnBoard_D1 {

        type hw
        card OnBoard
        device 1

}

 

pcm.OnBoard_D2 {

        type hw
        card OnBoard
        device 2

}

<confdir:pcm/iec958.conf>

cards.USB-Audio.pcm.iec958.0 {
        @args [ CARD AES0 AES1 AES2 AES3 ]
        @args.CARD { type string }
        @args.AES0 { type integer }
        @args.AES1 { type integer }
        @args.AES2 { type integer }
        @args.AES3 { type integer }
        @func refer
        name {
                @func concat
                strings [
                        "cards.USB-Audio."
                        { @func card_name card $CARD }
                        ".pcm.iec958:CARD=" $CARD
                        ",AES0=" $AES0 ",AES1=" $AES1 ",AES2=" $AES2 ",AES3=" $AES3
                ]
        }
        default {
                # FIXME: we cannot set the AES parameters
                type hw
                card $CARD
                device {
                        @func refer
                        name {
                                @func concat
                                strings [
                                        "cards.USB-Audio.pcm.iec958_device."
                                        { @func card_name card $CARD }
                                ]
                        }
                        default 999
                }
        }
}

cards.USB-Audio.pcm.iec958.1 {
        @args [ CARD AES0 AES1 AES2 AES3 ]
        @args.CARD { type string }
        @args.AES0 { type integer }
        @args.AES1 { type integer }
        @args.AES2 { type integer }
        @args.AES3 { type integer }
        @func refer
        name {
                @func concat
                strings [
                        "cards.USB-Audio."
                        { @func card_name card $CARD }
                        ".pcm.iec958_2:CARD=" $CARD
                        ",AES0=" $AES0 ",AES1=" $AES1 ",AES2=" $AES2 ",AES3=" $AES3
                ]
        }
        default {
                # FIXME: we cannot set the AES parameters
                type hw
                card $CARD
                device {
                        @func refer
                        name {
                                @func concat
                                strings [
                                        "cards.USB-Audio.pcm.iec958_2_device."
                                        { @func card_name card $CARD }
                                ]
                        }
                        default 1
                }
        }
}

 

Unfortunately some devices will disappear for alsa

front, surround21, surround41, surround50, surround51, surround71

In case of active using such devices the copy procedure must repeated for each needed device.

 

For simple tests with mpv generate your configuration file

Add/open the file ".config/mpv/mpv.conf" with your editor.

 

Add the next lines to it (actually HDMI is active):

Spoiler

#to prevent to quiet sound
volume=100
#use this command to check for available devices:
# mpv --audio-device=help
# Of cause also "dmix" or others are possible
# I'm using "plughw"
# All options also can passed by command line
# e.g. --volume 100
#BT
#audio-device=alsa/plughw:CARD=OnBoard,DEV=0

 

#SPDIF with passthrough (will only work with fix):
#audio-spdif=ac3,dts,dts-hd,eac3,truehd
#audio-device=alsa/iec958:CARD=OnBoard,DEV=1

 

#SPDIF stereo
#audio-device=alsa/plughw:CARD=OnBoard,DEV=1

 

#jack for headphone:
#audio-device=alsa/plughw:CARD=OnBoard,DEV=2

 

#HDMI (sometimes muted):
audio-device=alsa/plughw:CARD=rockchiptinkerc

 

Share this post


Link to post
Share on other sites

@gen2thomas

AFAIK the tinkerboard analog output is handled by an internal device attached to the bus, but SPDIF and HDMI audio devices are handled by the SoC itself, so it is not proper to describe them as "USB-Audio" in asound.conf

 

I have a rk3288 tvbox without the analog part, and found (by trial and error) a solution the the pulseaudio naming with this asound.conf: https://github.com/paolosabatino/armbian-build/blob/224c6ed3c1599263bfb4c4a2f21584eb5b73f940/packages/bsp/rockchip/asound.conf

It works flawlessy for me, but it is required to change the simple-audio-card,name property in the tinkerboard device tree from rockchip,tinker-codec (which I think is "improper", can't find any other audio device with this naming style) to DW-I2S-HDMI (for HDMI) and SPDIF (for SPDIF).

Dunno if it solves your passthrough problem or whatever, but may be a step in the right direction (I'd like to submit a merge request soon)

 

See also:

 

Share this post


Link to post
Share on other sites

Recently, my sound stopped working, perhaps after an update. After some searching I found out that for me, the card order had been changed.

 

flac -d file.flac -o - |aplay -D hw:1,2

confirmed me on that. So where you read hw:0,2 before in this thread it should become hw:1,2. That is, if your aplay -l output is like this:

**** List of PLAYBACK Hardware Devices ****
card 0: rockchiptinkerc [rockchip,tinker-codec], device 0: ff890000.i2s-i2s-hifi i2s-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: OnBoard [USB Audio OnBoard], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: OnBoard [USB Audio OnBoard], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: OnBoard [USB Audio OnBoard], device 2: USB Audio [USB Audio #2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Hope that helps for someone else. :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
3 3