You are not logged in.

#1 2017-04-08 18:00:59

maxmoon
Member
Registered: 2014-11-30
Posts: 16

No sound if I plug in headset before booting Linux

I have a nice audio config, which works flawlessly, even if I plug in the headset while the system is running. But every time I let the headset plugged in and boot Linux I have no sound at all. My theory is that the card and device number will increase by 1 if the headset is still plugged in and that's why I can't hear any sound. Is it possible to use a unique id instead of a card and device number? Is there any other solution to avoid this issue?

.asoundrc

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

pcm.dmixer {
    type dmix
    ipc_key 1024
    ipc_key_add_uid 0
    ipc_perm 0666
    slave {
        pcm "hw:1,0"    # CARD AND DEVICE
        period_time 0
        period_size 1024
        buffer_size 8192
        rate 48000 #or 44100
	format S16_LE
	channels 2
    }
}

ctl.dmixer {
	type hw
	card 0
}

pcm.softvol {
	type softvol
	slave {
        	pcm "dmixer"
	}
	control {
		name "Master"
		card 0
	}
}

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

Thank you for your help

Offline

#2 2017-04-08 19:44:15

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,731

Re: No sound if I plug in headset before booting Linux

https://wiki.archlinux.org/index.php/Ad … sound_card and/or the Alternative Method a bit further below that,you can either define the indexing order for sound modules or use more persistent names

Offline

#3 2017-12-15 20:59:46

maxmoon
Member
Registered: 2014-11-30
Posts: 16

Re: No sound if I plug in headset before booting Linux

V1del wrote:

https://wiki.archlinux.org/index.php/Ad … sound_card and/or the Alternative Method a bit further below that,you can either define the indexing order for sound modules or use more persistent names

I couldn't figure out how to set the default sound output. The indexing order was somehow ignored by the system and other methods didn't work either. But I put an alias in my zshrc which allows me to set the output to headset or stereo jack by hand. Only disadvantage is, that I have to restart the software (browser, music, etc.) to hear the sound.

Is there a better solution to set the sound output? Is it possible to do live switch with Pulseaudio? I mean, without restarting the browser...

Thanks a lot for your help

Offline

#4 2017-12-15 23:55:28

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,731

Re: No sound if I plug in headset before booting Linux

Yes that's one of the reasons pulseaudio exists, if you intend to use it it'd be best to remove any ALSA config you have so far and install pulseaudio-alsa instead, then utilise pavucontrol which will help you in identifying where your audio is playing to and switching it on the fly.

Offline

Board footer

Powered by FluxBB