bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Independent Sound HDMI0 and HDMI1

Sun Aug 18, 2019 9:20 pm

Are there any updates on support for independent sound between the two HDMI interfaces? It seems like it was just limited to software. Is this tracked internally or a public means of a feature request on this.

6by9 and jamesh:
https://www.raspberrypi.org/forums/view ... 7#p1493187
https://www.raspberrypi.org/forums/view ... 6#p1493196

Thanks.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7555
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Independent Sound HDMI0 and HDMI1

Mon Aug 19, 2019 7:28 am

Merged https://github.com/raspberrypi/linux/pull/3100
Should be available via rpi-update.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Mon Aug 19, 2019 10:08 am

6by9 wrote:
Mon Aug 19, 2019 7:28 am
Merged https://github.com/raspberrypi/linux/pull/3100
Should be available via rpi-update.
Thank you very much! I will give it a go. This will make multi-seat audio work without an external USB device for sound on the second seat.

Now, we just need a full KMS driver that has two devices :) 3D acceleration doesn't work on multi-seat, yet.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7555
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Independent Sound HDMI0 and HDMI1

Mon Aug 19, 2019 10:30 am

bunklung wrote:
Mon Aug 19, 2019 10:08 am
Now, we just need a full KMS driver that has two devices :) 3D acceleration doesn't work on multi-seat, yet.
AFAIK Full KMS won't expose two framebuffers either, as that is part of the DRM core framework which is used by both drivers.

The KMS device exposes the CRTCs and encoders, and then the drm_framebuffer layer is what glues those devices together on top of them to emulate a /dev/fbN device. This is generic across all Linux systems be it x86 or ARM. At the moment I haven't the time to go googling to see if anyone has solved this problem already, but it sounds like it should be plausible to fix. A question on the dri-devel mailing list may well be in order.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

emilfr
Posts: 22
Joined: Thu May 14, 2015 5:25 am
Location: Dublin, IE

Re: Independent Sound HDMI0 and HDMI1

Mon Aug 19, 2019 10:45 am

bunklung wrote:
Mon Aug 19, 2019 10:08 am
6by9 wrote:
Mon Aug 19, 2019 7:28 am
Merged https://github.com/raspberrypi/linux/pull/3100
Should be available via rpi-update.
Thank you very much! I will give it a go. This will make multi-seat audio work without an external USB device for sound on the second seat.

Now, we just need a full KMS driver that has two devices :) 3D acceleration doesn't work on multi-seat, yet.
Waiting for this feature as well.
RPI Zero W || RPI 2B || 2x RPI 3B || 2x RPI 4B4G

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7555
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Independent Sound HDMI0 and HDMI1

Mon Aug 19, 2019 11:01 am

emilfr wrote:
Mon Aug 19, 2019 10:45 am
bunklung wrote:
Mon Aug 19, 2019 10:08 am
6by9 wrote:
Mon Aug 19, 2019 7:28 am
Merged https://github.com/raspberrypi/linux/pull/3100
Should be available via rpi-update.
Thank you very much! I will give it a go. This will make multi-seat audio work without an external USB device for sound on the second seat.

Now, we just need a full KMS driver that has two devices :) 3D acceleration doesn't work on multi-seat, yet.
Waiting for this feature as well.
Do a bit of Googling yourself then. This is now standard Linux DRM/KMS stuff.

David Airlie's blog from 2010 https://airlied.livejournal.com/72187.html. May need a few tweaks for 9 years worth of development, and it is patches to the (radeon) kernel driver that appear never to have been accepted upstream, and would need porting to vc4.
Querying the status on dri-devel would be worth it as plans may have changed since. David is still active in kernel development though, so it might have been picked up again.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Mon Aug 19, 2019 11:09 am

6by9 wrote:
Mon Aug 19, 2019 10:30 am
bunklung wrote:
Mon Aug 19, 2019 10:08 am
Now, we just need a full KMS driver that has two devices :) 3D acceleration doesn't work on multi-seat, yet.
AFAIK Full KMS won't expose two framebuffers either, as that is part of the DRM core framework which is used by both drivers.

The KMS device exposes the CRTCs and encoders, and then the drm_framebuffer layer is what glues those devices together on top of them to emulate a /dev/fbN device. This is generic across all Linux systems be it x86 or ARM. At the moment I haven't the time to go googling to see if anyone has solved this problem already, but it sounds like it should be plausible to fix. A question on the dri-devel mailing list may well be in order.
You all seem to be great at community questions and following up responses.

