Raspberry pi 如何在respberry pi上使用x86 chroot中的alsa
我设法在chroot中使用qemu i386 static和binfmt在我的raspberry pi 3b stretch上设置了x86 debian stretch,现在我想在chroot(不需要脉冲音频)环境中使用alsa,但是不断得到支持Raspberry pi 如何在respberry pi上使用x86 chroot中的alsa,raspberry-pi,qemu,alsa,chroot,i386,Raspberry Pi,Qemu,Alsa,Chroot,I386,我设法在chroot中使用qemu i386 static和binfmt在我的raspberry pi 3b stretch上设置了x86 debian stretch,现在我想在chroot(不需要脉冲音频)环境中使用alsa,但是不断得到支持 $ aplay -l Unsupported ioctl: cmd=0x81785501 aplay: device_list:270: no soundcards found... 声卡似乎在chroot中可见 $cat /proc/asound/
$ aplay -l
Unsupported ioctl: cmd=0x81785501
aplay: device_list:270: no soundcards found...
声卡似乎在chroot中可见
$cat /proc/asound/cards
0 [ALSA ]: bcm2835 - bcm2835 ALSA
bcm2835 ALSA
声卡在常规pi环境中正常工作,并按预期返回列表
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
chroot中的用户与普通用户同名,是所有组的一部分,并且在环境之间装载以下文件夹:
sys
proc
/dev
/dev/pts
/dev/shm
/home/user
下面是chroot中aplay-l的策略,并不是说我已经修剪了一些cacheflush和rt_sigprocmask
1739 execve("/usr/bin/aplay", ["aplay", "-l"], [/* 11 vars */] <unfinished ...>
1739 uname({sysname="Linux", nodename="raspberrypi", ...}) = 0
1739 brk(NULL) = 0x63207000
1739 brk(0x63207d58) = 0x63207d58
1739 set_tls(0x632074c0, 0x602b162c, 0, 0x602c4f8c, 0x4) = 0
1739 set_tid_address(0x63207068) = 1739
1739 set_robust_list(0x63207070, 12) = 0
1739 ugetrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
1739 readlink("/proc/self/exe", "/usr/bin/qemu-i386-static", 4096) = 25
1739 brk(0x63228d58) = 0x63228d58
1739 brk(0x63229000) = 0x63229000
1739 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
1739 clone(child_stack=0xb6fdbde8, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb6fdc318, tls=0xb6fdc770, child_tidptr=0xb6fdc318) = 1741
1741 set_robust_list(0xb6fdc320, 12 <unfinished ...>
1741 <... set_robust_list resumed> ) = 0
1741 nanosleep({tv_sec=0, tv_nsec=10000000}, <unfinished ...>
1739 gettimeofday({tv_sec=1582165215, tv_usec=910982}, NULL) = 0
1739 prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
1739 gettimeofday({tv_sec=1582165215, tv_usec=911591}, NULL) = 0
1739 open("/etc/qemu-binfmt/i386", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
1739 uname({sysname="Linux", nodename="raspberrypi", ...}) = 0
1739 madvise(0x602dd740, 16771264, MADV_HUGEPAGE) = -1 EINVAL (Invalid argument)
1739 open("/proc/sys/vm/mmap_min_addr", O_RDONLY|O_LARGEFILE) = 4
1739 fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
1739 read(4, "4096\n", 1024) = 5
1739 close(4) = 0
1739 gettid() = 1739
1739 fstat64(3, {st_mode=S_IFREG|0755, st_size=62916, ...}) = 0
1739 geteuid32() = 1000
1739 getegid32() = 1000
1739 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0!\222\0\0004\0\0\0"..., 1024) = 1024
1739 close(3) = 0
1739 brk(0x6324b000) = 0x6324b000
1739 open("/lib/ld-linux.so.2", O_RDONLY|O_LARGEFILE) = 3
1739 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \n\0\0004\0\0\0"..., 1024) = 1024
1739 close(3) = 0
1739 getuid32() = 1000
1739 geteuid32() = 1000
1739 getgid32() = 1000
1739 getegid32() = 1000
1741 <... nanosleep resumed> 0xb6fdbc7c) = 0
1741 futex(0x612e3648, FUTEX_WAIT, 4294967295, NULL <unfinished ...>
1739 uname({sysname="Linux", nodename="raspberrypi", ...}) = 0
1739 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
1739 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
1739 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
1739 fstat64(3, {st_mode=S_IFREG|0644, st_size=24702, ...}) = 0
1739 close(3) = 0
1739 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
1739 openat(AT_FDCWD, "/lib/i386-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
1739 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\30\0\0004\0\0\0"..., 512) = 512
1739 fstat64(3, {st_mode=S_IFREG|0644, st_size=30692, ...}) = 0
1739 close(3) = 0
1739 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
1739 openat(AT_FDCWD, "/usr/lib/i386-linux-gnu/libasound.so.2", O_RDONLY|O_CLOEXEC) = 3
1739 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260\341\1\0004\0\0\0"..., 512) = 512
1739 fstat64(3, {st_mode=S_IFREG|0644, st_size=1189404, ...}) = 0
1739 close(3) = 0
1739 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
1739 openat(AT_FDCWD, "/lib/i386-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
1739 read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340F\0\0004\0\0\0"..., 512) = 512
1739 fstat64(3, {st_mode=S_IFREG|0644, st_size=341556, ...}) = 0
1739 close(3) = 0
1739 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
1739 openat(AT_FDCWD, "/lib/i386-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
1739 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\n\0\0004\0\0\0"..., 512) = 512
1739 fstat64(3, {st_mode=S_IFREG|0644, st_size=13860, ...}) = 0
1739 close(3) = 0
1739 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
1739 openat(AT_FDCWD, "/lib/i386-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
1739 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340O\0\0004\0\0\0"..., 512) = 512
1739 fstat64(3, {st_mode=S_IFREG|0755, st_size=132328, ...}) = 0
1739 close(3) = 0
1739 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
1739 openat(AT_FDCWD, "/lib/i386-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
1739 read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\204\1\0004\0\0\0"..., 512) = 512
1739 fstat64(3, {st_mode=S_IFREG|0755, st_size=1791908, ...}) = 0
1739 close(3) = 0
1739 munmap(0x40839000, 28672) = 0
1739 set_tid_address(0x40b9e768) = 1739
1739 prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
1739 uname({sysname="Linux", nodename="raspberrypi", ...}) = 0
1739 munmap(0xb5f8d000, 135168) = 0
1739 ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
1739 openat(AT_FDCWD, "/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 3
1739 fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
1739 write(2, "Unsupported ioctl: cmd=0x8178550"..., 34) = 34
1739 close(3) = 0
1739 openat(AT_FDCWD, "/dev/aloadC0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
1739 openat(AT_FDCWD, "/dev/snd/controlC1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
1739 openat(AT_FDCWD, "/dev/aloadC1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
1739 write(2, "aplay: device_list:270: ", 24) = 24
1739 write(2, "no soundcards found...", 22) = 22
1739 write(2, "\n", 1) = 1
1739 futex(0x4096e0ac, FUTEX_WAKE_PRIVATE, 2147483647) = 0
1739 exit_group(0) = ?
1739 execve(“/usr/bin/aplay”、[“aplay”、“-l”]、[/*11 vars*/]
1739 uname({sysname=“Linux”,nodename=“raspberrypi”,…})=0
1739 brk(空)=0x63207000
1739 brk(0x63207d58)=0x63207d58
1739设定值(0x632074c0,0x602b162c,0,0x602c4f8c,0x4)=0
1739设置tid地址(0x63207068)=1739
1739设置列表(0x63207070,12)=0
1739 ugetrlimit(rlim_堆栈,{rlim_cur=8192*1024,rlim_max=rlim_无穷大})=0
1739 readlink(“/proc/self/exe”,“/usr/bin/qemu-i386-static”,4096)=25
1739 brk(0x63228d58)=0x63228d58
1739 brk(0x63229000)=0x63229000
1739访问(“/etc/ld.so.nohwcap”,F_OK)=-1 enoint(没有这样的文件或目录)
1739克隆(子堆栈=0xb6fdbde8,标志=clone_VM |克隆FS |克隆文件|克隆SIGHAND |克隆线程|克隆SYSVSEM |克隆结算|克隆父项|克隆子项| CLEARTID |父项| tidptr=0xb6fdc318,tls=0x6FDC770,子项| TIDR=0xb6fdc318)=1741
1741设置健壮列表(0xb6fdc320,12
1741 ) = 0
1741纳米睡眠({tv_sec=0,tv_nsec=10000000},
1739 gettimeofday({tv_sec=1582165215,tv_usec=910982},NULL)=0
1739 prlimit64(0,RLIMIT_堆栈,NULL,{rlim_cur=8192*1024,rlim_max=RLIM64_无穷大})=0
1739 gettimeofday({tv_sec=1582165215,tv_usec=911591},NULL)=0
1739 open(“/etc/qemu binfmt/i386”,O|RDONLY | O|u NONBLOCK | O|u LARGEFILE | O|u DIRECTORY | O|u CLOEXEC)=-1 enoint(无此类文件或目录)
1739 uname({sysname=“Linux”,nodename=“raspberrypi”,…})=0
1739 madvise(0x602dd74016771264,MADV_HUGEPAGE)=-1 EINVAL(无效参数)
1739打开(“/proc/sys/vm/mmap_min_addr”,O_RDONLY | O_LARGEFILE)=4
1739 fstat64(4,{st_mode=S|u IFREG | 0644,st_size=0,…})=0
1739读(4,“4096\n”,1024)=5
1739关闭(4)=0
1739 getId()=1739
1739 fstat64(3,{st_mode=S|u IFREG | 0755,st_size=62916,…})=0
1739 geteuid32()=1000
1739 getegid32()=1000
1739读(3,“\177ELF\1\1\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\0!\222\0\0004\0\0\0”…,1024)=1024
1739关闭(3)=0
1739 brk(0x6324b000)=0x6324b000
1739 open(“/lib/ld linux.so.2”,O|RDONLY | O|u LARGEFILE)=3
1739读(3,“\177ELF\1\1\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\0\n\0\0004\0\0\0\0”…,1024)=1024
1739关闭(3)=0
1739 getuid32()=1000
1739 geteuid32()=1000
1739 getgid32()=1000
1739 getegid32()=1000
1741 0xb6fdbc7c)=0
1741 futex(0x612e3648,futex_WAIT,4294967295,空
1739 uname({sysname=“Linux”,nodename=“raspberrypi”,…})=0
1739访问(“/etc/ld.so.nohwcap”,F_OK)=-1 enoint(没有这样的文件或目录)
1739访问(“/etc/ld.so.preload”,R_OK)=-1 enoint(没有这样的文件或目录)
1739 openat(AT_FDCWD,“/etc/ld.so.cache”,O_RDONLY | O_CLOEXEC)=3
1739 fstat64(3,{st_mode=S|u IFREG | 0644,st_size=24702,…})=0
1739关闭(3)=0
1739访问(“/etc/ld.so.nohwcap”,F_OK)=-1 enoint(没有这样的文件或目录)
1739 openat(AT_FDCWD,“/lib/i386 linux gnu/librt.so.1”,O_RDONLY | O_CLOEXEC)=3
1739读(3,“\177ELF\1\1\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\0@\30\0\0004\0\0\0\0”…,512)=512
1739 fstat64(3,{st_mode=S|u IFREG | 0644,st_size=30692,…})=0
1739关闭(3)=0
1739访问(“/etc/ld.so.nohwcap”,F_OK)=-1 enoint(没有这样的文件或目录)
1739 openat(AT_FDCWD,“/usr/lib/i386 linux gnu/libasound.so.2”,O_RDONLY | O_CLOEXEC)=3
1739读(3,“\177ELF\1\1\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\0\0\260\341\1\0004\0\0\0”…,512)=512
1739 fstat64(3,{st_mode=S|u IFREG | 0644,st_size=1189404,…})=0
1739关闭(3)=0
1739访问(“/etc/ld.so.nohwcap”,F_OK)=-1 enoint(没有这样的文件或目录)
1739 openat(AT_FDCWD,“/lib/i386 linux gnu/libm.so.6”,O_RDONLY | O_CLOEXEC)=3
1739读(3,“\177ELF\1\1\3\0\0\0\0\0\0\0\3\0\3\0\0\1\0\0\0\340F\0\0004\0\0\0\0”…,512)=512
1739 fstat64(3,{st_mode=S|u IFREG | 0644,st_size=341556,…})=0
1739关闭(3)=0
1739访问(“/etc/ld.so.nohwcap”,F_OK)=-1 enoint(没有这样的文件或目录)
1739 openat(AT_FDCWD,“/lib/i386 linux gnu/libdl.so.2”,O_RDONLY | O_CLOEXEC)=3
1739读(3,“\177ELF\1\1\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\0000\n\0\0004\0\0\0\0”…,512)=512
1739 fstat64(3,{st_mode=S|u IFREG | 0644,st_size=13860,…})=0
1739关闭(3)=0
1739访问(“/etc/ld.so.nohwcap”,F_OK)=-1 enoint(没有这样的文件或目录)
1739 openat(AT_FDCWD,“/lib/i386 linux gnu/libpthread.so.0”,O_RDONLY | O_CLOEXEC)=3
1739读(3,“\177ELF\1\1\0\0\0\0\0\0\0\0\3\0\0\0\1\0\0\0\0\0\340O\0\0004\0\0\0\0”…,512)=512
1739 fstat64(3,{st_mode=S|u IFREG | 0755,st_size=132328,…})=0
1739关闭(3)=0
1739访问(“/etc/ld.so.nohwcap”,F_OK)=-1 enoint(没有这样的文件或目录)
1739 openat(AT_FDCWD,“/lib/i386 linux gnu/libc.so.6”,O_RDONLY | O_CLOEXEC)=3
1739读(3,“\177ELF\1\1\1\3\0\0\0\0\0\0\3\0\3\0\0\1\0\0\0\0\0\204\1\0004\0\0\0\0”…,512)=512
1739 fstat64(3,{st_mode=S|u IFREG | 0755,st_size=1791908,…})=0
1739关闭(3)=0
1739地图(0x408390028672)