PDA

View Full Version : piCorePlayer 3.1 - can you send the audio output to HDMI and analog?



kalittle
2017-01-29, 14:13
Greetings everyone - just built piCorePlayer 3.1 on pi 3 board as my Duet reciever died a horrible death. On my Duet, I could send the output to both analog and optical outputs - I sent one to my receiver and one to my whole house sound system. I would like to send the output from piCorePlayer to both analog and HDMI, which would accomplish the same goal.

Any suggestions or ideas would be appreciated. Ken

Greg Erskine
2017-01-29, 15:30
Greetings everyone - just built piCorePlayer 3.1 on pi 3 board as my Duet reciever died a horrible death. On my Duet, I could send the output to both analog and optical outputs - I sent one to my receiver and one to my whole house sound system. I would like to send the output from piCorePlayer to both analog and HDMI, which would accomplish the same goal.

Any suggestions or ideas would be appreciated. Ken

Hi Ken,

It probably can be done but I never succeeded.

There are numerous people though that have multiple USB headphone DACs (4 I think). There was one chap in the piCorePlayer 3.10 thread in the last week or two.

These people used multiple instances of squeezelite, rather than one with multiple outputs.

regards
Greg

kalittle
2017-01-30, 12:06
So, based on Greg's suggestion, I've done a little looking, and I need to add something such as this:

sudo /mnt/mmcblk0p2/tce/squeezelite-armv6hf -n "HDMI-Sound" -o stereosurround -a 80:::0: -m ab:cd:ef:12:34:05 -C 1 -G 7:L -z

As per my readings, this command should be placed in add the command to "User commands" on the [Tweaks] page.

This is an example command I've taken from another thread. My question is where I would find this command in my system that is issued to start my player? I ask, because then I could set the system to output to HDMI, restart the system, and then grab the startup command knowing I've got it right. Then I could switch the GUI back to analog, add my copied command to the Tweaks/User command, restart the system, and BOOM, dual outputs!

Please let where to find the startup command, and/or if I've suggested something really stupid! Ken

kalittle
2017-01-30, 18:52
Ok - that plan did not work - the HDMI option appears to be buried in the config file. So here's where I'm at trying to start a second instance.

I've modified the player to output to the HDMI, restarted the server so it's playing on HDMI. Then I copied /usr/local/sbin/config.cfg to HDMIconfig.cfg, and changed ownership:

-rw-rw-r-- 1 tc staff 1667 Jan 30 20:31 config.cfg
-rw-r--r-- 1 tc staff 1667 Jan 30 20:36 HDMIconfig.cfg

So now I've got a working HDMI config. Now if I go to the startup script (/tmp/tcloop/pcp-squeezelite/usr/local/bin), there's a squeezelite exe there. The script to start it appears to be in "/tmp/tcloop/pcp-squeezelite/usr/local/etc/init.d" - name squeezelite

It appears I could copy this /tmp/tcloop/pcp-squeezelite/usr/local/etc/init.d/squeezelite to squeezelite2, and then change the config to my HDMIconfig.cfg I created.

Do I need to copy the exe as well? Any help appreciated... Ken

Greg Erskine
2017-01-30, 21:35
So, based on Greg's suggestion, I've done a little looking, and I need to add something such as this:

sudo /mnt/mmcblk0p2/tce/squeezelite-armv6hf -n "HDMI-Sound" -o stereosurround -a 80:::0: -m ab:cd:ef:12:34:05 -C 1 -G 7:L -z

As per my readings, this command should be placed in add the command to "User commands" on the [Tweaks] page.

This is an example command I've taken from another thread. My question is where I would find this command in my system that is issued to start my player? I ask, because then I could set the system to output to HDMI, restart the system, and then grab the startup command knowing I've got it right. Then I could switch the GUI back to analog, add my copied command to the Tweaks/User command, restart the system, and BOOM, dual outputs!

Please let where to find the startup command, and/or if I've suggested something really stupid! Ken

Hi kalittle,

The command should be more like:

/mnt/mmcblk0p2/tce/squeezelite-armv6hf -n HDMI-Sound -o stereosurround -a 80:::0: -m ab:cd:ef:12:34:05

No quotes and no -z. stereosurround depends on your ALSA settings, I doubt it is stereosurround.

Refer: http://forums.slimdevices.com/showthread.php?106755-Announce-piCorePlayer-3-10&p=874406&viewfull=1#post874406


regards
Greg

Greg Erskine
2017-01-30, 21:43
Ok - that plan did not work - the HDMI option appears to be buried in the config file. So here's where I'm at trying to start a second instance.

I've modified the player to output to the HDMI, restarted the server so it's playing on HDMI. Then I copied /usr/local/sbin/config.cfg to HDMIconfig.cfg, and changed ownership:

-rw-rw-r-- 1 tc staff 1667 Jan 30 20:31 config.cfg
-rw-r--r-- 1 tc staff 1667 Jan 30 20:36 HDMIconfig.cfg

