2010-08-20 11:51:59     linphonec, mediastreamer2, and alsa

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-08-20 11:51:59     linphonec, mediastreamer2, and alsa

Matt Gilg (UNITED STATES)

Message: 92642   

 

Running linphonec and placing a call gives me the following output repeatedly:

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------

 

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:392:(snd_func_concat) error evaluating strings

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_concat returned error: No such device or address

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1251:(snd_func_refer) error evaluating name

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such device or address

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such device or address

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM default

ALSA lib ../../../alsa-lib-1.0.18/src/control/control.c:877:(snd_ctl_open_conf) symbol _snd_ctl_hw_open is not defined inside (null)

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:674:(snd_determine_driver) could not open control for card 0

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device or address

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:392:(snd_func_concat) error evaluating strings

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_concat returned error: No such device or address

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1251:(snd_func_refer) error evaluating name

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such device or address

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such device or address

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM default

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Creating a new stream with mediastreamer2 and attaching it to the default card gives me this output:

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------

 

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.pcm.dmix.device'

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM default

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.pcm.dmix.device'

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM default

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.pcm.dmix.device'

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM default

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.pcm.dmix.device'

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM default

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.pcm.dmix.device'

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM default

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Has anyone seen this before?  Both cases end up with ALSA "Unknown PCM default" errors.  Thought I'd ask before I go digging around in the ALSA driver.

 

Thanks,

-Matt

QuoteReplyEditDelete

 

 

2010-08-20 12:50:07     Re: linphonec, mediastreamer2, and alsa

Mike Frysinger (UNITED STATES)

Message: 92646   

 

what devices do you have exactly ?  what does the kernel show when booting ?

 

do simply apps like `aplay` work ?

QuoteReplyEditDelete

 

 

2010-08-20 13:03:42     Re: linphonec, mediastreamer2, and alsa

Matt Gilg (UNITED STATES)

Message: 92647   

 

Hi Mike,

 

I can use the soundcard successfully by linking the alsa library and writing samples to the device manually.

 

On startup:

usbcore: registered new interface driver libusual

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

Advanced Linux Sound Architecture Driver Version 1.0.18rc3.

 

Probing AD1938...<6>dma_alloc_init: dma_page @ 0x01c2c000 - 256 pages at 0x03f00000

snd_ad1938_configure

 

AD1938 Initialization complete. (ret=0)

ALSA device list:

  #0: ADI ad1938 at PF3 SPORT0 rx/tx dma 3/4 err irq 45

TCP cubic registered

NET: Registered protocol family 17

Freeing unused kernel memory: 19144k freed

 

 

Running aplay:

root:~> aplay

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.pcm.dmix.device'

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM default

aplay: main:550: audio open error: No such file or directory

 

QuoteReplyEditDelete

 

 

2010-08-21 22:11:15     Re: linphonec, mediastreamer2, and alsa

Mike Frysinger (UNITED STATES)

Message: 92665   

 

do you have an AD1938.conf file installed ?

QuoteReplyEditDelete

 

 

2010-08-24 11:36:36     Re: linphonec, mediastreamer2, and alsa

Matt Gilg (UNITED STATES)

Message: 92731   

 

Yes, AD1938.conf exists in /usr/share/alsa/cards/AD1938.conf and looks like this:

 

---------------------------------------------------------------------

 

AD1938.pcm.default {

        @args [ CARD ]

        @args.CARD {

                type string

        }

        type plug

        slave.pcm {

                type mmap_emul

                slave.pcm {

                        type hw

                        format S32_LE

                        rate 16000

                        card $CARD

                }

        }

}

 

---------------------------------------------------------------------

 

when running linphone, it breaks with repeating errors:

 

---------------------------------------------------------------------

 

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.pcm.dmix.device'

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM default

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.pcm.dmix.device'

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM default

 

---------------------------------------------------------------------

 

When we updated the kernel and version of alsa, we had to change the way we open the sound device.  We used to do it like this:

          snd_pcm_open( &handle, "default", SND_PCM_STREAM_CAPTURE, 0 );

after the update we had to do it like this:

          snd_pcm_open( &handle, "hw:0,0", SND_PCM_STREAM_CAPTURE, 0 );

 

So it is looking more and more like something related to the "default" device and how it is specified. (Hence the 'Unknown PCM default' error?)

 

Any ideas?

 

Thanks,

-Matt

QuoteReplyEditDelete

 

 

2010-08-24 12:55:37     Re: linphonec, mediastreamer2, and alsa

Mike Frysinger (UNITED STATES)

Message: 92734   

 

things like that can go in your ~/.asoundrc

 

try using the -D option to aplay to change the selected target

QuoteReplyEditDelete

 

 

2010-08-24 13:47:23     Re: linphonec, mediastreamer2, and alsa

Matt Gilg (UNITED STATES)

Message: 92735   

 

Is there documentation for using dmix on the blackfin anywhere?  Is it true that an .asoundrc file shouldn't need to be required?

 

I'm interested in knowing more about what needs to be specified in the configuration to correctly use dmix.

 

root:/etc> aplay -D dmix

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.pcm.dmix.card'

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3974:(snd_config_expand) Args evaluate error: No such file or directory

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2204:(snd_pcm_open_noupdate) Unknown PCM dmix

aplay: main:550: audio open error: No such file or directory

 

 

root:/etc> aplay -D default

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.pcm.dmix.device'

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2204:(snd_pcm_open_noupdate) Unknown PCM default

aplay: main:550: audio open error: No such file or directory

 

 

Thanks,

-Matt

QuoteReplyEditDelete

 

 

2010-08-24 13:57:22     Re: linphonec, mediastreamer2, and alsa

Mike Frysinger (UNITED STATES)

Message: 92736   

 

using ALSA on a Blackfin system shouldnt really be any different from Linux on another system

QuoteReplyEditDelete

 

 

2010-08-24 14:22:49     Re: linphonec, mediastreamer2, and alsa

Matt Gilg (UNITED STATES)

Message: 92737   

I suspect there still may be a problem.

 

---------------------------------------------------------

using hw:0,0

---------------------------------------------------------

root:~> aplay -vv -D hw:0,0 /etc/8k16bitpcm.wav

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2161:(snd_pcm_open_conf) attempting call _snd_pcm_hw_open inside [builtin]

Playing WAVE '/etc/8k16bitpcm.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

aplay: set_params:904: Sample format non available

 

---------------------------------------------------------

using default

---------------------------------------------------------

root:~> aplay -vv /etc/8k16bitpcm.wav

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.pcm.dmix.device'

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2204:(snd_pcm_open_noupdate) Unknown PCM default

aplay: main:550: audio open error: No such file or directory

 

 

Is there a way to make dmix work 'out of the box'?  How/where exactly do I specify 'defaults.pcm.dmix.device'?  Do I add the line 'default.pcm.dmix.device hw:0,0' to .asoundrc? 

 

I apologize if I'm asking stupid questions, I really don't know how this stuff ought to work (or why it seems to be broken now).

 

-Matt

QuoteReplyEditDelete

 

 

2010-08-24 17:50:37     Re: linphonec, mediastreamer2, and alsa

Matt Gilg (UNITED STATES)

Message: 92738   

 

It seems like adding the following to alsa.conf fixes my issue with aplay:

 

defaults.pcm.dmix.card defaults.pcm.card

defaults.pcm.dmix.device defaults.pcm.device

defaults.pcm.dsnoop.card defaults.pcm.card

defaults.pcm.dsnoop.device defaults.pcm.device

 

-------------------------------------------------------------------------------------

 

root:~> aplay 8k16bitpcm.wav

Playing WAVE 8k16bitpcm.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono

Period/chunk size = 1000, buffer size = 4000

- Period/chunk size = 1000, buffer size = 4000

- Requested start_threshold = 4000, requested stop threshold = 4000

 

 

 

This works, I get audio out of my device.  Next step is testing dmix.

 

-Matt

QuoteReplyEditDelete

 

 

2010-08-24 18:06:33     Re: linphonec, mediastreamer2, and alsa

Matt Gilg (UNITED STATES)

Message: 92739   

 

To get past dmix config errors initially, I needed to add the following: 

 

+ defaults.namehint.showall off

+ defaults.namehint.basic on

+ defaults.namehint.extended off

 

and change:

     - defaults.pcm.dmix_rate 16000

     - defaults.pcm.dmix_format S32_LE

to:

     + defaults.pcm.dmix.rate 16000

     + defaults.pcm.dmix.format S32_LE

 

(without the '+' and '-' of course, they are there to clarify this post)

Once aplay quit complaining about dmix configuration, I get the following error:

 

 

root:~> aplay -D dmix /mnt/permanent/scripts/8k16bitpcm.wav

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm_direct.c:873:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm_dmix.c:1020:(snd_pcm_dmix_open) unable to initialize slave

aplay: main:550: audio open error: Invalid argument

 

So a few questions:

1) Anyone have an idea of what is going on here? 

2) Do we have to mod the 1938 driver to get dmix to work? 

31) Is it normal to have to specify all this extra stuff in alsa.conf for the default device to work?

 

 

Thanks,

-Matt

QuoteReplyEditDelete

 

 

2010-08-26 11:30:57     Re: linphonec, mediastreamer2, and alsa

Matt Gilg (UNITED STATES)

Message: 92813   

 

Using mediastreamer directly seemed to yield different results than linphone, even when using the same code.  After attaching the stream to the ticker, I would get the following errors continuously:

 

-----------------------------------------------------------------------------------------------

 

ALSA lib ../../../alsa-lib-1.0.18/src/control/control.c:877:(snd_ctl_open_conf) symbol _snd_ctl_hw_open is not defined inside (null)

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:674:(snd_determine_driver) could not open control for card 0

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:2714:(snd_config_hooks_call) function snd_config_hook_load_for_all_cards returned error: No such device or address

ALSA lib ../../../alsa-lib-1.0.18/src/control/control.c:877:(snd_ctl_open_conf) symbol _snd_ctl_hw_open is not defined inside (null)

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:674:(snd_determine_driver) could not open control for card 0

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device or address

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:392:(snd_func_concat) error evaluating strings

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_concat returned error: No such device or address

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:1251:(snd_func_refer) error evaluating name

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such device or address

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3985:(snd_config_expand) Evaluate error: No such device or address

ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm.c:2204:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.default

ALSA lib ../../../alsa-lib-1.0.18/src/control/control.c:877:(snd_ctl_open_conf) symbol _snd_ctl_hw_open is not defined inside (null)

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:674:(snd_determine_driver) could not open control for card 0

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device or address

ALSA lib ../../alsa-lib-1.0.18/src/confmisc.c:392:(snd_func_concat) error evaluating strings

ALSA lib ../../alsa-lib-1.0.18/src/conf.c:3513:(_snd_config_evaluate) function snd_func_concat returned error: No such device or address

 

-----------------------------------------------------------------------------------------------

 

As it turns out, a '-static' linker option in the project caused this problem. :-/ 

 

-Matt

Attachments

    Outcomes