You are not logged in.

#1 2014-09-04 11:41:48

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,457

[SOLVED] ALSAPCM value ignored

If i do "export ALSAPCM=pulse" or "export ALSAPCM=pulseout"
nothing changes, and mplayer and aplay will continue to use the default PCM.
Isnt' ALSAPCM environment variable supposed to select the default pcm at runtime?
What am i missing?

Thanks.

Gozer ~ # aplay -L |head -n 10
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
pulseout
    Default ALSA Output (currently PulseAudio Sound Server)
default:CARD=Intel
    HDA Intel, ALC1200 Analog
    Default Audio Device
sysdefault:CARD=Intel


Gozer ~ # cat .asoundrc
pcm.pulseout {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.pulseout {
  type pulse
  fallback "sysdefault"
}

Edit: My fault.
Adding this to .asoundrc solved.

pcm.!default {
    type plug
    slave.pcm {
        @func getenv
        vars [ ALSAPCM ]
        default "dmix"
    }
}

Last edited by kokoko3k (2014-09-05 07:00:59)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#2 2014-09-04 12:27:50

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] ALSAPCM value ignored

 These are environment variables, that are already in place:

Alsa wiki wrote:
Variable name # Definition
ALSA_CARD # pcm.default pcm.hw pcm.plughw ctl.sysdefault ctl.hw rawmidi.default rawmidi.hw hwdep.hw
ALSA_CTL_CARD # ctl.sysdefault ctl.hw
ALSA_HWDEP_CARD # hwdep.default hwdep.hw
ALSA_HWDEP_DEVICE # hwdep.default hwdep.hw
ALSA_PCM_CARD # pcm.default pcm.hw pcm.plughw
ALSA_PCM_DEVICE # pcm.hw pcm.plughw
ALSA_RAWMIDI_CARD # rawmidi.default rawmidi.hw
ALSA_RAWMIDI_DEVICE # rawmidi.default rawmidi.hw

 That configuration file butchers the default setup. There is nothing wrong with that if you know how to get multiple sound sources and capture working again. If you do not, use something less restrictive for default value like 'dmix:CARD' or preferably an asym pcm or the [whole] original pcm.default as slave.

Edit: I see you changed it to dmix, good move. Changed format of the quote.

Last edited by emeres (2014-09-04 12:32:17)

Offline

#3 2014-09-05 07:00:26

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,457

Re: [SOLVED] ALSAPCM value ignored

Thanks for replying.
Do you think that using dmix as default will not lead to other issues?


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#4 2014-09-05 10:06:59

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] ALSAPCM value ignored

 There should be repercussions with capturing. You will have to explicitly* specify the capture device, since the pcm.default has none. Read through the documentation. You will not be able to capture from the same pcm device, which is the reason I suggested either an asym as default or the original pcm.default as slave.pcm. Simply running arecord with that pcm.default will/should default back to hw:0,0, the problem is again blocking, so dsnoop would need to be used. In the end it depends on your needs, you may not even notice it.

Edit: Quite the opposite, explicitly not implicitly. The pcm.default uses dsnoop on the card from either environment variables or defaults.pcm.dsnoop.card which refers to defaults.pcm.card.

Last edited by emeres (2014-09-05 11:04:08)

Offline

#5 2014-09-05 10:38:36

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,457

Re: [SOLVED] ALSAPCM value ignored

Understood, thanks.

-edit
This seems to work with both multiple capturing and playback streams and does format conversion:

pcm.!default {
    type plug
    slave.pcm "asymed"
}

pcm.asymed {
    type asym
    playback.pcm {
        @func getenv
        vars [ ALSAPCM ]
        default "dmix"
    }
    capture.pcm "dsnooped"
}

   pcm.dsnooped {
       ipc_key 1027
       type dsnoop
       slave.pcm "hw:0,0"
   }

Last edited by kokoko3k (2014-09-05 12:44:29)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

Board footer

Powered by FluxBB