Skip to content

Instantly share code, notes, and snippets.

@curz46
Last active April 30, 2023 10:01
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save curz46/1ce42f9c59136cc812b7518963d770b4 to your computer and use it in GitHub Desktop.
Save curz46/1ce42f9c59136cc812b7518963d770b4 to your computer and use it in GitHub Desktop.
astro a50 pulseaudio /etc/pulse/default.pa
# pulseaudio defaults to only detecting Astro A50 voice and microphone, not game
# this is what i had to do to fix it, hopefully it saves someone some time
# index:subdevice may be different for you
# resources:
# https://wiki.archlinux.org/index.php/PulseAudio/Examples at "module-alsa-sink"
# https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#index6h3
.nofail
load-module module-alsa-sink device=hw:3,0 sink_name=voice
update-sink-proplist voice device.description="Astro A50 Voice"
# it also incorrectly orders the channel map, i believe this is relatively correct (at least not unbalanced)
load-module module-alsa-sink device=hw:3,1 sink_name=game channel_map=left,right,fro
nt-center,rear-center,rear-left,rear-right
update-sink-proplist game device.description="Astro A50 Game"
load-module module-alsa-source device=hw:3,0
@FennyFatal
Copy link

This was a b*** to hunt down, but your channel mapping just saved me a whole lot of time. TYVM

@curz46
Copy link
Author

curz46 commented Aug 30, 2019

@FennyFatal Glad it saved you some time 👍

@Vladimyr0
Copy link

I thought it's impossible! °_°

@rubycasey
Copy link

My friend has an A20 wireless headset, but we were hoping this would work since they're similar headsets. There was no default.ca in the etc/pulse/ directory, but there was a default.pa so we pasted the code into into that. Is there anything I'm doing wrong, or does this just not work for the A20? Also worth mentioning we're trying it on Manjaro XFCE.

@curz46
Copy link
Author

curz46 commented Mar 13, 2020

It should be .pa, I guess I made a typo on the file name here. It was a long time ago but I noted that the device ids are likely different for you (mine were 3,0 and 3,1). I believe I found them using aplay -l. I hope this helps. @pcnerd19

@sirlancelot
Copy link

I can't believe it's taken me so long to find this. Thank you so much!

@Vladimyr0
Copy link

Vladimyr0 commented May 14, 2020

There is a minor problem with this solution.
Sometimes (after plugging/unplugging usb devices and probably some other actions) configuration of my pc is changing and I forces to change current port in the file from 1 to 2 or vice versa.
Does anybody know, how to prevent or automate it?

@curz46
Copy link
Author

curz46 commented May 14, 2020

You could write a script that outputs a .pa file and restarts the pulseaudio daemon on startup (or does it before pulseaudio service in systemctl). You could parse aplay output to find the port you need. There might also be some pulseaudio directives that can filter based on device name rather than port. I personally found the specification a nightmare, though. I wonder if it’s worth the effort.

@Vladimyr0
Copy link

Vladimyr0 commented May 16, 2020

#!/bin/bash

HWID=aplay -l | grep 'A50' | cut -d" " -f2 | head -1 | cut -d":" -f1
echo "Headset is on the port #$HWID"
pacmd "load-module module-alsa-sink device=hw:$HWID,0 sink_name=voice"
pacmd "update-sink-proplist voice device.description='Astro A50 Voice'"
pacmd "load-module module-alsa-sink device=hw:$HWID,1 sink_name=game channel_map=left,right,front-center,rear-center,rear-left,rear-right"
pacmd "update-sink-proplist game device.description='Astro A50 Game'"
pacmd "load-module module-alsa-source device=hw:$HWID,0"

@trevholland
Copy link

A little late to the party here, but do I append this to the current default.pa? Or do I replace default.pa with this one?

@Vladimyr0
Copy link

This needs to be put into filename.sh which is run on system startup.
no needs of config modification anymore

@FennyFatal
Copy link

#!/bin/bash

HWID=`aplay -l | grep 'A50' | cut -d" " -f2 | head -1 | cut -d":" -f1`
echo "Headset is on the port #$HWID"
pacmd "load-module module-alsa-sink device=hw:$HWID,0 sink_name=voice"
pacmd "update-sink-proplist voice device.description='Astro A50 Voice'"
pacmd "load-module module-alsa-sink device=hw:$HWID,1 sink_name=game channel_map=left,right,front-center,rear-center,rear-left,rear-right"
pacmd "update-sink-proplist game device.description='Astro A50 Game'"
pacmd "load-module module-alsa-source device=hw:$HWID,0"

@trevholland
Copy link

Oh, I was referring to the initial suggestion. But I might go the sh route anyway. It feels cleaner and less error prone.

@ktosiek
Copy link

ktosiek commented Jul 9, 2020

A more integrated approach, adding a profile-set to PA and an udev rule: https://gist.github.com/ktosiek/ff35074c309b291b4193b1f6167ca6fc

I think my approach only works on PA 13, as it depends on parts from the SteelSeries Artics 5 support that was added in that version of PA.

@YannikSc
Copy link

YannikSc commented Oct 28, 2020

A more integrated approach, adding a profile-set to PA and an udev rule: https://gist.github.com/ktosiek/ff35074c309b291b4193b1f6167ca6fc

I think my approach only works on PA 13, as it depends on parts from the SteelSeries Artics 5 support that was added in that version of PA.

Your approach was not quite the full solution for me. I still was missing the Game output but with removing the paths-output line and changing the channel-map line to channel-map = left,right,front-center,rear-center,rear-left,rear-right everything works fine.

Edit: Only the channel-map were causing this

@ktosiek
Copy link

ktosiek commented Oct 28, 2020

@YannikSc which version of PA is that? It should be shown by pulseaudio --version. I've just checked, and the configuration from my gist works on Ubuntu 20.04 with pulseaudio 13.99.1.
It's also interesting you have a six channel channel-map - I though the surround support was only for DTS, can you actually use all those channels?

If you can run PA 14, this profile is already upstream. Even the new pipewire daemon has picked it up, so future looks bright for this headset :-)

Edit: we could also move the discussion of problems with my code to my gist, so we don't confuse the discussion here.

@brigs
Copy link

brigs commented Nov 28, 2020

@FennyFatal - thanks for your script, much appreciated!

HWID=aplay -l | grep 'A50' | cut -d" " -f2 | head -1 | cut -d":" -f1

should be changed to:

HWID=$(aplay -l | grep 'A50' | cut -d" " -f2 | head -1 | cut -d":" -f1)

for it to run through shellcheck :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment