Running boom bonnet and HDMI audio at the same time

Moderators: mdrjr, odroid

Running boom bonnet and HDMI audio at the same time

Unread postby mad_ady » Sat Mar 31, 2018 1:10 am

I have kodi (and X11) using HDMI Audio as the default audio through pulseaudio. I also have mpd using the boom bonnet specifically through pulseaudio. (on a c2)

There's a problem - I can't use the boom bonnet while I have HDMI audio playing (and there's a setting in kodi to mute/release audio channel after a set silence period). After this period the boom bonnet plays. If the boom bonnet is in use and I start/use kodi, I get no sound from kodi and video playback freezes (black screen, no audio, but the progress bar advances). I usually need to reboot to recover (pulse doesn't seem to release audio)

I can share my config but I wanted to ask if there's a known incompatibility, since both hdmi and boom bonnet use presumably the same i2s bus?
User avatar
mad_ady
 
Posts: 4571
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Running boom bonnet and HDMI audio at the same time

Unread postby odroid » Sat Mar 31, 2018 7:49 pm

Exynos-5422 platforms share the I2S and HDMI sound outputs path.
So there is no way to select one output devices and both outputs have the same audio always.

But, C1 & C2 have two isolated sound output devices.
What happens if you choose "speaker test" button on the Pulse audio GUI settings after/before changing the default output device.
User avatar
odroid
Site Admin
 
Posts: 28697
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Running boom bonnet and HDMI audio at the same time

Unread postby mad_ady » Sun Apr 01, 2018 6:13 am

I've tried the pulse audio volume control + speaker-test.

When Kodi wakes up audio, this is what I get in dmesg (and I get a pop in the boom bonnet speakers):
Code: Select all
[94684.908792] [aml-i2s-dai]i2s dma ffffff80004b1000,phy addr 1569062912,mode 0,ch 2
[94684.910719] ----aml_hw_iec958_init,runtime->rate=44100,sample_rate=5--
[94684.917313] aml_set_spdif_clk rate
[94684.920629] divider=22,frac=13030400,SDMval=2364
[94684.925142] set normal 512 fs /4 fs
[94684.928665] iec958 mode PCM16
[94684.931514] IEC958 16bit
[94684.934006] hdmitx: audio: aout notify rate 44100
[94684.938747] hdmitx: audio: aout notify size 16
[94684.943064] 958 with i2s
[94684.945983] [aml-i2s-dai]i2s dma ffffff80004b1000,phy addr 1569062912,mode 0,ch 2
[94684.953121] ----aml_hw_iec958_init,runtime->rate=44100,sample_rate=5--
[94684.959636] aml_set_spdif_clk rate
[94684.962837] divider=22,frac=13030400,SDMval=2364
[94684.967517] set normal 512 fs /4 fs
[94684.970841] iec958 mode PCM16
[94684.973771] IEC958 16bit
[94684.976271] hdmitx: audio: aout notify rate 44100
[94684.981021] hdmitx: audio: aout notify size 16
[94684.985325] 958 with i2s
[94684.988634] aiu i2s playback enable
[94684.991287] audio_hw_958_enable 1


When kodi idles for too long it releases audio (no pops thankfully):
Code: Select all
[94815.359895] aiu i2s playback disable
[94815.360026] audio_hw_958_enable 0