So now I've got a working HDMI config. Now if I go to the startup script (/tmp/tcloop/pcp-squeezelite/usr/local/bin), there's a squeezelite exe there. The script to start it appears to be in "/tmp/tcloop/pcp-squeezelite/usr/local/etc/init.d" - name squeezelite

It appears I could copy this /tmp/tcloop/pcp-squeezelite/usr/local/etc/init.d/squeezelite to squeezelite2, and then change the config to my HDMIconfig.cfg I created.

Do I need to copy the exe as well? Any help appreciated... Ken

Hi kalittle,

You are going down a rabbit hole here. You have to remember that piCore is an embedded Linux running from RAM, once you reboot the RAM is cleared and Linux is reinstalled from SD card. Refer to piCore documentation about persistence.

I am hoping the people that have done this will chime in with their solutions for you. It will be a lot easier.

We usually have to reboot, when we change from "Analog Audio" to "HDMI audio". I am not sure if that necessity has changed in recent releases of Raspberry Pi firmware?

regards
Greg

Roland0
2017-01-31, 05:31
Greetings everyone - just built piCorePlayer 3.1 on pi 3 board as my Duet reciever died a horrible death. On my Duet, I could send the output to both analog and optical outputs - I sent one to my receiver and one to my whole house sound system. I would like to send the output from piCorePlayer to both analog and HDMI, which would accomplish the same goal.


A more elegant solution is to configure ALSA to send the sound to two devices, then there's no need for multiple squeezelite instances.

edit /etc/asound.conf (note: adjust card/device to match your setup):


pcm.!default {
type plug
slave {
pcm "both"
}
}
pcm.both {
type route
slave {
pcm multi
channels 4
}

ttable.0.0 1.0
ttable.1.1 1.0
ttable.0.2 1.0
ttable.1.3 1.0
}
pcm.multi {
type multi
slaves.a {
pcm "analog"
channels 2
}
slaves.b {
pcm "hdmi"
channels 2
}
bindings.0.slave a
bindings.0.channel 0
bindings.1.slave a
bindings.1.channel 1
bindings.2.slave b
bindings.2.channel 0
bindings.3.slave b
bindings.3.channel 1
}
pcm.hdmi {
type hw
card 0
device 0
channels 2
}
pcm.analog {
type hw
card 0
device 3
channels 2
}

and use the "both" device

Note: make sure /etc/asound.conf survives a reboot.

kalittle
2017-01-31, 18:45
Still chasing the rabbit - thanks to both Greg and Roland0 for their assistance.

Greg - good advice - will dig into the PiCore documentation to understand persistance, and how to get a change to survive a reboot.

Roland0 - question around your comment at the start of your code - (note: adjust card/device to match your setup)

What does this mean? where is this "card/device" you mention? I made your suggested changes to the /etc/asound.conf file, but the player would not restart until I reset the file to it's original content (or rebooted to reset everything)! I think if I could understand this "card/device" change you mention this might work. I would then research how to make the change permanent.


Continuing to dig - apologies for the stupid questions. ken

Greg Erskine
2017-01-31, 20:59
Still chasing the rabbit - thanks to both Greg and Roland0 for their assistance.

Greg - good advice - will dig into the PiCore documentation to understand persistance, and how to get a change to survive a reboot.

BTW: The backup command on the web GUI will save /etc/asound.conf . On the command line $ pcp bu also does a backup.


Roland0 - question around your comment at the start of your code - (note: adjust card/device to match your setup)

What does this mean? where is this "card/device" you mention? I made your suggested changes to the /etc/asound.conf file, but the player would not restart until I reset the file to it's original content (or rebooted to reset everything)! I think if I could understand this "card/device" change you mention this might work. I would then research how to make the change permanent.ken

hi Ken,

From [Main Page] in [Beta] mode > [Diagnostics] > [Sound]. Scroll down to "[ INFO ] PLAYBACK Hardware Devices" and you will see the cards and devices for your hardware. This list is generated by the Linux command $ aplay -l

WARNING: The [Sound] generates a signal on right then left channel, if volume is high, you my go deaf!

Should look something like this!


**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
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
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0


card 0 is the RPi sound card (stupid card name ALSA, it is really confusing starting out)
card 1 is one of those little generic USB DAC (very generic card name - Device)

regards
Greg

kalittle
2017-02-02, 17:06
Thanks Greg for the suggestions - backup saved my changes so I don't have to re-create them each time - Thanks!

Found the sound config -

[ INFO ] PLAYBACK hardware Devices

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/8
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
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0

I don't see HDMI listed here - Not sure how to proceed with Roland0's suggestion. In his config, it says device 0 for hdmi and device 3 for analog - how would that correlate to the above?

Roland0
2017-02-03, 08:36
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]

I don't see HDMI listed here

:confused:



Not sure how to proceed with Roland0's suggestion. In his config, it says device 0 for hdmi and device 3 for analog - how would that correlate to the above?
device 1 for hdmi and device 0 for analog