Closed lbernstone closed 4 years ago
I do get some issues with the codec device in dmesg:
ubuntu@bpi-m2z:~$ dmesg | grep codec
[ 7.938570] cedrus 1c0e000.video-codec: Device registered as /dev/video0
[ 8.082250] sun4i-codec 1c22c00.codec: ASoC: codec-analog@1f015c0 not registered
[ 8.089901] sun4i-codec 1c22c00.codec: Failed to register our card
[ 8.121327] sun4i-codec 1c22c00.codec: ASoC: codec-analog@1f015c0 not registered
[ 8.128915] sun4i-codec 1c22c00.codec: Failed to register our card
[ 8.170637] sun4i-codec 1c22c00.codec: ASoC: codec-analog@1f015c0 not registered
[ 8.178185] sun4i-codec 1c22c00.codec: Failed to register our card
[ 8.195871] debugfs: Directory '1c22c00.codec' with parent 'H3 Audio Codec' already present!
[ 8.211924] sun4i-codec 1c22c00.codec: ASoC: Failed to create component debugfs directory: -17
[ 8.227700] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
Firstly you should not remove the link! And pulseaudio should be enabled, not a requirement but better so.
Steps to get Audio (HDMI output)
Restore the previous Image (before you remove the link and the file)
Enable all output (amixer)
Configure default sound output to HDMI /etc/asound.conf
special attention to "Play audio to HDMI" section here: https://github.com/avafinger/bananapi-zero-ubuntu-base-minimal/issues/27#issuecomment-538648533
Didn't see that issue, as my bluetooth is working :smile:. I'll reset and give it a shot.
sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
This is not HDMI, and it was finally mapped at the end, just ignore it.
Didn't see that issue, as my bluetooth is working smile. I'll reset and give it a shot.
Good, save this configuration for later reference! Maybe you found how it should be configured!
It seems like it is all working, just no sound output. I can see the device and alsamixer takes me directly to the allwinner,hdmi hw device. There's no errors about an interrupted stream or timeout. I did have to add the ubuntu user to the audio group along with the asound.conf, but then everything looks like you show in that thread. There are no options in the mixer for the hw:allwinner,hdmi device, so I can't "enable all output" there.
I just tested with bluetooth. I am able to pair a speaker, it automatically switches to that sink, plays the audio, but it stutters a lot.
Any ideas how to troubleshoot this? Do you get sound with the U19.10 image?
BT? I got it working without "stuttering". It did not survive a reboot, the same procedure on the next boot disconnect the BT every time i try.
Hdmi-sound works on Ubuntu 19.10. To enable hdmi sound you need to configure asound.conf
pcm.!default {
type plug
slave {
pcm "hw:1,0"
}
}
ctl.!default {
type hw
card 1
}
Test with:
sudo aplay -D sysdefault:CARD=1 /usr/share/sounds/alsa/Front_Left.wav
No sound. No errors. I don't think this tv has anything weird going on with it. Other devices work out of the box. The old jesse/armbian image gives me sound (but the dtb is compiled into the kernel, so I can't compare).
sudo aplay -vvvD sysdefault:CARD=1 /usr/share/sounds/alsa/Front_Left.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Left.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
Plug PCM: Route conversion PCM (sformat=S16_LE)
Transformation table:
0 <- 0
1 <- 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 1
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 24000
period_size : 6000
period_time : 125000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 6000
period_event : 0
start_threshold : 24000
stop_threshold : 24000
silence_threshold: 0
silence_size : 0
boundary : 1572864000
Slave: Hardware PCM card 1 'allwinner,hdmi' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 24000
period_size : 6000
period_time : 125000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 6000
period_event : 0
start_threshold : 24000
stop_threshold : 24000
silence_threshold: 0
silence_size : 0
boundary : 1572864000
appl_ptr : 0
hw_ptr : 0
Max peak (6000 samples): 0x000034c8 ######### 41%
Max peak (6000 samples): 0x00002e57 ######## 36%
Max peak (6000 samples): 0x00001f88 ##### 24%
Max peak (6000 samples): 0x000013ef #### 15%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00003ec3 ########## 49%
Max peak (6000 samples): 0x00003964 ######### 44%
Max peak (6000 samples): 0x00000334 # 2%
Max peak (6000 samples): 0x00000381 # 2%
Max peak (6000 samples): 0x00000144 # 0%
Max peak (6000 samples): 0x0000004b # 0%
Do you have a spare sd card and a linux box?
I can make an Image 8GB with my setup... No linux Box needed.
Sure. I have lots of stuff kicking around :) I should have a couple extra devices coming in the mail this afternoon as well.
I will update kernel and prepare an 8GB Image and you give it a try, it takes some time to prepare one here...
Ubuntu 19.10
https://github.com/avafinger/bananapi-zero-ubuntu-base-minimal/releases/tag/v2.8
re-uploading the 7z img file..
You can play mp3 like this:
play ff-16b-2c-44100hz.mp3
ff-16b-2c-44100hz.mp3:
File Size: 2.99M Bit Rate: 128k
Encoding: MPEG audio Info: 2016-04-12
Channels: 2 @ 16-bit
Samplerate: 44100Hz
Replaygain: off
Duration: 00:03:07.12
In:2.63% 00:00:04.92 [00:03:02.19] Out:217k [ -==|== ] Clip:0
Still no sound.
I am now seeing this in the dmesg log. Not sure if it is involved with the hdmi sound, but it an i2s error seems like it could be related:
[ 495.777327] sun4i-i2s 1c22800.i2s: Unsupported MCLK divider: -22
[ 495.783367] sun4i-i2s 1c22800.i2s: ASoC: can't set 1c22800.i2s hw params: -22
[ 515.687000] sun4i-i2s 1c22800.i2s: Unsupported MCLK divider: -22
[ 515.693058] sun4i-i2s 1c22800.i2s: ASoC: can't set 1c22800.i2s hw params: -22
I don't get any errors while playing music.
Here is the tip, use the Armbian Kernel that you say hdmi-sound works:
Good luck.
As you know, I am trying to get RetroPie working on this device. I am unable to get alsa sound on the HDMI output working with the Ubuntu 19.10 image. No errors, but no sound. I have disabled pulseaudio by unlinking the service and removing /etc/alsa/conf.d. I have tried using both hw devices in speaker-test, but no sounds. My alsa layout looks like this: