PocketBeagle Grove Kit Keyboard_Player.py missing .wav files

I’m playing with the PocketBeagle Grove Kit and so far all the demos in /var/lib/cloud9/PocketBeagle/Grove have worked until Keyboard_Player.py. It references several .wav files
(_SCALE_DEFS = [
‘do.wav’,
‘re.wav’,
‘me.wav’,
‘fa.wav’,
‘so.wav’,
‘la.wav’,
‘ti.wav’,
‘do+.wav’
])
but I can’t find them anywhere. Does anyone have a suggestion of where to look?

–Mark

I’ve created a script to generate the missing .wav files. It’s now having trouble with ALSA. Could there be a missing configuration file?

ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5036:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5036:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib pcm_dsnoop.c:575:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:575:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:575:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
<pyaudio.PyAudio object at 0xb6781c90>
start stream
stop stream

–Mark

A light just came on! ToneGenerator.py generates the .wav file for Keyboard_Player.py.

I still get eh ALSA errors, but now I know where the .wav files come from.

–Mark

I’m still having trouble with this. I’m runing
bone$ cat /ID.txt
BeagleBoard.org Debian Buster IoT Grove Kit Image 2020-04-06

When I run any of the examples that use the speaker I get:
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5036:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘defaults.bluealsa.device’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5036:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib pcm_dsnoop.c:575:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:575:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:575:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card

Looks like some sort of configuration problem. Do anyone know how to fix this?

–Mark

Can you give the full output of /opt/scripts/tools/version.sh?

Are there any messages in the kernel log (dmesg) about the sound card not coming up?

Any updates to uEnv.txt?

Here’s the version.sh output:

git:/opt/scripts/:[80d937707b4c91677fbacc2be59d6000c7bad008]
eeprom:[A335PBGL00A21750EPB04985]
model:[TI_AM335x_PocketBeagle]
dogtag:[BeagleBoard.org Debian Buster IoT Grove Kit Image 2021-04-27]
bootloader:[microSD]:[/dev/mmcblk0]:[U-Boot SPL 2019.04-g10968f0 (Feb 19 2021 - 21:40:51 +0000)]:[location: dd MBR]
bootloader:[microSD]:[/dev/mmcblk0]:[U-Boot 2019.04-g10968f0]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-pocketbeagle.dts]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-GPIO-GROVE-BUTTON-00A0]
UBOOT: Loaded Overlay:[BB-GPIO-GROVE-HCSR04-00A0]
UBOOT: Loaded Overlay:[BB-GPIO-P9813-00A0]
UBOOT: Loaded Overlay:[BB-I2C1-JHD1802-00A0]
UBOOT: Loaded Overlay:[BB-I2C2-ADXL34X-00A0]
UBOOT: Loaded Overlay:[BB-I2C2-MPR121-00A0]
UBOOT: Loaded Overlay:[PB-I2C1-TLV320AIC3104]
kernel:[4.19.94-ti-r62]
nodejs:[v10.24.0]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[enable_uboot_cape_universal=1]
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/PB-I2C1-TLV320AIC3104.dtbo]
uboot_overlay_options:[uboot_overlay_addr1=/lib/firmware/BB-GPIO-P9813.dtbo]
uboot_overlay_options:[uboot_overlay_addr2=/lib/firmware/BB-GPIO-HCSR04.dtbo]
uboot_overlay_options:[uboot_overlay_addr3=/lib/firmware/BB-GPIO-GROVE-BUTTON.dtbo]
uboot_overlay_options:[uboot_overlay_addr4=/lib/firmware/BB-I2C1-JHD1802.dtbo]
uboot_overlay_options:[uboot_overlay_addr5=/lib/firmware/BB-I2C2-ADXL34X.dtbo]
uboot_overlay_options:[uboot_overlay_addr6=/lib/firmware/BB-I2C2-MPR121.dtbo]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210416.0-0~buster+20210416]
pkg:[bb-customizations]:[1.20210225.0-0~buster+20210225]
pkg:[bb-usb-gadgets]:[1.20200504.0-0~buster+20200504]
pkg:[bb-wl18xx-firmware]:[1.20200813.1-0~buster+20200813]
pkg:[kmod]:[26-1]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal input bluetooth netdev i2c gpio admin spi iio docker tisdk weston-launch xenomai cloud9ide pwm eqep remoteproc]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[   63.580827] remoteproc remoteproc0: wkup_m3 is available
[   63.775786] remoteproc remoteproc0: powering up wkup_m3
[   63.775814] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[   63.776066] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
dmesg | grep pinctrl-single
[    0.965021] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
lsusb
Bus 002 Device 002: ID 2717:4106
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Here’s dmesg when KeyBoard_Player.py starts:

