To clarify the relationship of HALs and device:
A HAL is a configuration that is provided to the softmixer, so that it can create the virtual PCM with the correct bindings between the real hardware and the 4a-streams. For example, we want a 'multimedia' and a 'navigation' stream, both with a 'Playback Volume' control, but the real hardware provides only one PCM with a control named 'Master Playback Volume". So we wrote a HAL that tells the softmixer that we want two PCM ('multimedia', 'navigation'), with a 'Playback Volume' control, and bind both streams to the single PCM exposed by the hardware.
Because of that, we end up with 2 audio cards, 3 PCMs, and 3 controls (one per PCM). The real audio card should be the first, so let's assume it's URI are in this form: hw:1,X,X. The softmixer use snd-aloop to build a virtual audio card, let's assume it use: hw:2,X,X. And finally, because softmixer is actually routing and mixing audio from the virtual card to the real one, it means that it have to open the destination PCM. This is why you can't play anything on hw:1,X,X: the softmixer is using it, this is why you have 'busy resource'.
So, in conclusion, you can play audio on PCMs exposed by the softmixer, but you can play audio only on PCMs not used by the softmixer. Meaning that the corresponding HAL should be disabled, to prevent the softmixer from using it.
---
Regards, Loïc Collignon [IoT.bzh]
On 2018-10-31 10:08, I37546_CHIN@xxxxxxxxxxxxxx wrote:
Hi Loic
Thank you for the reply.
In fact I've also read the HAL's docs, but still not very clearly about the relationship of HAL's and device.
Maybe I missed something and if you could give some more advice it could be very helpful.
I can see hal-4a-rcar-m3 is currently applied on my M3(SK) board and the roles of radio/multimedia/emergency/navigation are available
through the 4a-api commands.
But I still don't understand why only the pair of USB Audio + hw:2,0,0 works well.
I can find a card 1 for ak4613 (card 0 is for loopback) and an on-board earphone output,
but hw:1,0,0 always returns a device busy.
(and hw:2,0,1 also returns a device busy, no matter which role is used)
Thanks
ChenWei
From: Loïc [mailto:loic.collignon@xxxxxxx] Sent: Wednesday, October 31, 2018 5:22 PM To: I37546 Chin I Cc: automotive-discussions@xxxxxxxxxxxxxxxxxxxxxxxxx Subject: Re: 4a-play on M3
Hello!
I agree that the note on 4a-play isn't clear enough. What it means is that the command does not check if you specify the right role according to the right device. So if you play something on a PCM (i.e. hw:2,0,0) but specify the wrong role (i.e. navigation which is supposed to be on hw:2,0,1), it means that the wrong role will be opened, preventing others to open the same role. But you will still play on the specified PCM (hw:2,0,0 in this case).
So nothing to do with USB or not.
The PCM exposed by 4a are streams, handled by the softmixer. Their ID are hw:X,0,Y, where X is the card number and Y is the stream id. Usually X=2 because it's the second audio card. But it can depend on the hardware. 4a binds roles to streams, so everything depends on the selected HAL: http://docs.iot.bzh/docs/apis_services/en/dev/reference/audio/high-level-api/TipsAndTricks/HALs.html
---
Regards, Loïc Collignon [IoT.bzh]
On 2018-10-31 06:31, I37546_CHIN@xxxxxxxxxxxxxx wrote:
Hi,
I'm using 4a-play to playback WAV files on M3 with ff 6.0.1.
By referring the web documents, I can get sound from a USB headphone,
but nothing from the on-board earphone jack.
The Docs say, usually device "hw:2,0,0" matches "multimedia", while I find it also works with "navigation".
Does that mean, "hw:2,0,0" stands for a USB Audio?
And is USB Audio the only device supported currently?
Any suggestion appreciated.
Thanks
ChenWei
|