Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB-Audio: Add profile for MSI MPG X570S Carbon Max Wifi. #143

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
83 changes: 83 additions & 0 deletions ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Define.SPDIFIndex "3"
Define.Mic1Name "Microphone"

If.asus-rog-usb {
Condition {
Type RegexMatch
String "${CardComponents}"
Regex "USB(0b05:1996)"
}
True {
Define.SPDIFIndex "2"
Define.Mic1Name "Front Microphone"

SectionDevice."Mic2" {
# On ASUS ROG Maximus XIII and others, back microphone
Comment "Microphone"
Value {
CapturePriority 300
CapturePCM "hw:${CardId}"
JackControl "Mic - Input Jack"
CaptureMixerElem "Mic"
}
}
}
}

SectionDevice."Speaker" {
Comment "Speakers"
Value {
PlaybackChannels 8
PlaybackPriority 200
PlaybackPCM "hw:${CardId}"
JackControl "Speaker - Output Jack"
PlaybackMixerElem "Speaker"
}
}

SectionDevice."Headphones" {
Comment "Front Headphones"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to test.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on MSI MAG X570S Torpedo Max (tested)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works.

Value {
PlaybackPriority 300
PlaybackPCM "hw:${CardId},1"
JackControl "Headphone - Output Jack"
PlaybackMixerElem "Front Headphone"
}
}

SectionDevice."SPDIF" {
Comment "S/PDIF Out"
Value {
PlaybackPriority 100
PlaybackPCM "hw:${CardId},${var:SPDIFIndex}"
PlaybackMixerElem "IEC958"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be hw:${CardId},2.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On MSI MAG X570S Torpedo Max: hw:${CardId},3 outputs to S/PDIF (tested)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what to do here. Maybe the ASUS board has a different layout? Which board did you try this on @Tatsh?

Copy link
Contributor

@Tatsh Tatsh Apr 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's definitely 2 on ASUS ROG Maximus XIII. What you could do is have this be conditional based on RegexMatch (not tested below).

Define SPDIFIndex "3"

If.asus-rog-usb {
    Condition {
      Type RegexMatch
       String "${CardComponents}"
      Regex "USB(0b05:1996)"
    }
    True.SPDIFIndex "2"
}

Then refer to ${SPDIFIndex} in PlaybackPCM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed syntax:

Define.SPDIFIndex "3"

If.asus-rog-usb {
        Condition {
                Type RegexMatch
                String "${CardComponents}"
                Regex "USB(0b05:1996)"
        }
        True.Define.SPDIFIndex "2"
}

...

SectionDevice."SPDIF" {
        Comment "S/PDIF Out"
        Value {
                PlaybackPriority 100
                PlaybackPCM "hw:${CardId},${var:SPDIFIndex}"
                PlaybackMixerElem "IEC958"
        }
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lordhoto SPDIFIndex is 2 on the MSI MPG Z690 EDGE (0db0:1feb) as well.

Do I need to open a new issue for this (conditional) change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tekstryder sorry for the late reply: yes, you'll need to open a new issue/pull request for this change. There is pull request has been closed already.

}
}

SectionDevice."Line" {
EnableSequence [
cset "name='Line Capture Switch' on"
]

Comment "Line In"
Value {
CapturePriority 100
CapturePCM "hw:${CardId},1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detects plug in, but have not yet got any sound in. Will try with a better device soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, Line In works with another sound card connected as sound source. Should work, but maybe levels are low here too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line-in works well enough. I tested with my phone connected though I had to turn up the volume a bit.

It may be a good thing that there is not a boost like Windows. This allows more headroom. OBS can boost the source live (Audacity cannot). When I use a lavalier mic in normal position and boost with OBS to 20 dBm, it sounds good enough and there is not much noise.

JackControl "Line - Input Jack"
CaptureMixerElem "Line"
}
}

SectionDevice."Mic1" {
EnableSequence [
cset "name='Mic Capture Switch' on"
]

Comment "${var:Mic1Name}"
Value {
CapturePriority 200
CapturePCM "hw:${CardId},2"
Copy link
Contributor

@Tatsh Tatsh Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works but only on the front connector. Back connector gets no input. Will try with another device.

Also it seems (with a typical lavalier microphone) to be low volume. Talking at normal recording volume reaches about -30 dBm and I am expecting to get closer to -12. Maybe not a UCM issue.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Front Mic works on MSI MAG X570S Torpedo Max (tested), rear connector not tested; level somewhat low

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Level is indeed a bit low. The volume levels on Windows are noticeably higher. I guess Windows seems to apply some boost (even without enabling it in the settings).

Back microphone connector definitely works on hw:${CardId},2 on my board. Front and back levels are between -42dBm to -36dBm during normal talking for me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use cset to set the level like here: https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/Qualcomm/apq8096/HiFi.conf#L18= If this value is dBm, then maybe it should be about 20?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried setting the volume this way and it made no difference.

JackControl "Mic - Input Jack"
CaptureMixerElem "Mic"
}
}
5 changes: 5 additions & 0 deletions ucm2/USB-Audio/Realtek/ALC4080.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Comment "USB-audio on Realtek ALC4080"
SectionUseCase."HiFi" {
File "/USB-Audio/Realtek/ALC4080-HiFi.conf"
Comment "Play HiFi quality Music"
}
14 changes: 14 additions & 0 deletions ucm2/USB-Audio/USB-Audio.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ If.realtek-alc1220-vb {
True.Define.ProfileName "Realtek/ALC1220-VB-Desktop"
}

If.realtek-alc4080 {

Condition {
Type RegexMatch
String "${CardComponents}"
# 0b05:1996 ASUS on multiple boards (including ASUS ROG Maximus XIII)
# 0db0:1feb MSI Edge Wifi Z690
# 0db0:419c MSI MPG X570S Carbon Max Wifi
# 0db0:a073 MSI MAG X570S Torpedo Max
Regex "USB((0b05:1996)|(0db0:1feb)|(0db0:419c)|(0db0:a073))"
}
True.Define.ProfileName "Realtek/ALC4080"
}

If.gigabyte-aorus-main {
Condition {
Type String
Expand Down