I'm using a Raspberry Pi Zero W and the built-in Bluetooth chip. More version info is at the bottom of the post.
Detailed information:
First, before connecting to Bluetooth headphones, I get the following error because there's no other sound output connected. This is expected.
Error when there's no device to output sound to:
Code: Select all
ALSA lib bluealsa-pcm.c:679:(_snd_pcm_bluealsa_open) Couldn't get BlueALSA transport: No such device
aplay: main:788: audio open error: No such device
Output from "amixer":
Code: Select all
Simple mixer control 'Vidonn F1 - A2DP',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 127
Mono:
Front Left: Playback 127 [100%] [on]
Front Right: Playback 127 [100%] [on]
Simple mixer control 'Vidonn F1 - SCO',0
Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch pswitch-joined cswitch cswitch-joined
Playback channels: Mono
Capture channels: Mono
Limits: Playback 0 - 15 Capture 0 - 15
Mono: Playback 12 [80%] [on] Capture 15 [100%] [on]
Code: Select all
null
Discard all samples (playback) or generate zero samples (capture)
default
sysdefault:CARD=ALSA
bcm2835 ALSA, bcm2835 ALSA
Default Audio Device
dmix:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct sample mixing device
dmix:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct sample snooping device
hw:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Hardware device with all software conversions
Here is my basic python test program:
simplePyGame.py
Code: Select all
import pygame.mixer
pygame.mixer.init(48000, -16, 1, 1024)
sndA = pygame.mixer.Sound("A.wav")
soundChannel1A = pygame.mixer.Channel(1)
soundChannel1A.play(sndA)
Running the python program outputs the following:
"python simplePyGame.py"
Code: Select all
Traceback (most recent call last):
File "simplePyGame.py", line 3, in <module>
pygame.mixer.init(48000, -16, 1, 1024)
pygame.error: Couldn't set hardware audio parameters: Success
viewtopic.php?t=160164
Now, using "aplay" to play a WAV file outputs this error. It doesn't go away until the Raspberry Pi is restarted.
Code: Select all
Playing WAVE '../20second_sine.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
aplay: set_params:1363: Unable to install hw params:
ACCESS: RW_INTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: 16
CHANNELS: 1
RATE: 8000
PERIOD_TIME: (85333 85334)
PERIOD_SIZE: (682 683)
PERIOD_BYTES: (1364 1366)
PERIODS: (5 7)
BUFFER_TIME: 511875
BUFFER_SIZE: NONE
BUFFER_BYTES: 8190
TICK_TIME: 0
Version info:
"python --version"
Code: Select all
Python 2.7.13
Code: Select all
aplay: version 1.1.3 by Jaroslav Kysela <perex@perex.cz>
Code: Select all
Name: pygame
Version: 1.9.3
Summary: Python Game Development
Home-page: http://www.pygame.org
Author: Pete Shinners, Rene Dudfield, Marcus von Appen, Bob Pendleton, others...
Author-email: pygame@seul.org
License: LGPL
Location: /usr/lib/python2.7/dist-packages
Requires:
OS release is:
Code: Select all
Raspbian GNU/Linux 9 (stretch)
Code: Select all
1.2.0