1
votes

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?

3
Try updating alsa-lib.CL.
libasound2 and libasound2-dev are already the latest versions (1.0.27.2-3ubuntu7).user1704042
Update: I reinstalled Ubuntu Studio 14.04, and now it seems to work.user1704042
Update: Now it no longer works, with the same error. I believe the problem started after I redid "./configure && make".user1704042

3 Answers

1
votes

So I think I've found a solution. After the most recent error, I noticed the recommendation for a different audio issue here to restart the audio drivers in the following way:

pulseaudio -k && sudo alsa force-reload

I did it, and then tried running the compiled program, and got errors again (I think I was being impatient). I then did this command a second time, and now it works.

update: After a while, I do get the error again, and have to restart the drivers again.

1
votes

Currently I am the maintainer of the Portaudio-linux host, and have just come across this question here. The same issue has been reported on the Portaudio mailing list, and investigated. The assert is in Alsa-lib, and has now been removed by the Alsa-developers in favour of an error return. See

http://git.alsa-project.org/?p=alsa-lib.git;a=commit;h=67f73b0fab466e780dcc0442e19894a1cbedc43b

Certain devices seem to cause a problem with 6-channels on 'front' (and some other) PCMs. This is not a fault of Portaudio, but as it probes the capabilities of the devices and PCMs it exposes issues within the Alsa system. With the assert removed, it now just fails these capabilities.

0
votes

I encountered the same problem and resolved it by fixing some faulty pcm definitions in /usr/share/alsa/pcm. In the route section towards the bottom of the file the card driver was referencing a different pcm then the one defined in the file.