Close

A required mixer setting

A project log for Raspberry Pi TOSLINK transceiver hat

Optical digital audio I/O for Raspberry Pi

nick-sayerNick Sayer 11/18/2021 at 06:245 Comments

Note that to get the output to work, you have to set the TX source to "AIF" - that is, you have to configure the chip to generate the TX output from the i2s input on the chip. You can do this in amixer by using cset to set the "Tx Source" control to whichever value (probably 1) that decodes to "AIF". The default is "S/PDIF RX", which means that it comes from the receive input, but that will only work if the i2s clocks happen to match up with the S/PDIF received signal.

If you don't do this, then playing audio won't light up the output receptacle (which means it just won't work).

You don't need to do this for recording - it always sends the S/PDIF receiver input to the i2s receive pin. But you must insure that the parameters for the reception actually match up with the input source.

Discussions

billfeliciano wrote 05/26/2023 at 23:47 point

Do those lines go in the config.txt file? Thanks

  Are you sure? yes | no

Nick Sayer wrote 05/27/2023 at 04:53 point

No, they're command line commands.

Note (for the next person) that you may need to use a "-c n" argument (n is the card number) to specify the WM8804 interface. You can list the interfaces with "aplay -l".

  Are you sure? yes | no

Nick Sayer wrote 05/01/2023 at 21:58 point

Sorry I wasn't more specific, but at the moment I am out of town and away from my available RPis.

  Are you sure? yes | no

LATBauerdick wrote 05/01/2023 at 21:57 point

Thank you, the concrete command I needed was

```

# amixer controls
numid=1,iface=MIXER,name='Tx Source'

# amixer cset numid=1 'AIF'

numid=1,iface=MIXER,name='Tx Source'
  ; type=ENUMERATED,access=rw------,values=1,items=2
  ; Item #0 'S/PDIF RX'
  ; Item #1 'AIF'
  : values=1

```

that did it (sorry, took me some time to figure this out as I now nothing about the raspberry/linux audio subsystem)

  Are you sure? yes | no

LATBauerdick wrote 04/05/2023 at 22:44 point

Hi Nick, I received the HAT today but cannot get it to work. `amixer` returns 

```

Simple mixer control 'Tx Source',0
  Capabilities: enum
  Items: 'S/PDIF RX' 'AIF'
  Item0: 'S/PDIF RX'

```

and if I do `amixer cset numid=1 1` nothing happens and the transmitter light does not go on. I assume I need a different command to get it going? Can you help me?

Thanks!

  Are you sure? yes | no