Ticket #604 (new defect)

Opened 3 years ago

Last modified 3 weeks ago

[PATCH] virtualized downmix to headphone stereo patch

Reported by: Rudd-O Owned by: lennart
Milestone: Component: module-alsa-*
Keywords: Cc:

Description

Hey guys, my first patch. let me know what you think.

Attachments

0001-Virtualized-surround-support-with-alsa-vdownmix-plug.patch (7.2 kB) - added by Rudd-O 3 years ago.
adds support for vdownmix if vdownmix is present.
0001-Virtualized-surround-support-with-alsa-vdownmix-plug.patch-take2 (64 bytes) - added by Rudd-O 3 years ago.
better-commented with a more proper example configuration file
0001-Virtualized-surround-support-with-alsa-vdownmix-plug.2.patch (7.3 kB) - added by Rudd-O 3 years ago.
this one replaces all the old patches

Change History

Changed 3 years ago by Rudd-O

adds support for vdownmix if vdownmix is present.

Changed 3 years ago by Rudd-O

This is an updated vdownmix.conf ALSA configuration file, as per the patch's comment:


pcm.!vdownmix51 {

@args [ CARD DEV ] @args.CARD {

type string default {

@func getenv vars [

ALSA_VDOWNMIX51_CARD ALSA_PCM_CARD ALSA_CARD

] default {

@func refer name defaults.pcm.vdownmix51.card

}

}

} @args.DEV {

type integer default {

@func igetenv vars [

ALSA_VDOWNMIX51_DEVICE

] default {

@func refer name defaults.pcm.vdownmix51.device

}

}

} type vdownmix slave.pcm {

@func refer name {

@func concat strings [

"cards." {

@func card_driver card $CARD

} ".pcm.vdownmix51." $DEV ":CARD=" $CARD

]

}

} hint {

description "Downmix to stereo 5.1 Surround output to Front, Center, Rear and Subwoofer speakers" device $DEV

}

}

pcm.!vdownmix40 {

@args [ CARD DEV ] @args.CARD {

type string default {

@func getenv vars [

ALSA_VDOWNMIX40_CARD ALSA_PCM_CARD ALSA_CARD

] default {

@func refer name defaults.pcm.vdownmix40.card

}

}

} @args.DEV {

type integer default {

@func igetenv vars [

ALSA_VDOWNMIX40_DEVICE

] default {

@func refer name defaults.pcm.vdownmix40.device

}

}

} type vdownmix slave.pcm {

@func refer name {

@func concat strings [

"cards." {

@func card_driver card $CARD

} ".pcm.vdownmix40." $DEV ":CARD=" $CARD

]

}

} hint {

description "Downmix to stereo 4.0 Surround output to Front, Center, Rear and Subwoofer speakers" device $DEV

}

}


Any ALSA device with support for stereo output will automatically gain these "plug devices". You'll be able to virtualize surround sound output to PA in even meager stereo cards!

Changed 3 years ago by Rudd-O

better-commented with a more proper example configuration file

Changed 3 years ago by Rudd-O

this one replaces all the old patches

Changed 3 years ago by Rudd-O

  • summary changed from virtualized downmix to headphone stereo patch to [PATCH] virtualized downmix to headphone stereo patch

Changed 3 years ago by lennart

We already do up/down-mixing inside of PA. What does the ALSA downmixer/upmixer do, that we don't?

Changed 3 months ago by makomk

vdownmix does spacialization to give a virtual surround effect of some kind for headphone users. I think that PulseAudio just does simple downmixing by combining the audio channels; certainly that's what the comments in the code suggest. (Ran across this ticket whilst trying to figure out if PulseAudio supported anything fancier.)

Changed 3 weeks ago by Rudd-O

Note that I've now noted vdownmix has the effect of overwhelming the card's outputs because of clipping. It wasn't like that before, but now it is.

It'd be good if something akin to vdownmix was incorporated into pulse as a separate / selectable / configurable way of doing surround, as an alternative to simple downmixing. Then we wouldn't depend on ALSA.

A cat is fine too.

Note: See TracTickets for help on using tickets.