[May13 15:36] unregistered accelerometer
[  +0.193065] No platform data: Using default initialization
[  +0.006456] sysfs: cannot create duplicate filename '/devices/platform/ocp/4819c000.i2c/i2c-2/2-005b/mpr121_data'
[  +0.000024] CPU: 0 PID: 2169 Comm: modprobe Tainted: G           O      4.19.94-ti-r62 #1buster
[  +0.000007] Hardware name: Generic AM33XX (Flattened Device Tree)
[  +0.000052] [<c0113e18>] (unwind_backtrace) from [<c010e388>] (show_stack+0x20/0x24)
[  +0.000020] [<c010e388>] (show_stack) from [<c0d2863c>] (dump_stack+0x8c/0xa0)
[  +0.000026] [<c0d2863c>] (dump_stack) from [<c03ac61c>] (sysfs_warn_dup+0x6c/0x78)
[  +0.000015] [<c03ac61c>] (sysfs_warn_dup) from [<c03ac19c>] (sysfs_add_file_mode_ns+0xf8/0x1ac)
[  +0.000014] [<c03ac19c>] (sysfs_add_file_mode_ns) from [<c03acf00>] (internal_create_group+0x168/0x3e8)
[  +0.000013] [<c03acf00>] (internal_create_group) from [<c03ad1a0>] (sysfs_create_group+0x20/0x24)
[  +0.000033] [<c03ad1a0>] (sysfs_create_group) from [<bf3cf2b8>] (mpr121_probe+0x74/0xcc [mpr121])
[  +0.000046] [<bf3cf2b8>] (mpr121_probe [mpr121]) from [<bf3cf37c>] (mpr121_i2c_probe+0x6c/0x98 [mpr121])
[  +0.000023] [<bf3cf37c>] (mpr121_i2c_probe [mpr121]) from [<c0a7b344>] (i2c_device_probe+0x28c/0x2b4)
[  +0.000026] [<c0a7b344>] (i2c_device_probe) from [<c08dd638>] (really_probe+0x24c/0x3d8)
[  +0.000015] [<c08dd638>] (really_probe) from [<c08ddacc>] (driver_probe_device+0x174/0x1d0)
[  +0.000015] [<c08ddacc>] (driver_probe_device) from [<c08ddc40>] (__driver_attach+0x118/0x140)
[  +0.000012] [<c08ddc40>] (__driver_attach) from [<c08db054>] (bus_for_each_dev+0x84/0xc4)
[  +0.000013] [<c08db054>] (bus_for_each_dev) from [<c08dce44>] (driver_attach+0x2c/0x30)
[  +0.000012] [<c08dce44>] (driver_attach) from [<c08dc6f4>] (bus_add_driver+0x170/0x260)
[  +0.000013] [<c08dc6f4>] (bus_add_driver) from [<c08dea54>] (driver_register+0x84/0x118)
[  +0.000011] [<c08dea54>] (driver_register) from [<c0a7b82c>] (i2c_register_driver+0x4c/0xa8)
[  +0.000017] [<c0a7b82c>] (i2c_register_driver) from [<bf3d4028>] (mpr121_driver_init+0x28/0x1000 [mpr121])
[  +0.000025] [<bf3d4028>] (mpr121_driver_init [mpr121]) from [<c01031ac>] (do_one_initcall+0x50/0x294)
[  +0.000022] [<c01031ac>] (do_one_initcall) from [<c01ea548>] (do_init_module+0x74/0x254)
[  +0.000014] [<c01ea548>] (do_init_module) from [<c01ecdd0>] (load_module+0x25dc/0x290c)
[  +0.000013] [<c01ecdd0>] (load_module) from [<c01ed398>] (sys_finit_module+0xc0/0x110)
[  +0.000012] [<c01ed398>] (sys_finit_module) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[  +0.000008] Exception stack(0xdb2b3fa8 to 0xdb2b3ff0)
[  +0.000012] 3fa0:                   0046010c 017a7670 00000003 0045e7e0 00000000 00460318
[  +0.000011] 3fc0: 0046010c 017a7670 d4387600 0000017b 017a8d88 00000000 00000000 017a85d8
[  +0.000009] 3fe0: bee5c378 bee5c368 00456e41 b6d5ad92
[  +0.000382] create sysfs failed
[  +0.018196] mpr121: probe of 2-005b failed with error -17
[  +0.354462] No platform data: Using default initialization
[  +0.005857] mpr121 Registered

dmesg -Hw when a key is pressed:

[ +17.370610] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.100246] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.073359] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.017832] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.014288] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.019881] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.019828] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.014865] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.016040] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.025126] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +3.312129] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.017788] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.014023] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.017268] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.014739] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.020001] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.020094] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.014843] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.015907] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM
[  +0.024913] davinci-mcasp 48038000.mcasp: Sample-rate is off by 400 PPM

/boot/uEnv.txt. I didn’t make changes, but it looks like some are there.

#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.19.94-ti-r62
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=<file0>.dtbo
#uboot_overlay_addr1=<file1>.dtbo
#uboot_overlay_addr2=<file2>.dtbo
#uboot_overlay_addr3=<file3>.dtbo
###
###Additional custom capes
#uboot_overlay_addr4=<file4>.dtbo
#uboot_overlay_addr5=<file5>.dtbo
#uboot_overlay_addr6=<file6>.dtbo
#uboot_overlay_addr7=<file7>.dtbo
###
###Custom Cape
#dtb_overlay=<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
#uboot_overlay_pru=AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
#uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo
###
###Cape Universal Enable
enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet video=HDMI-A-1:1024x768@60e

#Use an overlayfs on top of a read-only root filesystem:
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet overlayroot=tmpfs

#Seeed Music Kit Defaults...
uboot_overlay_addr0=/lib/firmware/PB-I2C1-TLV320AIC3104.dtbo
uboot_overlay_addr1=/lib/firmware/BB-GPIO-P9813.dtbo
uboot_overlay_addr2=/lib/firmware/BB-GPIO-HCSR04.dtbo
uboot_overlay_addr3=/lib/firmware/BB-GPIO-GROVE-BUTTON.dtbo
uboot_overlay_addr4=/lib/firmware/BB-I2C1-JHD1802.dtbo
uboot_overlay_addr5=/lib/firmware/BB-I2C2-ADXL34X.dtbo
uboot_overlay_addr6=/lib/firmware/BB-I2C2-MPR121.dtbo

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

Well… It works! I think the problem was I wasn’t holding by finger on the touch panel long enough. You need to leave it there a good 1/2 second before it plays anything.

I found
aplay file.wav
also works.

I’m still getting the error messages:

ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm_dsnoop.c:575:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:575:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:575:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream

I also found ToneGenerator.py was generating the .wav file incorrectly. It was saving float16’s to the files when they should have been int16’s.

Did you apply fixes? I saw another fix you applied, but not for this.

I think the ideal case would be to turn ToneGenerator.py into a module for referencing/playing these wave files and have it generate the files automatically if the files don’t already exist. The general pattern for turning an example into a module is done for several of the module examples, like Accelerometer: cloud9-examples/Accelerometer.py at v2020.08 · jadonk/cloud9-examples · GitHub

Yes, I applied the fixes. But the only fix was to make ToneGenerator.py generate nicer sounding tones. But you still have to run ToneGenerator.py by hand before running a demo that needs the files.

I like the idea of turning ToneGenerator.py into a module and automatically calling it when needed. I’ll work on it.

I just checked in a simple fix. Added the following to Keyoard_Player.py

if __name__ == "__main__":
    from os import path
    if not path.exists("/tmp/scale/"):
        print("Please run ./ToneGenerator.py")
        exit()
    main()

If the scale directory isn’t there is suggests how to generate it.

I updated ToneGenerator.py to only generate missing files.