Description
Describe the bug
I'm on a RPi5 4GB running Raspberry Pi OS 64bit Bookworm and my application hangs on ALSA function snd_pcm_readn when I try to read and write from and to the same device. This occurs on an IQAudio Codec Zero sound card and on a HifiBerry DAC+ADC Pro as well. When I select a USB sound card as the output and one of the others described for input everything works like it should.
Here's my code:
#include <alsa/asoundlib.h>
#include <alsa/control.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <algorithm>
#include <iterator>
typedef signed short drwav_int16;
typedef signed int drwav_int32;
#define PCM_DEVICE_IN "plughw:Zero,0"
#define PCM_DEVICE_OUT "plughw:Zero,0"
int pcm, err, result, n;
unsigned int rate, tmp, i=0;
snd_pcm_t *play;
snd_pcm_t *record;
snd_pcm_hw_params_t *playparams;
snd_pcm_hw_params_t *recordparams;
snd_pcm_uframes_t frames;
snd_pcm_sframes_t recresult;
snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE;
static snd_output_t *info = NULL;
int block = 0;
int buffer_frames = 256;
int bits_per_frame = 16;
const int bits_per_byte = 8;
int channels = 2;
int bytesize_per_channel = buffer_frames
* bits_per_frame
/ bits_per_byte;
int main(int argc, char **argv) {
if (argc < 3) {
printf("Usage: %s <sample_rate> <frames>\n", argv[0]);
return -1;
}
rate = atoi(argv[1]);
buffer_frames = atoi(argv[2]);
bytesize_per_channel = buffer_frames
* snd_pcm_format_width(format)
/ bits_per_byte;
drwav_int16 *buffer_in[channels];
/* Open the PCM device in record mode */
if ((pcm = snd_pcm_open(&record, PCM_DEVICE_IN, SND_PCM_STREAM_CAPTURE, block)) < 0)
printf("ERROR: Can't open \"%s\" PCM device. %s\n", PCM_DEVICE_IN, snd_strerror(pcm));
/* Allocate parameters object and fill it with default values*/
if ((pcm = snd_pcm_hw_params_malloc(&recordparams)) < 0)
printf("ERROR: Can't allocate hardware parameter structure. %s\n", snd_strerror(pcm));
if ((pcm = snd_pcm_hw_params_any(record, recordparams)) < 0)
printf("ERROR: Can't initialize hardware parameter structure. %s\n", snd_strerror(pcm));
/* Set parameters */
if ((pcm = snd_pcm_hw_params_set_access(record, recordparams, SND_PCM_ACCESS_RW_NONINTERLEAVED )) < 0)
printf("ERROR: Can't set interleaved mode. %s\n", snd_strerror(pcm));
if ((pcm = snd_pcm_hw_params_set_format(record, recordparams, format)) < 0)
printf("ERROR: Can't set format. %s\n", snd_strerror(pcm));
if ((pcm = snd_pcm_hw_params_set_channels(record, recordparams, channels)) < 0)
printf("ERROR: Can't set channels number. %s\n", snd_strerror(pcm));
if ((pcm = snd_pcm_hw_params_set_rate_near(record, recordparams, &rate, 0)) < 0)
printf("ERROR: Can't set sample rate. %s\n", snd_strerror(pcm));
/* Write parameters */
if ((pcm = snd_pcm_hw_params(record, recordparams)) < 0)
printf("ERROR: Can't set hardware parameters. %s\n", snd_strerror(pcm));
if ((pcm = snd_pcm_prepare(record)) < 0)
printf("ERROR: Can't prepare audio interface for use. %s\n", snd_strerror(pcm));
/* Resume information */
printf("PCM name: '%s'\n", snd_pcm_name(record));
printf("PCM state: %s\n", snd_pcm_state_name(snd_pcm_state(record)));
snd_pcm_hw_params_get_channels(recordparams, &tmp);
printf("channels: %i ", tmp);
if (tmp == 1)
printf("(mono)\n");
else if (tmp == 2)
printf("(stereo)\n");
snd_pcm_hw_params_get_rate(recordparams, &tmp, 0);
printf("sample rate: %d bps\n", tmp);
/* Open the PCM device in playback mode */
if ((pcm = snd_pcm_open(&play, PCM_DEVICE_OUT, SND_PCM_STREAM_PLAYBACK, block)) < 0)
printf("ERROR: Can't open \"%s\" PCM device. %s\n", PCM_DEVICE_OUT, snd_strerror(pcm));
if ((pcm = snd_pcm_hw_params_malloc(&playparams)) < 0)
printf("ERROR: Can't allocate hardware parameter structure. %s\n", snd_strerror(pcm));
if ((pcm = snd_pcm_hw_params_any(play, playparams)) < 0)
printf("ERROR: Can't initialize hardware parameter structure. %s\n", snd_strerror(pcm));
/* Set parameters */
if ((pcm = snd_pcm_hw_params_set_access(play, playparams, SND_PCM_ACCESS_RW_NONINTERLEAVED )) < 0)
printf("ERROR: Can't set interleaved mode. %s\n", snd_strerror(pcm));
if ((pcm = snd_pcm_hw_params_set_format(play, playparams, format)) < 0)
printf("ERROR: Can't set format. %s\n", snd_strerror(pcm));
if ((pcm = snd_pcm_hw_params_set_channels(play, playparams, channels)) < 0)
printf("ERROR: Can't set channels number. %s\n", snd_strerror(pcm));
if ((pcm = snd_pcm_hw_params_set_rate_near(play, playparams, &rate, 0)) < 0)
printf("ERROR: Can't set sample rate. %s\n", snd_strerror(pcm));
/* Write parameters */
if ((pcm = snd_pcm_hw_params(play, playparams)) < 0)
printf("ERROR: Can't set hardware parameters. %s\n", snd_strerror(pcm));
if ((pcm = snd_pcm_prepare(play)) < 0)
printf("ERROR: Can't prepare audio interface for use. %s\n", snd_strerror(pcm));
/* Resume information */
printf("PCM name: '%s'\n", snd_pcm_name(play));
printf("PCM state: %s\n", snd_pcm_state_name(snd_pcm_state(play)));
snd_pcm_hw_params_get_channels(playparams, &tmp);
printf("channels: %i ", tmp);
if (tmp == 1)
printf("(mono)\n");
else if (tmp == 2)
printf("(stereo)\n");
snd_pcm_hw_params_get_rate(playparams, &tmp, 0);
printf("sample rate: %d bps\n", tmp);
// allocate buffers
buffer_in[0] = (drwav_int16*) malloc(bytesize_per_channel);
buffer_in[1] = (drwav_int16*) malloc(bytesize_per_channel);
printf("buffers allocated: %d bytes per channel\n", bytesize_per_channel);
// check accepted configuration
snd_output_stdio_attach(&info, stderr, 0);
err = snd_pcm_dump(play, info);
err = snd_pcm_dump(record, info);
// start recording device
if ((pcm = snd_pcm_start(record)) < 0)
printf("ERROR: Can't start soundcard for recording. %s\n", snd_strerror(pcm));
// fill buffer before starting playback device
if ((recresult = snd_pcm_readn(record, (void**) buffer_in, buffer_frames)) < 0) {
printf ("ERROR. Read from audio interface failed. (%s)\n", snd_strerror(recresult));
exit(1);
}
if ((result = snd_pcm_writen(play, (void**) buffer_in, recresult)) == -EPIPE) {
printf("XRUN.\n");
snd_pcm_prepare(play);
} else if (result < 0) {
printf("ERROR. Can't write to playback device. %s\n", snd_strerror(result));
exit(1);
}
// start playback device
if ((pcm = snd_pcm_start(play)) < 0)
printf("ERROR: Can't start soundcard for playback. %s\n", snd_strerror(pcm));
// run loop
while (1)
{
if ((recresult = snd_pcm_readn(record, (void**) buffer_in, buffer_frames)) < 0) {
printf ("ERROR. Read from audio interface failed. (%s)\n", snd_strerror(recresult));
exit(1);
}
n = (int) recresult;
printf("read %d done, %d frames\n", i, n);
if ((result = snd_pcm_writen(play, (void**) buffer_in, recresult)) == -EPIPE) {
printf("XRUN.\n");
snd_pcm_prepare(play);
} else if (result < 0) {
printf("ERROR. Can't write to playback device. %s\n", snd_strerror(result));
exit(1);
}
printf("write %d done\n", i);
i++;
}
snd_pcm_hw_params_free(playparams);
snd_pcm_hw_params_free(recordparams);
printf("params freed\n");
snd_pcm_drain(play);
snd_pcm_close(play);
snd_pcm_drain(record);
snd_pcm_close(record);
printf("audio interface closed\n");
free(buffer_in[0]);
free(buffer_in[1]);
printf("buffers freed\n");
return 0;
}
I have the same issue when I switch to PortAudio as an ALSA wrapper. Then my application hangs on Pa_ReadStream. And I'm using one of the basic PortAudio examples (paex_read_write_wire.c) as the basis of my application.
The issue also occurs when using alsaloop or aplay and arecord in 2 different shell sessions.
As soon as I start aplay, arecord exits with a 2221 input/output error and the HW pointer stops moving. This exact behavior is also seen when using a HifiBerry DAC+ADC Pro on the RPi5.
For. more information see the issue I opened in the alsa-lib repo and PortAudio repo.
And the raspberry pi forum.
Steps to reproduce the behaviour
Start arecord in one SSH session with:
arecord -f S16_LE -r48000 -c2 -D plughw:Zero,0 -F0 --period-size=256 -B0 --buffer-size=4096 test.wav
and aplay in another with:
aplay test.wav -f S16_LE -r48000 -c2 -D plughw:Zero,0
And a 3rd SSH session where you watch the status of the capture with:
watch cat /proc/asound/card0/pcm0c/sub0/status
Device (s)
Other
System
System Information
Raspberry Pi 5 Model B Rev 1.0
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
Raspberry Pi reference 2023-10-10
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 962bf483c8f326405794827cce8c0313fd5880a8, stage2
Linux pi 6.1.0-rpi4-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.54-1+rpt2 (2023-10-05) aarch64 GNU/Linux
Revision : c04170
Serial : f6c71b432ec3d5df
Model : Raspberry Pi 5 Model B Rev 1.0
Throttled flag : throttled=0x0
Camera : vc_gencmd_read_response returned -1 error=1 error_msg="Command not registered"
Videocore information
2023/10/30 16:45:10
Copyright (c) 2012 Broadcom
version 30de0ba5 (release) (embedded)
vc_gencmd_read_response returned -1
error=1 error_msg="Command not registered"
Filesystem information
Filesystem 1K-blocks Used Available Use% Mounted on
udev 1900240 0 1900240 0% /dev
tmpfs 414352 7040 407312 2% /run
/dev/mmcblk0p2 14732664 3131392 10966348 23% /
tmpfs 2071696 0 2071696 0% /dev/shm
tmpfs 5120 32 5088 1% /run/lock
/dev/mmcblk0p1 522232 63360 458872 13% /boot/firmware
tmpfs 414336 0 414336 0% /run/user/1000
Filename Type Size Used Priority
/var/swap file 102368 0 -2
Package version information
raspberrypi-ui-mods:
Installed: (none)
raspberrypi-sys-mods:
Installed: 20231003
openbox:
Installed: (none)
lxpanel:
Installed: (none)
pcmanfm:
Installed: (none)
rpd-plym-splash:
Installed: (none)
Networking Information
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet x.x.x.x netmask x.x.x.x broadcast x.x.x.x
inet6 y::y.y.y.y prefixlen 64 scopeid 0x20
ether m.m.m.m txqueuelen 1000 (Ethernet)
RX packets 74 bytes 10317 (10.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 126 bytes 22804 (22.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 107
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet x.x.x.x netmask x.x.x.x
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 16 bytes 2893 (2.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 16 bytes 2893 (2.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether m.m.m.m txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
USB Information
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
Display Information
Running (F)KMS, console
/sys/class/drm/card1-HDMI-A-1
/sys/class/drm/card1-HDMI-A-2
/sys/class/drm/card1-Writeback-1
/sys/class/drm/card1-Writeback-2
Connector 0 (32) HDMI-A-1 (connected)
Encoder 0 (31) TMDS
Connector 1 (42) HDMI-A-2 (disconnected)
Encoder 1 (41) TMDS
Connector 0 (32) HDMI-A-1 (connected)
HDMI0: HDMI_HOTPLUG = 0x00000001
HDMI1: HDMI_HOTPLUG = 0x00000000
/sys/kernel/debug/dri/1/state:
plane[47]: plane-0
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=0
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[64]: plane-1
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=0
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[78]: plane-2
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=0
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[89]: plane-3
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=0
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[100]: plane-4
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=1
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[110]: plane-5
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=2
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[120]: plane-6
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=3
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[130]: plane-7
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=4
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[140]: plane-8
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=5
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[150]: plane-9
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=6
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[160]: plane-10
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=7
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[170]: plane-11
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=8
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[180]: plane-12
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=9
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[190]: plane-13
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=a
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[200]: plane-14
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=b
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[210]: plane-15
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=c
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[220]: plane-16
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=d
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[230]: plane-17
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=e
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[240]: plane-18
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=f
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[250]: plane-19
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=10
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[260]: plane-20
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=11
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[270]: plane-21
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=11
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[280]: plane-22
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=11
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
plane[290]: plane-23
crtc=(null)
fb=0
crtc-pos=0x0+0+0
src-pos=0.000000x0.000000+0.000000+0.000000
rotation=1
normalized-zpos=11
color-encoding=ITU-R BT.709 YCbCr
color-range=YCbCr limited range
crtc[57]: mop
enable=0
active=0
self_refresh_active=0
planes_changed=0
mode_changed=0
active_changed=0
connectors_changed=0
color_mgmt_changed=0
plane_mask=0
connector_mask=0
encoder_mask=0
mode: "": 0 0 0 0 0 0 0 0 0 0 0x0 0x0
crtc[74]: moplet
enable=0
active=0
self_refresh_active=0
planes_changed=0
mode_changed=0
active_changed=0
connectors_changed=0
color_mgmt_changed=0
plane_mask=0
connector_mask=0
encoder_mask=0
mode: "": 0 0 0 0 0 0 0 0 0 0 0x0 0x0
crtc[88]: crtc-2
enable=0
active=0
self_refresh_active=0
planes_changed=0
mode_changed=0
active_changed=0
connectors_changed=0
color_mgmt_changed=0
plane_mask=0
connector_mask=0
encoder_mask=0
mode: "": 0 0 0 0 0 0 0 0 0 0 0x0 0x0
crtc[99]: crtc-3
enable=0
active=0
self_refresh_active=0
planes_changed=0
mode_changed=0
active_changed=0
connectors_changed=0
color_mgmt_changed=0
plane_mask=0
connector_mask=0
encoder_mask=0
mode: "": 0 0 0 0 0 0 0 0 0 0 0x0 0x0
connector[32]: HDMI-A-1
crtc=(null)
self_refresh_aware=0
max_requested_bpc=8
connector[42]: HDMI-A-2
crtc=(null)
self_refresh_aware=0
max_requested_bpc=8
connector[63]: Writeback-1
crtc=(null)
self_refresh_aware=0
max_requested_bpc=0
connector[77]: Writeback-2
crtc=(null)
self_refresh_aware=0
max_requested_bpc=0
config.txt
arm_64bit=1
arm_boost=1
arm_freq=2400
arm_freq_min=1000
arm_peri_high=1
audio_pwm_mode=2
auto_initramfs=1
avs_temp=38929
camera_auto_detect=1
core_freq=910
core_freq_min=500
disable_commandline_tags=2
disable_fw_kms_setup=1
disable_l2cache=1
disable_overscan=1
display_auto_detect=1
display_default_lcd=-1
display_hdmi_rotate=-1
display_lcd_rotate=-1
dvfs=4
enable_gic=1
enable_uart=-1
force_eeprom_read=1
force_pwm_open=1
framebuffer_depth=16
framebuffer_ignore_alpha=1
framebuffer_swap=1
gpu_freq_min=500
hdmi_enable_4kp60=1
hevc_freq=910
hevc_freq_min=500
ignore_lcd=-1
init_uart_clock=0x2dc6c00
isp_freq=910
isp_freq_min=500
mask_gpu_interrupt1=16418
max_framebuffers=2
over_voltage_avs=0x169b8
pause_burst_frames=1
pciex4_reset=1
program_serial_random=1
total_mem=4096
usb_max_current_enable=1
v3d_freq=960
v3d_freq_min=500
vpred=8526
hdmi_force_cec_address:0=65535
hdmi_force_cec_address:1=65535
device_tree=-
overlay_prefix=overlays/
hdmi_cvt:0=
hdmi_cvt:1=
hdmi_edid_filename:0=
hdmi_edid_filename:1=
hdmi_timings:0=
hdmi_timings:1=
cmdline.txt
coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 smsc95xx.macaddr=D8:3A:DD:AB:74:70 vc_mem.mem_base=0x3fc00000 vc_mem.mem_size=0x40000000 console=ttyAMA10,115200 console=tty1 root=PARTUUID=d6564e59-02 rootfstype=ext4 fsck.repair=yes rootwait
pin configuration
0: ip pu | hi // ID_SD/GPIO0 = input
1: ip pu | hi // ID_SC/GPIO1 = input
2: a3 pu | hi // PIN3/GPIO2 = SDA1
3: a3 pu | hi // PIN5/GPIO3 = SCL1
4: no pu | lo // PIN7/GPIO4 = none
5: no pu | lo // PIN29/GPIO5 = none
6: no pu | lo // PIN31/GPIO6 = none
7: no pu | lo // PIN26/GPIO7 = none
8: no pu | lo // PIN24/GPIO8 = none
9: no pd | lo // PIN21/GPIO9 = none
10: no pd | lo // PIN19/GPIO10 = none
11: no pd | lo // PIN23/GPIO11 = none
12: no pd | lo // PIN32/GPIO12 = none
13: no pd | lo // PIN33/GPIO13 = none
14: no pd | lo // PIN8/GPIO14 = none
15: no pd | lo // PIN10/GPIO15 = none
16: no pd | lo // PIN36/GPIO16 = none
17: no pd | lo // PIN11/GPIO17 = none
18: a4 pn | lo // PIN12/GPIO18 = I2S1_SCLK
19: a4 pn | lo // PIN35/GPIO19 = I2S1_WS
20: a4 pn | lo // PIN38/GPIO20 = I2S1_SDI0
21: a4 pn | lo // PIN40/GPIO21 = I2S1_SDO0
22: no pd | lo // PIN15/GPIO22 = none
23: ip pd | lo // PIN16/GPIO23 = input
24: ip pd | lo // PIN18/GPIO24 = input
25: no pd | lo // PIN22/GPIO25 = none
26: no pd | lo // PIN37/GPIO26 = none
27: ip pd | hi // PIN13/GPIO27 = input
28: no pd | lo // PCIE_RP1_WAKE/GPIO28 = none
29: no pu | hi // FAN_TACH/GPIO29 = none
30: no pu | lo // HOST_SDA/GPIO30 = none
31: no pu | lo // HOST_SCL/GPIO31 = none
32: op dh pd | hi // ETH_RST_N/GPIO32 = output
33: no pd | lo // GPIO33 = none
34: op dl pd | lo // CD0_IO0_MICCLK/GPIO34 = output
35: no pd | lo // CD0_IO0_MICDAT0/GPIO35 = none
36: no pd | lo // RP1_PCIE_CLKREQ_N/GPIO36 = none
37: no pd | lo // GPIO37 = none
38: ip pd | hi // CD0_SDA/GPIO38 = input
39: ip pd | hi // CD0_SCL/GPIO39 = input
40: ip pd | hi // CD1_SDA/GPIO40 = input
41: ip pd | hi // CD1_SCL/GPIO41 = input
42: a2 pd | hi // USB_VBUS_EN/GPIO42 = VBUS_EN1
43: a2 pu | hi // USB_OC_N/GPIO43 = VBUS_OC1
44: op dh pd | hi // RP1_STAT_LED/GPIO44 = output
45: a0 pd | hi // FAN_PWM/GPIO45 = PWM1_CHAN3
46: op dl pd | lo // CD1_IO0_MICCLK/GPIO46 = output
47: no pd | lo // 2712_WAKE/GPIO47 = none
48: no pd | lo // CD1_IO1_MICDAT1/GPIO48 = none
49: op dh pd | hi // EN_MAX_USB_CUR/GPIO49 = output
50: no pd | lo // GPIO50 = none
51: no pd | lo // GPIO51 = none
52: no pu | lo // GPIO52 = none
53: no pu | hi // GPIO53 = none
100: ip pd | lo // GPIO0 = input
101: op dh pu | hi // 2712_BOOT_CS_N/GPIO1 = output
102: a6 pn | hi // 2712_BOOT_MISO/GPIO2 = VC_SPI0_MISO
103: a5 pn | hi // 2712_BOOT_MOSI/GPIO3 = VC_SPI0_MOSI
104: a6 pn | lo // 2712_BOOT_SCLK/GPIO4 = VC_SPI0_SCLK
105: ip pd | lo // GPIO5 = input
106: ip pd | lo // GPIO6 = input
107: ip pd | lo // GPIO7 = input
108: ip pd | lo // GPIO8 = input
109: ip pd | lo // GPIO9 = input
110: ip pd | lo // GPIO10 = input
111: ip pd | lo // GPIO11 = input
112: ip pd | lo // GPIO12 = input
113: ip pd | lo // GPIO13 = input
114: a1 pd | lo // PCIE_SDA/GPIO14 = SPI_S_MOSI_OR_BSC_S_SDA
115: a1 pd | lo // PCIE_SCL/GPIO15 = SPI_S_SCK_OR_BSC_S_SCL
116: ip pd | lo // GPIO16 = input
117: ip pd | lo // GPIO17 = input
118: ip pd | lo // GPIO18 = input
119: ip pd | lo // GPIO19 = input
120: ip pu | hi // PWR_GPIO/GPIO20 = input
121: ip pd | lo // 2712_G21_FS/GPIO21 = input
122: ip pd | lo // GPIO22 = input
123: ip pd | lo // GPIO23 = input
124: a3 pn | lo // BT_RTS/GPIO24 = UART_RTS_0
125: a4 pu | lo // BT_CTS/GPIO25 = UART_CTS_0
126: a4 pn | hi // BT_TXD/GPIO26 = UART_TXD_0
127: a4 pu | hi // BT_RXD/GPIO27 = UART_RXD_0
128: op dh pd | hi // WL_ON/GPIO28 = output
129: op dh pd | hi // BT_ON/GPIO29 = output
130: a4 pn | lo // WIFI_SDIO_CLK/GPIO30 = SD2_CLK
131: a4 pu | hi // WIFI_SDIO_CMD/GPIO31 = SD2_CMD
132: a4 pd | hi // WIFI_SDIO_D0/GPIO32 = SD2_DAT0
133: a3 pu | hi // WIFI_SDIO_D1/GPIO33 = SD2_DAT1
134: a4 pn | hi // WIFI_SDIO_D2/GPIO34 = SD2_DAT2
135: a3 pn | hi // WIFI_SDIO_D3/GPIO35 = SD2_DAT3
200: ip pd | hi // RP1_SDA/AON_GPIO0 = input
201: ip pd | hi // RP1_SCL/AON_GPIO1 = input
202: op dh pd | hi // RP1_RUN/AON_GPIO2 = output
203: op dh pd | hi // SD_IOVDD_SEL/AON_GPIO3 = output
204: op dh pd | hi // SD_PWR_ON/AON_GPIO4 = output
205: a6 pu | lo // SD_CDET_N/AON_GPIO5 = SD_CARD_PRES_G
206: ip pd | hi // SD_FLG_N/AON_GPIO6 = input
207: ip pd | lo // AON_GPIO7 = input
208: ip pd | lo // 2712_WAKE/AON_GPIO8 = input
209: op dh pd | hi // 2712_STAT_LED/AON_GPIO9 = output
210: ip pd | lo // AON_GPIO10 = input
211: ip pd | lo // AON_GPIO11 = input
212: ip pd | lo // PMIC_INT/AON_GPIO12 = input
213: a3 pu | hi // UART_TX_FS/AON_GPIO13 = VC_TXD0
214: a3 pu | hi // UART_RX_FS/AON_GPIO14 = VC_RXD0
215: ip pd | lo // AON_GPIO15 = input
216: ip pu | hi // AON_GPIO16 = input
232: a1 -- | hi // HDMI0_SCL/AON_SGPIO0 = HDMI_TX0_BSC_SCL
233: a1 -- | hi // HDMI0_SDA/AON_SGPIO1 = HDMI_TX0_BSC_SDA
234: a1 -- | hi // HDMI1_SCL/AON_SGPIO2 = HDMI_TX1_BSC_SCL
235: a1 -- | hi // HDMI1_SDA/AON_SGPIO3 = HDMI_TX1_BSC_SDA
236: a2 -- | hi // PMIC_SCL/AON_SGPIO4 = BSC_M2_SCL
237: a2 -- | hi // PMIC_SDA/AON_SGPIO5 = BSC_M2_SDA
vcdbg log messages
004157.677: Initial voltage 800000 temp 38379
004355.116: avs_2712: AVS pred 8526 852600 temp 38929
004355.127: vpred 852 mV +0
004981.364: FB framebuffer_swap 1
005009.458: Select resolution HDMI0/2 hotplug 1 max_mode 2
005009.650: BSC_A no ACK
005009.840: BSC_A no ACK
005009.851: HDMI0: Unable to read EDID block 0
005009.864: Select resolution HDMI1/2 hotplug 0 max_mode 2
005606.490: dtb_file 'bcm2712-rpi-5-b.dtb'
007775.758: Starting OS 7775 ms
007778.396: 00000040: -> 00000480
007778.412: 00000030: -> 00100080
007778.428: 00000034: -> 00100080
007778.444: 00000038: -> 00100080
007778.459: 0000003c: -> 00100080
Logs
No response
Additional context
No response