When starting pulse audio volume control, I get a pop in the boom bonnet speakers (like when it's initialized):
Code: Select all
[94879.565348] 3:3:1: cannot get freq at ep 0x84
[94879.568373] 3:3:1: cannot get freq at ep 0x84
[94879.579344] [aml-i2s-dai]i2s dma ffffff800174d000,phy addr 1570373632,mode 0,ch 2
[94879.581222] ----aml_hw_iec958_init,runtime->rate=44100,sample_rate=5--
[94879.587888] aml_set_spdif_clk rate
[94879.591225] divider=22,frac=13030400,SDMval=2364
[94879.595795] set normal 512 fs /4 fs
[94879.599238] iec958 mode PCM16
[94879.602075] IEC958 16bit
[94879.604619] hdmitx: audio: aout notify rate 44100
[94879.609171] hdmitx: audio: aout notify size 16
[94879.613614] 958 with i2s
[94879.616192] [aml-i2s-dai]i2s dma ffffff800174d000,phy addr 1570373632,mode 0,ch 2
[94879.623512] ----aml_hw_iec958_init,runtime->rate=44100,sample_rate=5--
[94879.629939] aml_set_spdif_clk rate
[94879.633338] divider=22,frac=13030400,SDMval=2364
[94879.637878] set normal 512 fs /4 fs
[94879.641317] iec958 mode PCM16
[94879.644286] IEC958 16bit
[94879.646756] hdmitx: audio: aout notify rate 44100
[94879.651407] hdmitx: audio: aout notify size 16
[94879.655840] 958 with i2s
[94879.658761] aiu i2s playback enable
[94879.664178] [aml-i2s-dai]i2s dma ffffff80004b1000,phy addr 1569062912,mode 0,ch 2
[94879.669198] ----aml_hw_iec958_init,runtime->rate=44100,sample_rate=5--
[94879.675727] aml_set_spdif_clk rate
[94879.679018] divider=22,frac=13030400,SDMval=2364
[94879.685199] set normal 512 fs /4 fs
[94879.687042] iec958 mode PCM16
[94879.689968] IEC958 16bit
[94879.692525] hdmitx: audio: aout notify rate 44100
[94879.697122] hdmitx: audio: aout notify size 16
[94879.701522] 958 with i2s
[94879.704208] [aml-i2s-dai]i2s dma ffffff80004b1000,phy addr 1569062912,mode 0,ch 2
[94879.711446] ----aml_hw_iec958_init,runtime->rate=44100,sample_rate=5--
[94879.717978] aml_set_spdif_clk rate
[94879.721286] divider=22,frac=13030400,SDMval=2364
[94879.725913] set normal 512 fs /4 fs
[94879.729295] iec958 mode PCM16
[94879.732267] IEC958 16bit
[94879.734730] hdmitx: audio: aout notify rate 44100
[94879.739383] hdmitx: audio: aout notify size 16
[94879.743820] 958 with i2s
[94879.746699] aiu i2s playback enable
[94879.749743] audio_hw_958_enable 1
[94879.755522] i2sin_fifo0_set_buf
[94879.756269] i2sin_fifo0_set_buf


I've tried speaker test with HDMI as default and I do get the expected sound. Next I've switched the Boom Bonnet as default output, but I get no sound from speaker test (I do get feedback in the GUI that the sound is exiting the correct sound card). I also do not get any messages in dmesg. Volume was not an issue - I've boosted it to the max and no audio.

Next, when I restarted Kodi, I get the audio pop and these messages:
Code: Select all
[95872.203374] aiu i2s playback disable
[95872.203433] audio_hw_958_enable 0
[95872.205471] aiu i2s playback disable
[95872.208171] audio_hw_958_enable 0
[95878.773001] [aml-i2s-dai]i2s dma ffffff80004b1000,phy addr 1569062912,mode 0,ch 2
[95878.774874] ----aml_hw_iec958_init,runtime->rate=44100,sample_rate=5--
[95878.781468] aml_set_spdif_clk rate
[95878.784700] divider=22,frac=13030400,SDMval=2364
[95878.789268] set normal 512 fs /4 fs
[95878.792794] iec958 mode PCM16
[95878.795646] IEC958 16bit
[95878.798143] hdmitx: audio: aout notify rate 44100
[95878.802869] hdmitx: audio: aout notify size 16
[95878.807200] 958 with i2s
[95878.809809] [aml-i2s-dai]i2s dma ffffff80004b1000,phy addr 1569062912,mode 0,ch 2
[95878.817166] ----aml_hw_iec958_init,runtime->rate=44100,sample_rate=5--
[95878.823662] aml_set_spdif_clk rate
[95878.826956] divider=22,frac=13030400,SDMval=2364
[95878.831547] set normal 512 fs /4 fs
[95878.834976] iec958 mode PCM16
[95878.837905] IEC958 16bit
[95878.840441] hdmitx: audio: aout notify rate 44100
[95878.845063] hdmitx: audio: aout notify size 16
[95878.849461] 958 with i2s
[95878.852409] aiu i2s playback enable
[95878.855425] audio_hw_958_enable 1

User avatar
mad_ady
 
Posts: 4571
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Running boom bonnet and HDMI audio at the same time

Unread postby mad_ady » Tue Jun 12, 2018 11:34 pm

I'd like to revive this - maybe I can find a workaround.
So, I played with it a bit and pulseaudio is not an issue. I am able to run two programs with different sound outputs in pulseaudio (one goes through HDMI, the other to the Boom Bonnet - confirmed visually in the pulseaudio GUI), but only one is heard, based on what was active last time (either HDMI or Boom Bonnet). I'd like to learn what is needed to toggle the other one (I can live with only one active at a time). Kodi does it (can force HDMI when there is sound generated by the OSD, and can release it after a timeout), but I'd like to be able to do it as well programmatically.

Any ideas where I should look? I'd say it's something controlled by the driver (since it outputs in dmesg when the change occurs), but I don't know how to trigger it.
User avatar
mad_ady
 
Posts: 4571
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1


Return to I2S Devices (HiFi Shield DAC and Stereo Boom Bonnet Kit)

Who is online

Users browsing this forum: No registered users and 0 guests