VS1005 GPIO Access

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
123456
User
Posts: 2
Joined: Mon 2022-03-14 11:21

Re: VS1005 GPIO Access

Post by 123456 »

Hello,

SetMasterVolume will adjust the I2S volume at the same time. How to adjust the analog output volume individually? Thank you.
Hannu
Senior User
Posts: 396
Joined: Mon 2016-05-30 11:54
Location: Finland
Contact:

Re: VS1005 GPIO Access

Post by Hannu »

Just to be sure... Are you really working on a 9 year old system?

The I2S hardware is configured to read from DAC path. Unfortunately the source to I2S is after DAC volume control and it changes I2S volume also.
123456
User
Posts: 2
Joined: Mon 2022-03-14 11:21

Re: VS1005 GPIO Access

Post by 123456 »

Hello,

We use 5 external GPIO to control VS1005 for Vol+ Vol- Play/Pause << and >> without MCU. Similar to the 1st post. The reply from Panu mentioned that "I2S output is affected when I2S_CF_MODE is 0". Is that meant if I2S_CF_MODE is not 0 then I2S output will not be affected?

May I know any modern methods to control VS1005 effectively and easily? Thank you.
User avatar
pasi
VLSI Staff
Posts: 2006
Joined: Thu 2010-07-15 16:04

Re: VS1005 GPIO Access

Post by pasi »

See https://www.vlsi.fi/fileadmin/software/ ... _Audio.pdf

The automatic I2S mode (I2S_CF_MODE=0, driver AUOI2SMA.DL3) uses the same signal as the DAC and is affected by the same volume control. When the automatic mode is not used, it would be possible to route the signal from SRC to I2S manually (I2S_CF_MODE=1, similar to what AUOSPDA.DL3 does with SPDIF output).

Currently there doesn't seem to be a driver for that specific case.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
User avatar
Henrik
VLSI Staff
Posts: 1271
Joined: Tue 2010-06-22 14:10

Re: VS1005 GPIO Access

Post by Henrik »

Hello 123456,

Pasi already gave a link to the VSOS Audio document; the relevant part of that is Chapter I2S Audio Drivers / Driver AUOI2SMA.DL3. See the brown arrow close to the blue text I2S_CF to see which hardware path the driver utilizer. As you can see, with this driver main volume control (the amplifier symbol below the blue DAC_CTL text) is applied both to I2S and the DAC output.

It is possible to create a driver, using different hardware audio paths, where there would be separate volume controls for the DAC and I2S outputs. Implementing it would, however, take a bit of time.

Before going into writing a new audio driver, can you explain a little bit what your application is? Where does it get its input? Is it an "MP3 player", or does it read its input from an audio source, like the ADC, I2S, et cetera?

Kind regards,
- Henrik
Good signatures never die. They just fade away.
User avatar
Henrik
VLSI Staff
Posts: 1271
Joined: Tue 2010-06-22 14:10

Re: VS1005 GPIO Access

Post by Henrik »

Hello!

Just to let you know that I currently have a dual-volume DAC + I2S system in testing. If everything goes well, I may be able to release it tomorrow.

Kind regards,
- Henrik
Good signatures never die. They just fade away.
User avatar
Henrik
VLSI Staff
Posts: 1271
Joined: Tue 2010-06-22 14:10

Re: VS1005 GPIO Access

Post by Henrik »

Hello!

The new I2S driver with some documentation is available at:
viewtopic.php?f=13&t=2926

If there are any questions or comments regarding the driver, let's have them there to keep threads clearer.


An additional comment: The programming example (SetMasterVolume()) that you have seemed to look at is from 2013 which is before we built operating system support for volume control. It pokes the hardware much too intimately, and it should not be used as a basis for new software. To see the correct way of changing volume, have a look at source code for programs like AuOutput.dl3 and PlayDirP.dl3. They are available in the latest Root Images and Libraries with Source Code and Documentation package, provided at the end of the Latest VSOS Kernel thread. The current version of the package is 3.65. The thread where you can find it is below:
viewtopic.php?f=13&t=680
Go straight to the last page for the software. When you look at the source code, have a close look at ioctl() calls, particularly those with parameters like IOCTL_AUDIO_GET_VOLUME and IOCTL_AUDIO_SET_VOLUME. That's where things happen. Also, the VS1005 VSOS Audio Subsystem document, available in the same package, has a chapter called VSOS Audio ioctl() Controls. That chapter has a particularly relevant section Volume Control.

Kind regards,
- Henrik
Good signatures never die. They just fade away.
Post Reply