I installed portaudio on Ubuntu 14.04 and compiled a test program as follows:
gcc -o Test3c Test3c.c ../libportaudio.a -lrt -lasound -ljack -lpthread -lm
which had no errors. (Test3c.c is the same as the included pa_devs.c, which can be found here.) But when I run it,
./Test3c
I get this:
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
PortAudio version number = 1899
PortAudio version text = 'PortAudio V19-devel (built Feb 14 2015 11:51:22)'
Number of devices = 20
--------------------------------------- device #0
Name = HDA Intel PCH: ALC892 Analog (hw:0,0)
Host API = ALSA
Max inputs = 2, Max outputs = 6
Default low input latency = 0.0058
Default low output latency = 0.0087
Default high input latency = 0.0348
Default high output latency = 0.0348
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
44100.00, 48000.00, 96000.00, 192000.00
Supported standard sample rates
for half-duplex 16 bit 6 channel output =
None
Supported standard sample rates
for full-duplex 16 bit 2 channel input, 6 channel output =
None
--------------------------------------- device #1
Name = HDA Intel PCH: ALC892 Digital (hw:0,1)
Host API = ALSA
Max inputs = 0, Max outputs = 2
Default low input latency = -1.0000
Default low output latency = 0.0058
Default high input latency = -1.0000
Default high output latency = 0.0348
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
32000.00, 44100.00, 48000.00, 88200.00,
96000.00, 192000.00
--------------------------------------- device #2
Name = HDA Intel PCH: ALC892 Alt Analog (hw:0,2)
Host API = ALSA
Max inputs = 2, Max outputs = 0
Default low input latency = 0.0058
Default low output latency = -1.0000
Default high input latency = 0.0348
Default high output latency = -1.0000
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
44100.00, 48000.00, 96000.00, 192000.00
--------------------------------------- device #3
Name = HDA NVidia: HDMI 0 (hw:1,3)
Host API = ALSA
Max inputs = 0, Max outputs = 8
Default low input latency = -1.0000
Default low output latency = 0.0058
Default high input latency = -1.0000
Default high output latency = 0.0348
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 8 channel output =
32000.00, 44100.00, 48000.00, 88200.00,
96000.00, 192000.00
--------------------------------------- device #4
Name = HDA NVidia: HDMI 0 (hw:1,7)
Host API = ALSA
Max inputs = 0, Max outputs = 8
Default low input latency = -1.0000
Default low output latency = 0.0058
Default high input latency = -1.0000
Default high output latency = 0.0348
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 8 channel output =
32000.00, 44100.00, 48000.00, 88200.00,
96000.00, 192000.00
--------------------------------------- device #5
Name = HDA NVidia: HDMI 0 (hw:1,8)
Host API = ALSA
Max inputs = 0, Max outputs = 8
Default low input latency = -1.0000
Default low output latency = 0.0058
Default high input latency = -1.0000
Default high output latency = 0.0348
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 8 channel output =
32000.00, 44100.00, 48000.00, 88200.00,
96000.00, 192000.00
--------------------------------------- device #6
Name = HDA NVidia: HDMI 0 (hw:1,9)
Host API = ALSA
Max inputs = 0, Max outputs = 8
Default low input latency = -1.0000
Default low output latency = 0.0058
Default high input latency = -1.0000
Default high output latency = 0.0348
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 8 channel output =
32000.00, 44100.00, 48000.00, 88200.00,
96000.00, 192000.00
--------------------------------------- device #7
Name = sysdefault
Host API = ALSA
Max inputs = 128, Max outputs = 128
Default low input latency = 0.0213
Default low output latency = 0.0213
Default high input latency = 0.0213
Default high output latency = 0.0213
Default sample rate = 48000.00
Supported standard sample rates
for half-duplex 16 bit 128 channel input =
8000.00, 9600.00, 11025.00, 16000.00,
22050.00, 32000.00, 44100.00, 48000.00,
88200.00
Supported standard sample rates
for half-duplex 16 bit 128 channel output =
8000.00, 9600.00, 11025.00, 16000.00,
22050.00, 32000.00, 44100.00, 48000.00,
88200.00
Supported standard sample rates
for full-duplex 16 bit 128 channel input, 128 channel output =
8000.00, 9600.00, 11025.00, 16000.00,
22050.00, 32000.00, 44100.00, 48000.00,
88200.00
--------------------------------------- device #8
Name = front
Host API = ALSA
Max inputs = 0, Max outputs = 6
Default low input latency = -1.0000
Default low output latency = 0.0058
Default high input latency = -1.0000
Default high output latency = 0.0348
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 6 channel output =
Test3c: pcm_params.c:2249: snd1_pcm_hw_params_slave: Assertion `err >= 0' failed.
Aborted (core dumped)
It crashes midway through listing the devices, when Pa_IsFormatSupported() is called. Google tells me that "pcm_params.c" refers to the ALSA library. Has anyone found a solution to this type of problem?
alsa-lib
. – CL.