Should I create a new thread or bug report in regards to 3D support in a dual seat environment?

incognitum
Posts: 375
Joined: Tue Oct 30, 2018 3:34 pm

Re: Independent Sound HDMI0 and HDMI1

Mon Aug 19, 2019 11:21 am

6by9 wrote:
Mon Aug 19, 2019 11:01 am
Do a bit of Googling yourself then. This is now standard Linux DRM/KMS stuff.
The problem is that standard Linux DRM/KMS is too x86 centered.
People in the x86 world generally do not see this as such a big problem, as it can be simply solved by spending 20 bucks on a basic extra pci-e video card to use for the 2nd seat.
However plugging in a second video card on the Pi is not a realistic option...


And yes, there has been a way created since to share a single DRI device (not really to solve the multi-seat problem though, but because a VR glasses vendor needed the functionality as well).
xlease, which does not have a website. Do "git clone git://people.freedesktop.org/~keithp/xlease" to read the instructions.
But you will likely need to patch lightdm (which is responsible for starting up the X servers in the Pi eco-system) to get things to work with that, which is not great either, and may be more work than patching up kernel.

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Sun Aug 25, 2019 4:48 pm

I will start a new thread on the dual seat/device DRM discussion. (https://www.raspberrypi.org/forums/view ... 3&t=249870)

Has anyone got the second audio channel working? I don't see it available. Do I need to configure it on config.txt to be exposed?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24149
Joined: Sat Jul 30, 2011 7:41 pm

Re: Independent Sound HDMI0 and HDMI1

Mon Aug 26, 2019 8:07 pm

You should be able to play on different hdmi channels, using aplay, but I cannot remember the exact runes right now.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Mon Aug 26, 2019 9:34 pm

jamesh wrote:
Mon Aug 26, 2019 8:07 pm
You should be able to play on different hdmi channels, using aplay, but I cannot remember the exact runes right now.
Okay, I see the device, however it plays to HDMI0

Code: Select all

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 7/7
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
When I play the first three files they all play to HDMI0 (HDMI), The third *should* play to HDMI1. The 4th plays to my USB sound device.

Code: Select all

[email protected]:~ $ aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Right.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Right.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
[email protected]:~ $ aplay -D plughw:0,1 /usr/share/sounds/alsa/Front_Right.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Right.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
[email protected]:~ $ aplay -D plughw:0,2 /usr/share/sounds/alsa/Front_Right.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Right.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
[email protected]:~ $ aplay -D plughw:1,0 /usr/share/sounds/alsa/Front_Right.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Right.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
I am using the latest rpi-update firmware. Do I have to enable anything in config.txt?

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Mon Aug 26, 2019 11:34 pm

jamesh wrote:
Mon Aug 26, 2019 8:07 pm
You should be able to play on different hdmi channels, using aplay, but I cannot remember the exact runes right now.
I also tried:

Code: Select all

"hdmi_preferred=1" in /boot/config.txt to shift audio (and CEC) to HDMI1.
(https://www.raspberrypi.org/forums/view ... d#p1495438)
and:

Code: Select all

"I looked at other threads and the following line brought back sound over hdmi:
add "hdmi_drive=2" to /boot/config.txt in raspbian."
(https://www.raspberrypi.org/forums/view ... d#p1524440)

Still always plays on HDMI0

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24149
Joined: Sat Jul 30, 2011 7:41 pm

Re: Independent Sound HDMI0 and HDMI1

Tue Aug 27, 2019 8:57 am

Are you running an rpi-update'd Linux? The changes for this were very recent so might not be in apt yet.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Tue Aug 27, 2019 10:35 am

jamesh wrote:
Tue Aug 27, 2019 8:57 am
Are you running an rpi-update'd Linux? The changes for this were very recent so might not be in apt yet.
I am using rpi-update.

Code: Select all

[email protected]:~ $ sudo rpi-update                                               *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Performing self-update
 *** Relaunching after update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Your firmware is already up to date
[email protected]:~ $ uname -a
Linux raspberrypi 4.19.66-v7l+ #1253 SMP Thu Aug 15 12:02:08 BST 2019 armv7l GNU/Linux
I am surprised hdmi_preferred=1 doesn't work, but I think that wasn't widely documented anyhow.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7555
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Independent Sound HDMI0 and HDMI1

Tue Aug 27, 2019 5:00 pm

This is my first poke around with ALSA and this driver - slightly icky to say the least!

Fully updated Raspbian and rpi-updated kernel/firmware gives a drop down list of destinations from the volume control plugin on the taskbar. The odd thing is that all the devices are routed through the same data channel, and it is using the PCM Playback Route control to switch where that goes. I've not found a way to have two outputs active simultaneously, however the audio does route to whereever is specified.


The kernel module (snd_bcm2835) does have a couple of parameters which seem to switch the mode of operation.
Add

Code: Select all

snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_compat_alsa=0
to /boot/cmdline.txt (do NOT add any line breaks) and reboot.

aplay now reports

Code: Select all

[email protected]:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [bcm2835 HDMI], device 0: bcm2835 HDMI [bcm2835 HDMI]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 1: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
card 2: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
[email protected]:~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default
sysdefault:CARD=HDMI
    bcm2835 HDMI, bcm2835 HDMI
    Default Audio Device
dmix:CARD=HDMI,DEV=0
    bcm2835 HDMI, bcm2835 HDMI
    Direct sample mixing device
dsnoop:CARD=HDMI,DEV=0
    bcm2835 HDMI, bcm2835 HDMI
    Direct sample snooping device
hw:CARD=HDMI,DEV=0
    bcm2835 HDMI, bcm2835 HDMI
    Direct hardware device without any conversions
plughw:CARD=HDMI,DEV=0
    bcm2835 HDMI, bcm2835 HDMI
    Hardware device with all software conversions
sysdefault:CARD=b1
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Default Audio Device
dmix:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct sample mixing device
dsnoop:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct sample snooping device
hw:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct hardware device without any conversions
plughw:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Hardware device with all software conversions
sysdefault:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
dmix:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample mixing device
dsnoop:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample snooping device
hw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Hardware device with all software conversions
And

Code: Select all

aplay -D hw:CARD=Headphones,DEV=0 foo.wav
aplay -D hw:CARD=HDMI,DEV=0 foo.wav
aplay -D hw:CARD=b1,DEV=0 foo.wav
all do the expected thing, and are available simultaneously. The Raspbian volume plugin gets totally lost with the multiple devices though.

As to why this driver has two ways to configure stuff, I have no idea!
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7555
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Independent Sound HDMI0 and HDMI1

Tue Aug 27, 2019 5:25 pm

6by9 wrote:
Tue Aug 27, 2019 5:00 pm
As to why this driver has two ways to configure stuff, I have no idea!
A quick poke in the git history reveals that it was upstream that mangled this and added the module parameters.
We could change the defaults, but that will break some userland handling of audio devices (Raspbian's volume plugin for one).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Tue Aug 27, 2019 5:51 pm

6by9 wrote:
Tue Aug 27, 2019 5:00 pm
This is my first poke around with ALSA and this driver - slightly icky to say the least!

Fully updated Raspbian and rpi-updated kernel/firmware gives a drop down list of destinations from the volume control plugin on the taskbar. The odd thing is that all the devices are routed through the same data channel, and it is using the PCM Playback Route control to switch where that goes. I've not found a way to have two outputs active simultaneously, however the audio does route to whereever is specified.


The kernel module (snd_bcm2835) does have a couple of parameters which seem to switch the mode of operation.
Add

Code: Select all

snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_compat_alsa=0
to /boot/cmdline.txt (do NOT add any line breaks) and reboot.

aplay now reports

Code: Select all

[email protected]:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [bcm2835 HDMI], device 0: bcm2835 HDMI [bcm2835 HDMI]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 1: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
card 2: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
[email protected]:~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default
sysdefault:CARD=HDMI
    bcm2835 HDMI, bcm2835 HDMI
    Default Audio Device
dmix:CARD=HDMI,DEV=0
    bcm2835 HDMI, bcm2835 HDMI
    Direct sample mixing device
dsnoop:CARD=HDMI,DEV=0
    bcm2835 HDMI, bcm2835 HDMI
    Direct sample snooping device
hw:CARD=HDMI,DEV=0
    bcm2835 HDMI, bcm2835 HDMI
    Direct hardware device without any conversions
plughw:CARD=HDMI,DEV=0
    bcm2835 HDMI, bcm2835 HDMI
    Hardware device with all software conversions
sysdefault:CARD=b1
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Default Audio Device
dmix:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct sample mixing device
dsnoop:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct sample snooping device
hw:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Direct hardware device without any conversions
plughw:CARD=b1,DEV=0
    bcm2835 HDMI 1, bcm2835 HDMI 1
    Hardware device with all software conversions
sysdefault:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
dmix:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample mixing device
dsnoop:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample snooping device
hw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Hardware device with all software conversions
And

Code: Select all

aplay -D hw:CARD=Headphones,DEV=0 foo.wav
aplay -D hw:CARD=HDMI,DEV=0 foo.wav
aplay -D hw:CARD=b1,DEV=0 foo.wav
all do the expected thing, and are available simultaneously. The Raspbian volume plugin gets totally lost with the multiple devices though.

As to why this driver has two ways to configure stuff, I have no idea!
I am running latest and the three items have no effect on aplay -l/-L

Code: Select all

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_compat_alsa=0

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7555
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Independent Sound HDMI0 and HDMI1

Tue Aug 27, 2019 7:14 pm

bunklung wrote:
Tue Aug 27, 2019 5:51 pm
6by9 wrote:
Tue Aug 27, 2019 5:00 pm
Add

Code: Select all

snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_compat_alsa=0
to /boot/cmdline.txt (do NOT add any line breaks) and reboot.
I am running latest and the three items have no effect on aplay -l/-L
Read what I wrote (hint, NOT config.txt)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Tue Aug 27, 2019 7:40 pm

6by9 wrote:
Tue Aug 27, 2019 7:14 pm
bunklung wrote:
Tue Aug 27, 2019 5:51 pm
6by9 wrote:
Tue Aug 27, 2019 5:00 pm
Add

Code: Select all

snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_compat_alsa=0
to /boot/cmdline.txt (do NOT add any line breaks) and reboot.
I am running latest and the three items have no effect on aplay -l/-L
Read what I wrote (hint, NOT config.txt)
Oh man, sorry about that, total brain fart there :(

We are good! Now I just need to figure out the udev rules :)

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Tue Aug 27, 2019 8:53 pm

6by9 wrote:
Tue Aug 27, 2019 5:00 pm

all do the expected thing, and are available simultaneously. The Raspbian volume plugin gets totally lost with the multiple devices though.

As to why this driver has two ways to configure stuff, I have no idea!
Hmm, this might not work after all as with dual seat. When I add a USB device, the Raspbian volume plugin has no issues with the added sound device. If I can't get the sound to be exposed in X, this isn't a realistic solution for everyone.

You mention the phase mangled. Does that mean a fix is planned?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24149
Joined: Sat Jul 30, 2011 7:41 pm

Re: Independent Sound HDMI0 and HDMI1

Tue Aug 27, 2019 8:58 pm

bunklung wrote:
Tue Aug 27, 2019 8:53 pm
6by9 wrote:
Tue Aug 27, 2019 5:00 pm

all do the expected thing, and are available simultaneously. The Raspbian volume plugin gets totally lost with the multiple devices though.

As to why this driver has two ways to configure stuff, I have no idea!
Hmm, this might not work after all as with dual seat. When I add a USB device, the Raspbian volume plugin has no issues with the added sound device. If I can't get the sound to be exposed in X, this isn't a realistic solution for everyone.

You mention the phase mangled. Does that mean a fix is planned?
We are still getting used to this dual stuff, and the audio has taken a bit of a back seat to the video side. It took me quite a bit of digging to get the ability to select 0 or 1 going (although it was a relatively small change in the end), and its all rather a can of worms. As for fixes, nothing is scheduled, but we do a lot of bug fixing which isn't scheduled anyway,
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Tue Aug 27, 2019 9:12 pm

6by9 wrote:
Tue Aug 27, 2019 5:25 pm
6by9 wrote:
Tue Aug 27, 2019 5:00 pm
As to why this driver has two ways to configure stuff, I have no idea!
A quick poke in the git history reveals that it was upstream that mangled this and added the module parameters.
We could change the defaults, but that will break some userland handling of audio devices (Raspbian's volume plugin for one).
Okay, if I only set: snd_bcm2835.enable_hdmi=1

I can get the sound to play simultaneously and I can set the default within X. Perhaps it's due to the headphone option or the the other switch?

I will mess some more and see if I can assign the channels to each seat and play nice in X.

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Tue Aug 27, 2019 11:26 pm

bunklung wrote:
Tue Aug 27, 2019 8:53 pm
6by9 wrote:
Tue Aug 27, 2019 5:00 pm

all do the expected thing, and are available simultaneously. The Raspbian volume plugin gets totally lost with the multiple devices though.

As to why this driver has two ways to configure stuff, I have no idea!
Hmm, this might not work after all as with dual seat. When I add a USB device, the Raspbian volume plugin has no issues with the added sound device. If I can't get the sound to be exposed in X, this isn't a realistic solution for everyone.

You mention the phase mangled. Does that mean a fix is planned?
UDEV rule for seat 1/hdmi1:

Code: Select all

TAG=="seat", ATTR{id}=="b1", ATTR{number}=="2", SUBSYSTEM=="sound", KERNEL=="card2", ENV{ID_SEAT}="seat1"
Assumes you have:

Code: Select all

snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_compat_alsa=1
to /boot/cmdline.txt (do NOT add any line breaks)

So snd_bcm2835.enable_compat_alsa=0 is the problem, if you set it to snd_bcm2835.enable_compat_alsa=1 or leave it out, you have control within X.

However, I can not control the volume, which is aligned with your observation of the shared PCM Playback Route.

So how does that go about getting it's own PCM playback Route for HDMI1?

bunklung
Posts: 82
Joined: Tue Jun 25, 2019 12:10 pm

Re: Independent Sound HDMI0 and HDMI1

Wed Aug 28, 2019 12:05 am

jamesh wrote:
Tue Aug 27, 2019 8:58 pm
bunklung wrote:
Tue Aug 27, 2019 8:53 pm
6by9 wrote:
Tue Aug 27, 2019 5:00 pm

all do the expected thing, and are available simultaneously. The Raspbian volume plugin gets totally lost with the multiple devices though.

As to why this driver has two ways to configure stuff, I have no idea!
Hmm, this might not work after all as with dual seat. When I add a USB device, the Raspbian volume plugin has no issues with the added sound device. If I can't get the sound to be exposed in X, this isn't a realistic solution for everyone.

You mention the phase mangled. Does that mean a fix is planned?
We are still getting used to this dual stuff, and the audio has taken a bit of a back seat to the video side. It took me quite a bit of digging to get the ability to select 0 or 1 going (although it was a relatively small change in the end), and its all rather a can of worms. As for fixes, nothing is scheduled, but we do a lot of bug fixing which isn't scheduled anyway,
It's progress so that's awesome. Hopefully we can get to a point where the dual seat setup is seemless, intuitive, and turnkey.

When you say video side, are you all working on a one GPU split between two seats? That's high on my wish list :)

Keep up the great work.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24149
Joined: Sat Jul 30, 2011 7:41 pm

Re: Independent Sound HDMI0 and HDMI1

Wed Aug 28, 2019 7:28 am

bunklung wrote:
Wed Aug 28, 2019 12:05 am
jamesh wrote:
Tue Aug 27, 2019 8:58 pm
bunklung wrote:
Tue Aug 27, 2019 8:53 pm


Hmm, this might not work after all as with dual seat. When I add a USB device, the Raspbian volume plugin has no issues with the added sound device. If I can't get the sound to be exposed in X, this isn't a realistic solution for everyone.

You mention the phase mangled. Does that mean a fix is planned?
We are still getting used to this dual stuff, and the audio has taken a bit of a back seat to the video side. It took me quite a bit of digging to get the ability to select 0 or 1 going (although it was a relatively small change in the end), and its all rather a can of worms. As for fixes, nothing is scheduled, but we do a lot of bug fixing which isn't scheduled anyway,
It's progress so that's awesome. Hopefully we can get to a point where the dual seat setup is seemless, intuitive, and turnkey.

When you say video side, are you all working on a one GPU split between two seats? That's high on my wish list :)

Keep up the great work.
Not working on dual seat at all. Just general dual output stuff, ie dealing with the fallout from having two displays.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

Return to “General discussion”