[Alsa-user] (snd_ctl_open_noupdate) Invalid CTL hw:0
Hi, Alsa n00b here starting to bring up alsa on an embedded platform: openWRT for the Broadcom mips processor used in wireless routers, I have a Netgear WGT634U. http://www.openwrt.org 2.6.17 kernel, alsa-lib-1.0.13, alsa-utils-1.0.13, CMedia USB sound dongle. My error is: [EMAIL PROTECTED]:~# aplay -l List of PLAYBACK Hardware Devices ALSA lib control.c:910:(snd_ctl_open_noupdate) Invalid CTL hw:0 aplay: device_list:231: control open (0): No such file or directory My /dev and /proc trees look ok (I think!): [EMAIL PROTECTED]:~# ls /dev/snd controlC0 pcmC0D0c pcmC0D0p timer [EMAIL PROTECTED]:~# ls /proc/asound card0default hwdeposs timers cardsdevices modules pcm version [EMAIL PROTECTED]:~# cat /proc/asound/devices 0: [ 0] : control 16: [ 0- 0]: digital audio playback 24: [ 0- 0]: digital audio capture 33:: timer I have no .asoundrc or alsa.conf files, but from reading docs I don't think I should need them (is that true?). I also tried building alsa-lib with --with-debug=full, but I see no alsa output with dmesg. (Presumably a simple goof on my part but a pointer would be welcome.) From /proc/bus/usb/devices I have: T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=0d8c ProdID=000c Rev= 1.00 S: Product=C-Media USB Headphone Set C:* #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=100mA I: If#= 0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio I: If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio I: If#= 1 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio E: Ad=01(O) Atr=09(Isoc) MxPS= 200 Ivl=1ms I: If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio I: If#= 2 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio E: Ad=82(I) Atr=05(Isoc) MxPS= 100 Ivl=1ms I: If#= 3 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=(none) E: Ad=83(I) Atr=03(Int.) MxPS= 4 Ivl=32ms loaded modules: [EMAIL PROTECTED]:~# lsmod Module Size Used byTainted: P snd_pcm_oss 38240 0 - Live 0xc01c1000 snd_mixer_oss 14592 1 snd_pcm_oss, Live 0xc019a000 snd_usb_audio 54304 0 - Live 0xc018b000 snd_hwdep 5168 1 snd_usb_audio, Live 0xc0159000 snd_usb_lib 11456 1 snd_usb_audio, Live 0xc0119000 snd_rawmidi 16384 1 snd_usb_lib, Live 0xc0186000 snd_pcm 65248 2 snd_pcm_oss,snd_usb_audio, Live 0xc01a snd_timer 16304 1 snd_pcm, Live 0xc0181000 snd 35904 8 snd_pcm_oss,snd_mixer_oss,snd_usb_audio,snd_hwdep,snd_usb_lib,snd_ra wmidi,snd_pcm,snd_timer, Live 0xc014f000 snd_page_alloc 5168 1 snd_pcm, Live 0xc011d000 i2c_dev 5488 0 - Live 0xc00ec000 usb_storage 26704 0 - Live 0xc015d000 sd_mod 11952 0 - Live 0xc0124000 scsi_mod 68320 2 usb_storage,sd_mod, Live 0xc016f000 i2c_core 11856 1 i2c_dev, Live 0xc012 ehci_hcd 39856 0 - Live 0xc012a000 ohci_hcd 25328 0 - Live 0xc0089000 ath_pci 82896 0 - Live 0xc0139000 wlan_xauth 448 0 - Live 0xc0084000 wlan_wep 4608 0 - Live 0xc0086000 wlan_tkip 10784 0 - Live 0xc007a000 wlan_ccmp 6304 0 - Live 0xc006f000 wlan_acl 2784 0 - Live 0xc0078000 ath_rate_sample 10400 1 ath_pci, Live 0xc007e000 ath_hal 221952 2 ath_pci,ath_rate_sample, Live 0xc00ae000 wlan_scan_sta 9664 0 - Live 0xc0068000 wlan_scan_ap 3104 0 - Live 0xc0058000 wlan 167488 9 ath_pci,wlan_xauth,wlan_wep,wlan_tkip,wlan_ccmp,wlan_acl,ath_rate_ sample,wlan_scan_sta,wlan_scan_ap, Live 0xc00ef000 soundcore 4784 1 snd, Live 0xc006c000 ppp_async 9440 0 - Live 0xc0061000 ppp_generic 20416 1 ppp_async, Live 0xc0072000 slhc 5632 1 ppp_generic, Live 0xc0065000 crc_ccitt 992 1 ppp_async, Live 0xc005a000 usbcore 113536 6 snd_usb_audio,snd_usb_lib,usb_storage,ehci_hcd,ohci_hcd, Live 0 xc0091000 switch_robo 3984 0 - Live 0xc005f000 switch_core 5088 1 switch_robo, Live 0xc005c000 Let me know if there is more info I could share that would help. Thanks for any aid! Peace music Chuck - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] (snd_ctl_open_noupdate) Invalid CTL hw:0
Thanks, Lee, Trace below. It looks to me that /dev/snd/controlC0 was opened successfully but sound_ctl_nopdate disliked something about what it saw. Still puzzled, Chuck Lee Revell wrote: On Tue, 2006-11-14 at 14:53 -0800, Chuck Harrison wrote: Alsa n00b here starting to bring up alsa on an embedded platform: openWRT for the Broadcom mips processor used in wireless routers, I have a Netgear WGT634U. http://www.openwrt.org Probably a build error that causes aplay to look in the build host path rather than the target path. I recently had a similar problem bringing up ALSA on an embedded PPC system. Install strace on your target (it's very easy) and strace the failing aplay process to see which open() call fails. Lee [EMAIL PROTECTED]:~# strace -eopen aplay -l open(/lib/libasound.so.2, O_RDONLY) = -1 ENOENT (No such file or directory) open(/lib/libasound.so.2, O_RDONLY) = -1 ENOENT (No such file or directory) open(/usr/lib/libasound.so.2, O_RDONLY) = 3 open(/lib/libm.so.0, O_RDONLY)= 3 open(/lib/libdl.so.0, O_RDONLY) = 3 open(/lib/libpthread.so.0, O_RDONLY) = 3 open(/lib/libgcc_s.so.1, O_RDONLY)= 3 open(/lib/libc.so.0, O_RDONLY)= 3 open(/dev/snd/controlC0, O_RDONLY)= 3 List of PLAYBACK Hardware Devices ALSA lib control.c:910:(snd_ctl_open_noupdate) Invalid CTL hw:0 aplay: device_list:231: control open (0): No such file or directory open(/dev/snd/controlC1, O_RDONLY)= -1 ENOENT (No such file or directory) open(/dev/aloadC1, O_RDONLY) = -1 ENOENT (No such file or directory) open(/dev/snd/controlC2, O_RDONLY)= -1 ENOENT (No such file or directory) open(/dev/aloadC2, O_RDONLY) = -1 ENOENT (No such file or directory) [...] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] (snd_ctl_open_noupdate) Invalid CTL hw:0
Hi Clemens, Contrary to what you expect, /dev/snd/controlC0 *does* get opened before alsa.conf gets stat'ed or opened. I added a simple alsa.conf file [EMAIL PROTECTED]:~# cat /usr/share/alsa/alsa.conf pcm.card0 { type hw card 0 } ctl.card0 { type hw card 0 } and here is the strace: [EMAIL PROTECTED]:~# strace -estat,open,close,read aplay -l stat(/etc/ld.so.cache, 0x7fd52b28)= -1 ENOENT (No such file or directory) open(/lib/libasound.so.2, O_RDONLY) = -1 ENOENT (No such file or directory) open(/lib/libasound.so.2, O_RDONLY) = -1 ENOENT (No such file or directory) open(/usr/lib/libasound.so.2, O_RDONLY) = 4 read(4, [EMAIL PROTECTED]..., 4096) = 4096 close(4)= 0 open(/lib/libm.so.0, O_RDONLY)= 4 read(4, \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0P\f\0\000..., 4096) = 4096 close(4)= 0 open(/lib/libdl.so.0, O_RDONLY) = 4 read(4, \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0P\10\0..., 4096) = 4096 close(4)= 0 open(/lib/libpthread.so.0, O_RDONLY) = 4 read(4, \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\3004\0..., 4096) = 4096 close(4)= 0 open(/lib/libgcc_s.so.1, O_RDONLY)= 4 read(4, \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\\30..., 4096) = 4096 close(4)= 0 open(/lib/libc.so.0, O_RDONLY)= 4 read(4, \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\20\271..., 4096) = 4096 close(4)= 0 open(/dev/snd/controlC0, O_RDONLY)= 4 close(4)= 0 List of PLAYBACK Hardware Devices stat(/usr/share/alsa/alsa.conf, {st_mode=S_IFREG|0644, st_size=74, ...}) = 0 open(/usr/share/alsa/alsa.conf, O_RDONLY) = 4 read(4, pcm.card0 {\ntype hw\ncard..., 4096) = 74 read(4, , 4096) = 0 close(4)= 0 ALSA lib control.c:910:(snd_ctl_open_noupdate) Invalid CTL hw:0 aplay: device_list:231: control open (0): No such file or directory open(/dev/snd/controlC1, O_RDONLY)= -1 ENOENT (No such file or directory) open(/dev/aloadC1, O_RDONLY) = -1 ENOENT (No such file or directory) I have tried to find my way through the conf.c and related source code but it is pretty slow going for me. I wonder if anyone has written an overview of what it is doing. I.e. Initially we read the alsa.conf file and build a configuration tree. A configuration tree is made up of entries like XXX in a structure YYY. If there is no alsa.conf then a default configuration ZZZ is used. Or something like that. Cheers, Chuck Clemens Ladisch wrote: Chuck Harrison wrote: It looks to me that /dev/snd/controlC0 was opened successfully but sound_ctl_nopdate disliked something about what it saw. [EMAIL PROTECTED]:~# strace -eopen aplay -l ... open(/dev/snd/controlC0, O_RDONLY)= 3 List of PLAYBACK Hardware Devices ALSA lib control.c:910:(snd_ctl_open_noupdate) Invalid CTL hw:0 aplay: device_list:231: control open (0): No such file or directory It shouldn't open /dev/snd/controlC0 before reading alsa.conf. Does alsa.conf appear anywhere in the strace output? Regards, Clemens - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user
Re: [Alsa-user] (snd_ctl_open_noupdate) Invalid CTL hw:0
Thanks, Clemens! [EMAIL PROTECTED]:~# aplay -l List of PLAYBACK Hardware Devices card 0: default [C-Media USB Headphone Set ], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 [EMAIL PROTECTED]:~# aplay -D plughw:0,0 /usr/share/sounds/alsa/Noise.wav Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono I was being led astray by http://www.alsa-project.org/alsa-doc/doc-php/asoundrc.php , which begins in no uncertain terms: Neither of the .asoundrc or alsa.conf files are required for ALSA to work properly. Maybe someone should update that! ;-) My cross-build Makefile really should have installed /usr/share/alsa/alsa.conf for me but I'll fix that now. Clemens Ladisch wrote: [...] This is not a valid alsa.conf file. Use the one from alsa-lib, i.e., make sure that this one and the other config files are installed correctly. Is there something that needs to be in the other config files for a basic installation like mine? E.g. should the text I erroneously copied from the The default plugin section of http://www.alsa-project.org/alsa-doc/doc-php/asoundrc.php go into .asoundrc? aplay seems to be working for me, anyway. I didn't find a .asoundrc in my distribution: [EMAIL PROTECTED]:/home/trunk$ find build_mipsel/alsa-lib-1.0.13 -name '.asoundrc' -print [EMAIL PROTECTED]:/home/trunk$ Sorry to be such a dodo-head here, but I'm lost in the docs. Much obliged, Chuck - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Alsa-user mailing list Alsa-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-user