f8n Posted November 8, 2018 Posted November 8, 2018 Trying to get sound working on my t4. Looks like pulseaudio detects the realtek rt5651-codec but I can't get any sound out of it. The software mixer seems to be showing audio, I just can't hear anything nanopct4 4.4.161-rk3399 SMP aplay-l shoulws realtekrt5651co as device0. Any help debugging this would be great. Regards, Cam
NicoD Posted November 9, 2018 Posted November 9, 2018 12 hours ago, f8n said: Trying to get sound working on my t4. Looks like pulseaudio detects the realtek rt5651-codec but I can't get any sound out of it. The software mixer seems to be showing audio, I just can't hear anything nanopct4 4.4.161-rk3399 SMP aplay-l shoulws realtekrt5651co as device0. If it helps. USB audio adapters work. It`s the same with the M4. I mostly use hdmi sound so no big problem for me. I think it`s the same in FriendlyElecs Lubuntu. Many people have asked about it.
guidol Posted November 9, 2018 Posted November 9, 2018 16 hours ago, f8n said: aplay-l shoulws realtekrt5651co as device0. Any help debugging this would be great. Does your /etc/asounf.conf include the following lines?: pcm.!default { type hw card 0 device 0 } ctl.!default { type hw card 0 } Whats the complete output from aplay -l ?
f8n Posted November 9, 2018 Author Posted November 9, 2018 nanopct4:/etc$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: realtekrt5651co [realtek,rt5651-codec], device 0: ff880000.i2s-rt5651-aif1 rt5651-aif1-0 [] Subdevices: 0/1 Subdevice #0: subdevice #0 card 1: rockchiphdmi [rockchip,hdmi], device 0: ff8a0000.i2s-i2s-hifi i2s-hifi-0 [] Subdevices: 0/1 Subdevice #0: subdevice #0 card 2: ROCKCHIPSPDIF [ROCKCHIP,SPDIF], device 0: ff870000.spdif-dit-hifi dit-hifi-0 [] Subdevices: 0/1 Subdevice #0: subdevice #0 nanopct4:/etc$ nanopct4:/etc$ cat asounf.conf pcm.!default { type hw card 0 device 0 } ctl.!default { type hw card 0 } In the pulseaudio UI I do see multiple default servers and multiple sinks, no combinations produce sound. I have {GUID}unix:/run/user/1000/pulse/native and nanopct4 as server options. the native option hoverover says 'detected in X properties' and the nanopct4 server option has: user: myusername hostname: nanopct4 server name: pulseaudio server version 11.1 default sample spec: s16le 2ch 44100Hz default channel map: front-left, front-right default sink: alsa_output.platform-rt5651-sound.stereo-fallback default source: alsa_output.platform-rt5651-sound.stereo-fallback.monitor cookie: some:id which would make me think that this is the option to use as its bound to the alsa config?
f8n Posted November 9, 2018 Author Posted November 9, 2018 Also is there a quick and easy way to export the pulse audio sink information? Learning some of the pulse basics from https://gavv.github.io/blog/pulseaudio-under-the-hood/ and https://wiki.archlinux.org/index.php/PulseAudio/Examples to get caught up on how pulse actually manages the end to end flow. Regards, Cam
f8n Posted November 9, 2018 Author Posted November 9, 2018 Shoot, noticed I had a typo /etc/asounf.conf vs /etc/asound.conf . One sec, going to rename and restart to see if that fixes it.
f8n Posted November 10, 2018 Author Posted November 10, 2018 http://wiki.friendlyarm.com/wiki/index.php/NanoPC-T4#Set_Audio_Device says that card 1 should be set in the asound.conf but looking at aplay -l card 0 looks like it is the 3.5mm jack. All the packages in the set audio device section were installed `apt-get install libasound2 alsa-base alsa-utils`
f8n Posted November 10, 2018 Author Posted November 10, 2018 Ran an alsa-info to try to get more insight into what the audio chip is doing. Not sure what to make of the unknown pin headphones messages. Perhaps someone could compare my result to their working setup: !!ALSA/HDA dmesg !!-------------- [ 1.829446] rockchip-saradc ff100000.saradc: Looking up vref-supply from device tree [ 1.830173] usbcore: registered new interface driver snd-usb-audio [ 1.834781] u32 classifier -- [ 1.979831] rockchip-drm display-subsystem: bound ff8f0000.vop (ops 0xffffff8008d45a28) [ 1.980583] dwhdmi-rockchip ff940000.hdmi: Detected HDMI TX controller v2.11a with HDCP (DWC HDMI 2.0 TX PHY) [ 1.983345] rockchip-drm display-subsystem: bound ff940000.hdmi (ops 0xffffff8008d3ab40) -- [ 2.667230] rockchip-dmc dmc: could not find power_model node [ 2.673873] of_get_named_gpiod_flags: parsed 'simple-audio-card,hp-det-gpio' property of node '/rt5651-sound[0]' - status (0) [ 2.673888] of_get_named_gpiod_flags: can't parse 'simple-audio-card,mic-det-gpio' property of node '/rt5651-sound[0]' [ 2.692154] asoc-simple-card rt5651-sound: ASoC: DAPM unknown pin Headphones [ 2.693891] asoc-simple-card rt5651-sound: rt5651-aif1 <-> ff880000.i2s mapping ok [ 2.693959] asoc-simple-card rt5651-sound: ASoC: no source widget found for MICBIAS1 [ 2.693972] asoc-simple-card rt5651-sound: ASoC: Failed to add route MICBIAS1 -> direct -> Mic Jack [ 2.694322] rt5651 1-001a: ASoC: mux INL1 Mux has no paths -- [ 2.694420] rt5651 1-001a: ASoC: mux INR2 Mux has no paths [ 2.698559] input: realtek,rt5651-codec Headphones as /devices/platform/rt5651-sound/sound/card0/input4 [ 2.699560] of_get_named_gpiod_flags: can't parse 'simple-audio-card,hp-det-gpio' property of node '/hdmi-sound[0]' [ 2.699569] of_get_named_gpiod_flags: can't parse 'simple-audio-card,mic-det-gpio' property of node '/hdmi-sound[0]' [ 2.700408] asoc-simple-card hdmi-sound: i2s-hifi <-> ff8a0000.i2s mapping ok [ 2.706177] of_get_named_gpiod_flags: can't parse 'simple-audio-card,hp-det-gpio' property of node '/spdif-sound[0]' [ 2.706203] of_get_named_gpiod_flags: can't parse 'simple-audio-card,mic-det-gpio' property of node '/spdif-sound[0]' [ 2.707313] asoc-simple-card spdif-sound: dit-hifi <-> ff870000.spdif mapping ok -- [ 2.735835] vcc_lcd: disabling [ 2.737442] ALSA device list: [ 2.737448] #0: realtek,rt5651-codec -- [ 2.774218] mmc_host mmc2: Bus speed (slot 0) = 150000000Hz (slot req 150000000Hz, actual 150000000HZ div = 0) [ 2.842491] asoc-simple-card rt5651-sound: ASoC: DAPM unknown pin Headphones [ 3.011496] wifi_platform_bus_enumerate device present 1 -- [18640.323785] [UFW BLOCK] IN=eth0 OUT= SRC=192.168.2.107 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=56020 PROTO=2 [18688.338071] asoc-simple-card rt5651-sound: ASoC: DAPM unknown pin Headphones [18695.449217] asoc-simple-card rt5651-sound: ASoC: DAPM unknown pin Headphones [18696.131221] asoc-simple-card rt5651-sound: ASoC: DAPM unknown pin Headphones [18699.250179] asoc-simple-card rt5651-sound: ASoC: DAPM unknown pin Headphones
guidol Posted November 10, 2018 Posted November 10, 2018 12 hours ago, f8n said: Shoot, noticed I had a typo /etc/sounf.conf vs /etc/sound.conf . One sec, going to rename and restart to see if that fixes it. next typo its /etc/asound.conf Did you check that not a volume-slider which belongs to the analog-audio is muted (unmute with the m-key) Something like master-slider or DAC Maybe you could also check if analog-audio is enabled in armbian-config -> system - > hardware
f8n Posted November 10, 2018 Author Posted November 10, 2018 Positive I'm good on the spelling. It was below freezing yesterday and my typing suffered significantly. cbosnic@nanopct4:/$ ls -la /etc/asoun* -rw-r--r-- 1 root root 94 Nov 9 23:38 /etc/asound.conf cbosnic@nanopct4:/$ cat /etc/asound.conf pcm.!default { type hw card 0 device 0 } ctl.!default { type hw card 0 } Volume sliders are up at 100% I don't seem to have hardware as an option to verify the board settings...
f8n Posted November 10, 2018 Author Posted November 10, 2018 Here are my mixer settings, its multiple pages of images so if there is a specific target I should be looking at let me know. For now everything is unmuted OO state.
f8n Posted November 10, 2018 Author Posted November 10, 2018 Managed to get a massive ear bleeding screech out of the audio jack after flipping bits around to enable/disable the microphone inputs folled by toggling rt5651 asrc enable/disable in the alsa mixer. Trying to hone in now on how to get audio without mic feedback. On the right track at least. 2
dogshome Posted November 13, 2018 Posted November 13, 2018 Confirming - Same on M4. I initially had nothing, them distorted sounds after playing with alsa. I still haven't bottomed it, but turning things on an off using m key makes it work. After bootup, occasionally I have to do this again. I can't identify which channel and it all feels a bit buggy - like a wrong address. Something fundamental and not just a configuration setting error. Watching with interest.
morfane Posted November 22, 2018 Posted November 22, 2018 Hello folks, i'm pretty new to armbian and trying to run i3wm on armbian on my NanoPC T4 that connected to my HDMI TV. When i used FriendlyDesktop, i needed to change the output to use the HDMI work. And i tried to install i3 on FriendlyCore but happened to got many problems but the support ppl at FriendlyElec really interested and tried to help. But while trying, i also wanted to check armbian and found it awesome, installed i3 and run without any problems and also the programs like chromium. Yet i'm unable to get any sound from HDMI. I tried to do the solution at FriendlyCore's wiki on the matter at first with installing libasound2, asla-base and alsa-utils but getting error on installing alsa-base, something like content change. Tried aplay -l and got "No audio device found" error. I know that at least the HDMI audio output works but couldnt able to switch to it. Done lots of diggings and tried the pulseaudio comands. Still no results. What am i missing? What should be the problem? There is also one interesting thing i found out that with reboot command, device is rebooting without problem but with shutdown command, it starts shutdown process but ending up with a buggy colorful screen. I know the last part probably not related but added that might be some connection.
NicoD Posted November 22, 2018 Posted November 22, 2018 4 hours ago, morfane said: But while trying, i also wanted to check armbian and found it awesome, installed i3 and run without any problems and also the programs like chromium. Yet i'm unable to get any sound from HDMI. There should not be a problem with hdmi sound. Use pulseauio. Disable the onboard audio or just select the right interface and hdmi should work fine. It`s not clear which is hdmi and on-board. The one with the most i/o possibillity`s is on-board.
morfane Posted November 22, 2018 Posted November 22, 2018 2 hours ago, NicoD said: There should not be a problem with hdmi sound. Use pulseauio. Disable the onboard audio or just select the right interface and hdmi should work fine. It`s not clear which is hdmi and on-board. The one with the most i/o possibillity`s is on-board. The problem is pulseaudio seems not working properly too. When i just type pulseaudio, getting Unable to contact D-bus error for server-lookup.c and main.c. When i use the pulseaudio -k, getting "main.c: Failed to kill daemon: No such process" error.
morfane Posted November 22, 2018 Posted November 22, 2018 Update: I switched kernels from armbian-configi after reading at some forums and aplay -l gave the device list. Started i3 and opened chrome, tested a youtube video and it was working automatically. 1
NicoD Posted November 22, 2018 Posted November 22, 2018 2 hours ago, morfane said: tested a youtube video and it was working automatically. Good to hear it works. Tip for Youtube playback. Firefox plays perfect, but for surfing it s*cks. I use Vivaldi browser. Good for surfing, and better video playback than Chromium. Here you can download Vivaldi. Download the arm64 version. And install with gdebi package installer.https://vivaldi.com/nl/blog/snapshots/vivaldi-1-15-rc-2/ Enjoy your toy.
morfane Posted November 23, 2018 Posted November 23, 2018 8 hours ago, NicoD said: Good to hear it works. Tip for Youtube playback. Firefox plays perfect, but for surfing it s*cks. I use Vivaldi browser. Good for surfing, and better video playback than Chromium. Here you can download Vivaldi. Download the arm64 version. And install with gdebi package installer.https://vivaldi.com/nl/blog/snapshots/vivaldi-1-15-rc-2/ Enjoy your toy. I tried vivaldi while testing i3 on raspberry pi 3 model b+ but couldnt able to install from repos at armbian and at that moment, audio was my primary concern. But i tested many browsers on my i3 over rpi and vivaldi and chromium were the ones best for surfing and for video playback. I will try firefox too. Till this short time tough i3 over armbian is doing way better on performance than FriendlyDesktop.
NicoD Posted November 23, 2018 Posted November 23, 2018 4 hours ago, morfane said: I tried vivaldi while testing i3 on raspberry pi 3 model b+ For the rpi it`s this one. After installation you`ve got to sudo update && sudo upgradehttps://vivaldi.com/nl/blog/vivaldi-for-raspberry-pi/
NicoD Posted November 23, 2018 Posted November 23, 2018 4 hours ago, morfane said: i3 over armbian is doing way better on performance than FriendlyDesktop. Armbian is clocked at 1.5Ghz/2Ghz while FriendlyDesktop is at 1.4Ghz/1.8Ghz. This comes at the cost of more heat and more power consumption. Check your temps if you`re using it at 100%.
morfane Posted November 23, 2018 Posted November 23, 2018 10 minutes ago, NicoD said: For the rpi it`s this one. After installation you`ve got to sudo update && sudo upgradehttps://vivaldi.com/nl/blog/vivaldi-for-raspberry-pi/ I tried for rpi already 2 months ago and loved it. But havent seen at repos of armbian for NanoPC T4 6 minutes ago, NicoD said: Armbian is clocked at 1.5Ghz/2Ghz while FriendlyDesktop is at 1.4Ghz/1.8Ghz. This comes at the cost of more heat and more power consumption. Check your temps if you`re using it at 100%. Yes i know it is clocked but i also know using a tiling window manager over core is also slightly faster than even the lightest Desktop Environment. While i was using my rpi, i used the raspbian with its own desktop environment which is a modified version of lxde and also tried i3 over raspbian lite without GUI, i can say that i3 was a little better and sometimes that little makes some difference. Tough i'm not an expert, i prefer i3 as i found that it is good documented. And now the audio and shutdown also fixed, i can modifiy it a little By the way, i realized the heat is more than usual, the top heat i got while chromium with 10 tabs open was 55 degrees and now it stayed open like 4 hrs already with lxterminal running on i3 and feh for background image, it is 43 degrees. It was around 44-47 degrees too while working on FriendlyCore. I'm using the heatsink from FriendlyElec and a 40mmx10mm 5V fan.
NicoD Posted November 23, 2018 Posted November 23, 2018 12 minutes ago, morfane said: By the way, i realized the heat is more than usual, the top heat i got while chromium with 10 tabs open was 55 degrees and now it stayed open like 4 hrs already with lxterminal running on i3 and feh for background image, it is 43 degrees. It was around 44-47 degrees too while working on FriendlyCore. I'm using the heatsink from FriendlyElec and a 40mmx10mm 5V fan. That`s ok. Constant higher than +75c i wouldn`t recommend. But 55c is no problem. But it`s only when the cpu is used fully when the problem arrises. I haven`t tried i3. I`ll give it a try. Cheers
morfane Posted November 23, 2018 Posted November 23, 2018 11 minutes ago, NicoD said: That`s ok. Constant higher than +75c i wouldn`t recommend. But 55c is no problem. But it`s only when the cpu is used fully when the problem arrises. I haven`t tried i3. I`ll give it a try. Cheers Well, if you like to use less mouse and more keyboard and like the tiling type of windows, and not using much of things in a desktop environment out of some certain programs, i strongly recommend that. And they are very easy to customize, i even found them look better than a desktop environment, faster and easy to work. I'm using the gaps version of i3 that you can find the git image easily and installation. Even i didnt got any problems on things. But i'm still following the instructions on the raspberry pi forums except installing the i3 from repos, i'm installing i3-gaps from git. Those pages might help if needed. Sorry that i got off topic i guess.
s_frit Posted February 18, 2019 Posted February 18, 2019 Here is a way to get the onboard audio working on NanoPC T4 (and probably M4 too). It kind-of works with pulseaudio, but I think more work is needed for a good solution for pulseaudio (need to develop a UCM profile). The attached asound.state file will configure the rt5651 codec mixer with sane settings. To use it: Download the attached asound.state.draft.201902018 Run the following command from a terminal (in whatever directory you downloaded the file): alsactl --file ./asound.state.draft.201902018 restore After that you should have working headphone audio and microphone capture. WARNING: this command may make a loud audible thump. Do not wear the headphones when running it. Note that in the absence of a ucm profile, pulseaudio might make its own changes to the codec mixer settings at login, so you should run the above alsactl restore command *after* logging into the desktop. You can try using alsactl globally to save the settings for use after reboot, but personally I have not yet found a good solution -- please let me know if you have any thoughts on permanent save/restore and pulseaudio interop. There is some general discussion about asound.state management here. If you run alsamixer from the command line you can adjust output level using "DAC1" and "HP". Hit F4 for capture, then the gain settings that appear to work for the internal microphone are "ADC", "ADC Boost Gain" and "IN2 Boost". ... So far I developed this configuration with the help of the following resources: plbossart's configuration for baytrail boards using the same ALC5651 codec: https://github.com/plbossart/UCM ALC5651 codec data sheet v0.92 https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/6/ALC5651-DataSheet_5F00_V0.92.pdf (Audio routing diagrams are on pages 4 and 5. Page 4 is the analog routing, page 6 is the digital routing.) NanoPC-T4 Schematic http://wiki.friendlyarm.com/wiki/images/f/f4/NanoPC-T4-1802-Schematic.pdf NOTE: Beyond the codec mixer settings I think there are some things that can be tweaked with the device tree and drivers that may improve the microphone noise floor, but I haven't gone too far into that yet. If anyone is interested I'm happy to share my notes or discuss details of the routings I chose. asound.state.draft.201902018 1
s_frit Posted February 18, 2019 Posted February 18, 2019 Now that I've investigated making an ALSA UCM profile, I don't think that's necessary for the NanoPC T4 (although it could be useful for the M4 to distinguish between onboard and headset mic). For T4 it should be sufficient to just overwrite the global asound.state with the file that I posted earler, as follows: sudo cp asound.state.draft.201902018 /var/lib/alsa/asound.state Sidenote: For those who care about gain structure, I found the following values noted as "volumes for 0dB" defaults in plbossart's ALSA UCM profile. Probably with deep enough study these can be deduced from the 5651 data sheet. ADC Capture Volume = 47 DAC1 Playback Volume = 175 HP Playback Volume = 31 IN Capture Volume = 23 OUT Playback Volume = 31
s_frit Posted February 26, 2019 Posted February 26, 2019 In case anyone else wants to look at T4 audio I thought I'd leave a few of my notes here, as I need to move on to other things for a while. The device tree audio widgets mention "MICBIAS1" but the rt5651 driver actually uses the lower case string "micbias1". This seems to be a bug in FriendlyElec's .dts (probably copied from some other realktek codec drivers which do use the uppercase spelling). Fixing this fixes an error message in the dmesg startup log. You can confirm this by looking for micbias in the rt5651 driver source code in the kernel tree. Armbian has a mechanism for shipping asound.state with the build. We should work out a canonical asound.state for the T4 and M4 boards and add it to Armbian build. However, I don't know if or how this interacts with pulseaudio. Maybe extra work is needed to get everything to play nice with pulse -- none the less, a working ALSA config would be a good start. I have yet to check this with an analog audio expert, but my reading of the T4 schematic is that the onboard Mic is connected to the codec in differential mode. However, by default the driver configures the codec in single-ended mode. The version of the driver in FriendlyElec's branch doesn't have the device tree binding to allow enabling differential mode for the Mic2 input (later versions of the driver for that codec do). TO TRY: add device tree binding to driver, add appropriate entry to device tree, see whether it improves onboard Mic audio quality. (should reduce noise/increase gain). NOTE: the DT binding docs for that codec which do have the binding for the differential mic input have an error in the docs. they misname the param and say something like diff-param=true; when it should just be differential-param; (not the real names). I'm still very new to Armbian and have no idea whether there are any common practices with regard to setting up audio on new boards. Guidance and feedback would be appreciated. 1
Madozu Posted March 5, 2019 Posted March 5, 2019 On 2/18/2019 at 12:29 PM, s_frit said: Here is a way to get the onboard audio working on NanoPC T4 (and probably M4 too). It kind-of works with pulseaudio, but I think more work is needed for a good solution for pulseaudio (need to develop a UCM profile). The attached asound.state file will configure the rt5651 codec mixer with sane settings. To use it: Download the attached asound.state.draft.201902018 Run the following command from a terminal (in whatever directory you downloaded the file): alsactl --file ./asound.state.draft.201902018 restore Great work @s_frit ... you made my day! I was playing around with alsamixer on a Nano-PC T4 on Armbian (5.76, Ubuntu Bionic, no GUI) with "limited success". After importing the above quoted state settings, Audio was fine on the 3.5mm audio jack. Now I am successfully using mpd to play music without problems :-D
Recommended Posts